The CLI

The command line tool exposes the same functionality as the Mantri Grunt tasks, namely it allows you to build your application, calculate dependencies and initialize a project.

General CLI Options

--help, -h Display help

Use the -h flag globbaly mantri -h or locally per command: mantri build -h.

--debug, -d Enable debug mode

Display additional debugging output when running commands.

Initializing Mantri

The init command will copy the mantri.web.js and mantriConf.json files to the folder you define. If no folder is defined the files will be copied to your current working directory.

mantri init

Options for init

Option --dest

Type: string Default: Current Working Directory

The destination path to create the mantri files.

mantri init --dest=js/

Calculating Dependencies

The deps command generates the dependency file deps.js. This file is required by the web application in the development environment.

mantri deps

Options for deps

Option --dest

Type: string Default: deps.js

The file you wish the generated deps file to be saved at.

Option --src

Type: string Default: ./

The source to scan for goog.provide and goog.require statements, essentialy the path to your web application.

Be careful when defining a source. If the source is different from your document (web) root, you will need to define the documentroot using the root option.

Option --root

Type: string Default: ./

The root option defines the Document (web) Root directory of your website. It is required if you define the source option.

mantri deps --src=js/ --root=./ --dest=js/deps.js

Read more about the dependency options in the Grunt Task mantriDeps.

Building Your Project

The build command bundles and minifies all your application's code and third-party dependencies.

mantri build

Options for build

Option --src

Type: string Default: 'mantriConf.json'

The path to your mantriConf.json file.

dest

Type: string Default: 'app.min.js'

The destination file to store the output.