Commands

Interact with your project via the command line

Command Quick Reference

Each command has a section dedicated to it below, but here is a quick list of the available commands. Most commands have flags that influence the behavior of the command. Read more about those below.

Commands from Modules

Don't see the command you are looking for here? Chances are good that command is from another module. Mimosa modules can add commands to your project, mimosa-bower is a good example.

Mimosa Commands

A set of commands come with Mimosa and that are available no matter what modules are included in your project

CommandOptionsDescription
new[name] [-d/--defaults]Creates a new project skeleton with sample code.
watch[-s/--server]
[-c/--clean]
[-C/--cleanall]
[-d/--delete]
[-o/--optimize]
[-m/--minify]
[-P/--profile]
Builds the project and continues watching project files to build them on-the-fly.
clean[-f/--force]
[-C/--cleanall]
[-P/--profile]
Cleans the Mimosa generated assets.
build[-C/--cleanall]
[-o/--optimize]
[-m/--minify]
[-p/--package]
[-i/--install]
[-e/--errorout]
[-P/--profile]
Builds the project and exits.
skel:new<skeletonName> <installFolder>Creates a new project from an existing skeleton.
skel:listList all skeletons.
skel:search<keyword>Search for skeletons using keywords.
All[-D, --mdebug], [--help]These flags are available for all commands.

New Project

mimosa new [nameOfProject]

new

$ mimosa new nameOfApplicationHere

The new command will kick off a series of prompts to choose a set of technologies to get you started with a Mimosa application.

Mimosa gets the new command from the newmimosa module. For details on what sort of assets it gives you, check out that module's GitHub repository.

Watch, Compile, Serve

mimosa watch [-s/--server] [-c/--clean] [-d/--delete] [-o/--optimize] [-m/--minify] [-P/--profile]

watch

Mimosa will watch the configured watch.sourceDir, by default the assets directory. When files are added, updated, or deleted, Mimosa's will process the files through the configured Mimosa modules.

$ mimosa watch

Serve Assets (-s/--server)

Start Mimosa with the server flag if assets need to be served.

$ mimosa watch --server
$ mimosa watch -s

Using the -s/--server flag with mimosa watch will indicate to any server related modules that they need to invoke their server-related code. mimosa-server for example can start an embedded Express or start your node.js server

Mimosa does not require a server. You may simply not need one (static site?) or you may have your own non-node.js server that Mimosa cannot start for you. When running a non-node.js server, the major consideration is the watch.compiledDir. The output of asset compilation might need to redirected to another folder where the server lives.

watch: {
  compiledDir: "../server/public"
}

Clean Compiled Assets First (-c/--clean)

Use the --clean flag to clean the compiled directory before watching starts. This forces a recompile and recopy of all assets.

$ mimosa watch --clean
$ mimosa watch -c

Clean Compiled Assets and the .mimosa Cache (-C/--cleanall)

Use the --cleanall flag to delete the .mimosa directory before watching starts. This forces modules, like mimosa-bower, to reprocess anything that may have been cached.

This also includes a clean as with the --clean flag above.

$ mimosa watch --cleanall
$ mimosa watch -C

Delete Compiled Directory First (-d/--delete)

More drastic than the clean flag, the --delete flag will remove the compiled directory entirely. This is the same as the --force option for the clean command below.

$ mimosa watch --delete
$ mimosa watch -d

Run Optimized (-o/--optimize)

Start mimosa watch with the --optimize flag turned on and any optimization modules you are using will perform their optimizations.

$ mimosa watch --optimize
$ mimosa watch -o

Minify Assets (-m/--minify)

Start mimosa watch with the --minify flag turned on and any minification modules you have enabled will minify their assets.

$ mimosa watch --minify
$ mimosa watch -m

Minify and Optimize Assets (-mo/--minify --optimize)

Flags are cumulative, so both the minify and optimize flags can be used at the same time to both minify and optimize your codebase.

$ mimosa watch --minify --optimize
$ mimosa watch -mo

Use a Profile (-P/--profile)

Follow the --profile flag with the name of a profile, and Mimosa will use that profile to override the mimosa-config contained in the profile. See the profiles section of the Configuration page for more information on profiles.

$ mimosa watch --profile nameOfProfile
$ mimosa watch -P nameOfProfile

Clean Project

mimosa clean [-f/--force] [-P/--profile]

clean

mimosa clean will wipe out any file from the watch.compiledDir that is currently in the watch.sourceDir. Any assets in the watch.compiledDir that are not in the watch.sourceDir are left alone in case they were placed there purposefully. Mimosa makes a pass to clean out the files, and once done, it makes a pass to clean out any directories that were emptied.

$ mimosa clean

Remove the .mimosa Cache (-C/--cleanall)

Use the --cleanall flag to delete the .mimosa directory as part of the clean.

$ mimosa watch --cleanall
$ mimosa watch -C

Force Asset Deletion (-f/--force)

Because the clean command will not remove anything in watch.compiledDir that isn't in watch.sourceDir, Mimosa may leave behind code.

$ mimosa clean --force
$ mimosa clean -f

If mimosa watch is running and a file is deleted or renamed, Mimosa cleans out the compiled version of that file, but if Mimosa is not running and a file is deleted or removed, Mimosa has no way of knowing the files left behind are safe for cleaning.

When included, the --force flag will remove the entire compiled directory and all of its contents, no questions asked.

Use a Profile (-P/--profile)

Follow the --profile flag with the name of a profile, and Mimosa will use that profile to override the mimosa-config contained in the profile. See the profiles section of the Utilities page for more information on profiles.

$ mimosa clean --profile nameOfProfile
$ mimosa clean -P nameOfProfile

Project Build

mimosa build [-o/--optimize] [-m/--minify] [-p/--package] [-i/--install] [-P/--profile]

build

Use mimosa build to build your application and exit. mimosa build is meant to be used when creating deployable versions of a project. This command executes a clean before it does anything, so a clean version of the application is built.

$ mimosa build

Remove the .mimosa Cache (-C/--cleanall)

Use the --cleanall flag to delete the .mimosa directory before building. This forces modules, like mimosa-bower, to reprocess anything that may have been cached.

$ mimosa watch --cleanall
$ mimosa watch -C

Optimized Build (-o/--optimize)

If you want to build and generate optimized output, provide an --optimize flag. This will signal any optimization modules you are using that optimization is to be performed.

$ mimosa build --optimize
$ mimosa build -o

Minify Assets (-m/--minify)

Start mimosa build with the --minify flag turned on and any minification modules you have enabled will minify their assets.

$ mimosa build --minify
$ mimosa build -m

Minify and Optimize Assets (-mo/--minify --optimize)

Using --minify and --optimize together signals both minification and optimization modules to perform their tasks.

$ mimosa build --minify --optimize
$ mimosa build -mo

Package Application (-p/--package)

Provide a --package flag and Mimosa will invoke any installed packaging modules. Mimosa doesn't come with any packaging functionality, but modules like mimosa-web-package are available and can be added to an application by simply adding the module name to the mimosa-config modules array.

$ mimosa build --package
$ mimosa build -p

Install Application (-i/--install)

Provide a --install flag and Mimosa will invoke any configured install modules. Mimosa doesn't come with any installation modules, but this paves the way for those sorts of modules to be used.

$ mimosa build --install
$ mimosa build -i

Force Erroring Out (-e/--errorout)

Provide a --errorout flag and the build command will error out if it encounters any errors that self-identify as build-breaking. Without this flag set, build will continue past errors.

$ mimosa build --errorout
$ mimosa build -e

Use a Profile (-P/--profile)

Follow the --profile flag with the name of a profile, and Mimosa will use that profile to override the mimosa-config contained in the profile. See the profiles section of the Utilities page for more information on profiles.

$ mimosa build --profile nameOfProfile
$ mimosa build -P nameOfProfile

Skeleton Commands

mimosa skel:new, skel:search, skel:list

Skeletons are starter apps that include things like MVC libraries (Backbone or Angular), CSS libraries (Bootstrap or Foundation), boilerplate assets, a notional file structure and possibly integration with things like Bower or Testem.

Mimosa needs skeletons! Learn how to contribute!

skel:new [nameOfSkeleton] [directory]

This command will install the named skeleton in the directory provided. If the directory is not provided, it will install the skeleton in the current directory.

skel:search [searchTerm]

This command will search the registry for any skeletons possessing the searchTerm as a keyword.

skel:list

This command will list all skeletons.

Module Commands

mimosa mod:[install/uninstall/list]

Mimosa's module features have their own set of commands prefixed with mod:. Read about them on the Modules page.

Miscellaneous Commands and Options

-h/--help

Mimosa includes help documentation for each command. Use --help or -h to bring up help.

$ mimosa --help
$ mimosa new --help
$ mimosa [command] --help

-D/--mdebug

All Mimosa commands have a debug mode that will print detailed logs to the console for everything Mimosa is doing. As you'll find out the first time you execute a Mimosa command with the --mdebug flag, Mimosa logs quite a bit of what it does, so this is only useful when doing deep debugging, it is not something to use regularly just to see what Mimosa is up to.

$ mimosa [command] --mdebug
$ mimosa [command] -D

node.js flags

Mimosa will take and use an assortment of node.js process flags. These flags are the same as the ones that would be used when executing node directly. The available node pass-through flags are --nolazy, --debug, --debug-brk, -gc, --expose-gc, --gc-global, --harmony, --harmony-proxies, --harmony-collections, --harmony-generators, --prof.