For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Install the MobileFirst Platform CLI
Install the IBM MobileFirstâ„¢ Platform Command Line Interface (CLI) so that we can use the CLI to develop your app.
Before you begin
- You must have computer with a supported OS X, Windows, or Linux operating system installed. See System requirements for more information about supported operating systems.
- You must have node.js version 4.0.0 or later installed. If you do not have it installed, we can install it as part of the procedure on this page.
- If we want to install the CLI from the MobileFirst Operations Console, we must have access to the MobileFirst Operations Console on an existing MobileFirst Server. This can be a server running locally, such as the MobileFirst Development Server, or it can be another (typically remote) MobileFirst Server.
- If we want to install the CLI directly from npm or JazzHub, you must have internet access.
Note:
- If you need to set up your development environment on a computer that has no internet access, we can install it offline. See How to set up an offline IBM MobileFirst development environment.
- If you are installing the CLI from the IBM MobileFirst Platform Foundation Developer Kit that is already downloaded, you do not need internet access. To install the CLI from the IBM MobileFirst Platform Foundation Developer Kit, see Install the IBM MobileFirst Platform Foundation Developer Kit.
We can install the CLI from the MobileFirst Operations Console or directly from npm. The CLI is provided as an npm (Node Package Manager) package, and we use the npm install command to install it.
Note: We can also download the compressed (.zip) file packages from JazzHub. Click the link that starts with hub.jazz.net from the npm page at the following URL: www.npmjs.com/package/mfpdev-cli to go directly to the JazzHub web page for the CLI.
Procedure
We can install the CLI in two main ways: from the MobileFirst Operations Console or from npm.
- To install the CLI from theMobileFirst Operations Console:
- From the MobileFirst Operations Console Dashboard, click Get Starter Code.
- From the Downloads page, select the Tools tab.
- Under Developer CLI, click Download.
- Save the file mfpdev-cli.tgz to your local computer.
- (Required only if Node.js is not already installed. If Node.js is already installed, skip this step.) Install Node.js 4.0.0 or later. To download and install Node.js, click the link Node.js to be installed in the console. This takes you to the Node.js web site. Follow the download and installation instructions there.
Note: Alternatively, we can reach the Node.js web site by clicking this link: Node.js web site
- Open a command prompt or terminal window and run the following command:
npm install -g --no-optional path_cli_file
where path_cli_file is the full path and name of the downloaded file, including extension. For example, if the file is in the current working directory:
npm install -g --no-optional mfpdev-cli.tgz
To install the CLI from npm:
- (Required only if Node.js is not already installed. If Node.js is already installed, skip this step.) Install Node.js 4.0.0 or later. To install Node.js, go to the Node.js web site and follow the instructions.
- Open a command prompt or terminal window and run the following command:
npm install -g --no-optional mfpdev-cli.tgz@8.0
Results
The MobileFirst Platform CLI is installed.
What to do next
Define which MobileFirst Server you want to be the default, if you do not want to use the factory default of http://localhost:9080. For more information, see Defining the target server of the MobileFirst Platform CLI.
- Defining the target server of the MobileFirst Platform CLI
Before you start developing with MobileFirst Platform CLI, we must define the MobileFirst Server that we use for developing and testing.
Parent topic: The MobileFirst command-line interface (CLI)