Monaca Docs
Search…
Monaca CLI Commands
Command
Description
Sign in to Monaca Cloud.
Sign out from Monaca Cloud.
Update projects created with CLI 2.x to the latest Monaca project structure.
Initialize projects created using other CLI tools to execute with Monaca.
Register a new Monaca account.
Create a new local Monaca project.
Clone a project from Monaca Cloud.
Import a project from Monaca Cloud.
Download a project from Monaca Cloud.
Upload a project to Monaca Cloud.
Manage signing configurations for iOS and Android builds.
Build a project in Monaca Cloud.
Open the project configuration on Monaca Cloud.
Run a local web server for preview .
Run an app on a device using Monaca Debugger.
Transpile project source code.
Manage Monaca CLI configuration.
Manage the Cordova plugins of a project.
Display docs of Monaca CLI, Onsen UI and Tutorials.

monaca login

Signs in to Monaca Cloud. You will be asked to input your Monaca account information (username and password).
1
$ monaca login [options]
Copied!
Options
  • email: Email address used to login to Monaca Cloud.
Example
Here is an example of how to login to Monaca Cloud with Monaca CLI:
1
$ monaca login
2
$ monaca login [email protected].io
3
$ echo "mypass" | monaca login [email protected].io
Copied!

monaca logout

Signs out from Monaca Cloud and removes the stored login token.
1
$ monaca logout
Copied!
Example
Here is an example of how you logout from Monaca Cloud with the Monaca CLI:
1
$ monaca logout
2
Signing out from Monaca Cloud...
3
You have been signed out.
4
Removed Monaca Debugger pairing information.
Copied!

monaca update

This command is available from Monaca CLI 3.x. It is used to update old projects created with Monaca CLI 2.x.
Non-transpile project
The package.json will be modified with the following changes:
  • A monaca:preview command will be added to the script property.
  • A dev command will be added to the script unless it already exists.
    • "dev": "browser-sync start -s www/ --watch --port 8080 --ui-port 8081"
  • Browser-sync and Cordova will be added as devDependencies.
Transpile projects
The package.json will be modified with the following changes:
  • monaca:preview, monaca:transpile and monaca:debug commands will be added to the script property.
  • dev, build, and watch commands will be added to the script unless they already exist.
  • Required packages including Webpack and Cordova will be added as devDependencies.
1
$ monaca update [options]
Copied!
Options
  • --force: Accept default.
  • --createPackageJson: Create a basic package.json file with a name and a description if the project doesn't have a package.json file.
Example
Here is an example of how to use this command:
1
$ monaca update
2
$ monaca update --force --createPackageJson
Copied!

monaca init

This command is available from Monaca CLI 3.x. It initializes a project created using other CLI tool to execute it with Monaca (Monaca CLI, Monaca Cloud IDE, Monaca Localkit). The following resources will be added to the project.
  • www/components: Monaca loaders needed to use the GUI page to include the CSS/JavaScript libraries into the project.
  • config.xml: a global configuration file that controls many aspects of the Cordova applications' behavior.
  • res: Android, iOS and Windows icons and splashes (users can remove it after the init process).
  • cordova: Cordova 7.1 is installed as a dev dependency in case the project does not have it.
  • .monaca/project_info.json: A JSON file with some information such as cordova version and framework_version.
1
$ monaca init
Copied!

monaca signup

Signs up for Monaca Cloud. Will display a prompt that asks for user credentials.
1
$ monaca signup [options]
Copied!
Options
  • email: Email address used to register in Monaca
Example
Here is an example of how you use this command:
1
$ monaca signup
2
$ monaca signup [email protected].io
Copied!

monaca create

Creates a new local Monaca project from a template at a specified path. You will be asked to choose a project template from a list of available templates provided by Monaca Cloud. An app with the selected template will be created to the specified location.
1
$ monaca create [options]
Copied!
Options
  • path: Location where you want to store your project files
  • --url: URL of a zip file containing a Monaca template
Example
Here is an example of how to create a new project with the Monaca CLI:
1
$ monaca create MyProject/Demo
2
$ monaca create MyProject/Demo --url http://github.com/me/myproject/archive/master.zip
Copied!

monaca clone

Clones a project from the Monaca Cloud into your local PC at a specified location. You will be asked to select a project from a list of all your existing projects in Monaca Cloud and specify a location to download to project.
If you make changes to a cloned project locally and upload it (using monaca upload ) to Monaca Cloud, the older files of the project will be overwritten.
1
$ monaca clone
Copied!
Example
Here is an example of how to clone a project called Memo Application from Monaca Cloud into "CloneMemoProject" folder on your local PC.

monaca import

Imports a project from Monaca Cloud. You will be asked to select a project from a list of all your existing projects in Monaca Cloud and specify a location for the downloaded project.
If you make changes to an imported project locally and upload (using monaca upload ) it to Monaca Cloud, the project will be uploaded as a new project to Monaca Cloud.
1
$ monaca import
Copied!
Example
Here is an example of how to import a project called Memo Application from Monaca Cloud into ImportedMemoApplication folder on your local PC.

monaca download

Downloads changes (of the corresponding synced project) made in Monaca Cloud into the local project.
This command will overwrite the changes of the local project. If your local project does not exist in Monaca Cloud, you can’t use this command.
1
$ monaca download [options]
Copied!
Options
  • --delete: Deletes local files that do not exist in Monaca Cloud.
  • --force: Doesn't ask users for permission to continue.
  • --dry-run: Simulates the downloading operation and provides details of which files are downloaded. No actual downloading operation is done.
Example
Navigate to your project folder. Then, type the monaca download command with the options you want to use.

monaca upload

Uploads the current project files to Monaca Cloud. The project files will be compared with the corresponding remote files so that only the new and changed ones will be uploaded.
  1. 1.
    If the current project is a new/imported project, this command will
    upload the whole project as a new project in Monaca Cloud.
  2. 2.
    If the current project is a cloned project, this command will
    overwrite the same existing project in Monaca Cloud. In other words,
    only changed and new files will be uploaded.
For transpilable projects, monaca upload command will transpile the project before uploading it.
1
$ monaca upload [options]
Copied!
Options
  • --delete: Deletes the project files in Monaca Cloud which do not exist locally.
  • --force: Doesn't ask users for permission to continue the uploading process.
  • --dry-run: Simulates the uploading operation and provides details of which files are uploaded. No actual uploading operation is done.
Example
Navigate to your project folder. Then, type the monaca upload command with the options you want to use.

monaca signing

Manages signing configurations for iOS and Android builds.
1
$ monaca signing <action> <item>
Copied!
action
  • generate: can be used with keystore or pkcsr.
  • upload: can be used withkeystore, pkcs12, certificate or provisioning.
  • add: can be used with alias.
  • remove: can be used with alias, pkcs12, certificate or provisioning.
  • export: can be used with keystore or pkcsr.
item
  • alias: alias within a keystore file
  • keystore: Android KeyStore
  • pkcsr: CSR (Certificate Signing Request) file
  • pkcs12: private key with certificate
  • certificate: iOS certificate
  • provisioning: iOS provisioning profile
For more information on how to sign or create iOS and Android build settings (involving KeyStore, private key, certificate & provisioning profile), please refer to Configure iOS build settings and Configure Android KeyStore , respectively.
Example
Navigate to your project folder and try out these commands:
1
$ monaca signing generate keystore
2
$ monaca signing generate pkcsr
3
$ monaca signing add alias
4
$ monaca signing upload keystore
5
$ monaca signing upload pkcs12
6
$ monaca signing upload certificate
7
$ monaca signing upload provisioning
8
$ monaca signing export keystore
9
$ monaca signing export pkcsr
10
$ monaca signing remove alias
11
$ monaca signing remove pkcs12
12
$ monaca signing remove certificate
13
$ monaca signing remove provisioning
Copied!

monaca remote build

Builds a project in Monaca Cloud. If your project does not exist in Monaca Cloud yet, it will be automatically uploaded to the cloud first before the build starts. However, if your project already exists in Monaca Cloud, all its local updates/changes will be uploaded to the cloud first before the build starts.
Please refer to Building Monaca App for more information about:
  • configuring the build settings for each platform
  • types of build
  • building an application for each platform
  • installing built apps
1
$ monaca remote build <platform> [options]
Copied!
Options
  • platform: Builds for a specific platform. It can be: ios, android or windows.
  • --build-type: Chooses a build type. It can be:
    • debug: (for iOS, Android and Windows) The default option.
    • test: (for iOS only)
    • release: (for iOS and Android)
  • --output: The path in which the built file will be stored (including the filename)
  • --android_webview: (Android only) Chooses a type of the webview. It can be default or crosswalk.
  • --android_arch: (Android only) Required if --android_webview is crosswalk. It can be x86 or arm.
  • --skipUpload: Skips the upload of the local project to the cloud.
  • --skipTranspile: Skips the transpile process when uploading the local project to the cloud.
  • --browser: Opens the build process in a browser (see the screenshot below).
Example
Navigate to your project folder and try out this command with different options:
1
$ monaca remote build ios
2
$ monaca remote build ios --build-type=debug
3
$ monaca remote build android --build-type=debug --android_webview=crosswalk --android_arch=arm
4
$ monaca remote build --browser
Copied!

monaca remote config

Opens the project configuration on Monaca Cloud. Once the configuration is done, execute monaca download to get the changes locally.
1
$ monaca remote config
Copied!
Options
  • --skipUpload: Skips the upload of the local project to the cloud.
  • --skipTranspile: Skips the transpile process when uploading the local project to the cloud.
Use Case
Navigate to your project folder and try out these commands:
1
$ monaca remote config
2
$ monaca download
Copied!

monaca preview

Starts a local web server that serves the www assets. The command will watch the file system for changes and reload the browser when a change occurs. It will execute npm run monaca:preview defined in package.json.
For transpilable projects, monaca preview command will transpile the project in memory before launching the previewer. Additionally, if the preview is still running and you make a change, the transpile process should be triggered and the previewer will be served with the new files.
1
$ monaca preview
Copied!
Example
Navigate to your project folder and use the monaca preview command. Then, a browser will be opened running your project.
Preview window
To stop monaca preview process, press Ctrl+c.

monaca debug

Debugs one or more applications on a device and receives code changes instantly. This command starts a web server for Monaca Debugger to connect to. It also starts broadcasting messages to tell debuggers in the local network to connect to it. When a debugger is connected, it will send file system changes to the debugger. It will execute thenpm run monaca:debug script defined in package.json.
For transpilable projects, the monaca debug command will transpile the project before serving the files to Monaca Debugger. Additionally, if the debug is still running and you make a change, the transpile process should be triggered and the debugger will be served with the new files.
1
$ monaca debug [options]
Copied!
Options
  • paths: List of directories. Omit it to serve the current directory.
  • --port: HTTP port to listen to (default value is 8001)
Example
Navigate to your project folder and use the monaca debug command. Then, you should be able to see the project name in the Monaca Debugger under the Local Projects section. Click the project in order to run it. Try to make some changes to the project and save them. You should be able to see those changes to reflect instantly.
1
$ cd MyProjectFolder/ImportRssProject
2
$ monaca debug
Copied!
When running this command, you should be prompted to pair your debugger with your local PC or see the notification of a successful network connection (see the screenshots). Otherwise, please refer to Failure to Pair Monaca Debugger.
Pairing dialog & network connection notification
To stop monaca debug process, press Ctrl+c.

monaca transpile

Transpiles projects that are transpilable such as ReactJS, VueJS and Angular projects. It will execute the npm run monaca:transpile script defined in package.json.
1
$ monaca transpile
Copied!
Example
Navigate to your transpilable project folder and use the monaca transpile command.
1
$ monaca transpile
2
3
Running Transpiler...
4
Build completed in 71.835s
5
6
....
Copied!

monaca config

Manages proxy and API endpoint configuration.
1
$ monaca config [options]
Copied!
Options
  • proxy <url>: If <url> is not set, the current proxy server will be displayed.
  • endpoint <url>: If <url> is not set, the current API endpoint will be displayed.
  • --help: Displays a config helper.
  • --reset: Resets to the default value.
Example
Here are examples of how to use this command:
1
$ monaca config --help
2
$ monaca config proxy
3
$ monaca config proxy http://my.proxy.com:8080
4
$ monaca config proxy --reset
5
6
$ monaca config endpoint
7
$ monaca config endpoint my.endpoint.com
8
$ monaca config endpoint --reset
Copied!

monaca plugin

Manages plugins of a project by adding new plugins and removing installed plugins.
1
$ monaca plugin [options]
Copied!
Options
  • add <plugin>: Adds a plugin.
  • rm <plugin>: Removes a plugin.
Example
Navigate to your project folder and type the command below:
1
$ monaca plugin add org.apache.cordova.camera
2
$ monaca plugin rm org.apache.cordova.camera
Copied!

monaca docs

Displays docs for Monaca CLI, Onsen UI and Tutorials.
1
$ monaca docs [options]
Copied!
Options
  • onsen: Opens the Onsen UI documentation in a browser window.
  • tutorial: Opens the Onsen UI tutorial in a browser window.
  • usage: Opens the Monaca CLI documentation in a browser window.
Example
Here is an example of how to use this command:
1
$ monaca docs onsen
2
$ monaca docs tutorial
3
$ monaca docs usage
Copied!
Monaca docs tutorial
See Also:
Last modified 3mo ago