node package manager


The mojito-cli package provides command line helpers for Mojito developers.

mojito-cli Build Status

mojito-cli is a command-line tool for Mojito application developers. The components of mojito that are unrelated to the core library and runtime will be moving to separate packages.

* * * For more information on the command-line package changes and the current status, see the mojito-cli Wiki. * * *

Install mojito-cli

  1. With npm, do the following:

     $ npm install --global mojito-cli
  2. Confirm that mojito-cli has been installed.

     $ mojito help

Note that if mojito was already installed globally, it will be uninstalled. It is recommended to only install the core mojito package as a local dependency in your Mojito application. Users should not lose any functionality.

Quick Start

  1. Create an app (which installs mojito locally using npm) and a mojit.

     $ mojito create app myapp
     $ cd myapp
     $ mojito create mojito hellomojit
  2. Start the server.

     $ mojito start
  3. In a browser, open the following URL: http://localhost:8666/@hellomojit/index



To show top-level help for this command-line tool:

$ mojito help

To show help for a specific command:

$ mojito help <command>


To show the version for mojito-cli:

$ mojito version

To show the version of an application, run the following from the application directory:

$ mojito version app

The version of the mojito runtime installed locally to your app will be displayed as well.

To show the version of a mojit, run the following from the application directory:

$ mojito version mojit <mojit-name>


To generate boilerplate files from the Mojito archetypes or other templates:

$ mojito create [options] <type> [subtype] <name>
$ mojito create [options] <from> <to>

To learn how to do some simple key/value replacement, see mojito-cli-create.


To generate a static snapshot of your Mojito application:

$ mojito build [options] html5app [dest]

See mojito-cli-build for more information.


To generate API documentation using yuidocjs:

$ mojito doc [options] <app|mojit|mojito> [name]

See also mojito-cli-doc.


To find common coding pitfalls with static analysis using jslint:

$ mojito jslint [app|mojit] <path>

See mojito-cli-jslint.


To start the server and run the application:

$ mojito start [<port>] [--context key1:value1,key2:value2]

The port number specified in the command above overrides the port number in the application configuration file, application.json. The default port number is 8666. See Specifying Context to learn how to use the --context option.

See mojito-cli-start.


To run unit tests for a Mojito application:

$  mojito test app

To run unit tests for a specific mojit:

$ mojito test mojit <mojit-name>


$ mojito test mojit <mojit-path>

See mojito-cli-test for more details.


When you are in the top level of a Mojito application directory, you can perform other Mojito commands which are delegated to the locally installed mojito package. More information is provided in Mojito Command Line.

Node packages accessible via require that begin with mojito-cli- can also be invoked, similar to git, brew, and yogi. For example, if mojito-cli-foo is installed in your $NODE_PATH, then mojito foo will invoke it.


Licensing and Contributions

This software is free to use under the Yahoo! Inc. BSD license. See LICENSE.txt. To contribute to the Mojito project, please see Contributing.

The Mojito project is a meritocratic, consensus-based community project, which allows anyone to contribute and gain additional responsibilities.