Interact with your project via the command line
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.
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.
A set of commands come with Mimosa and that are available no matter what modules are included in your project
Command | Options | Description |
---|---|---|
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:list | List all skeletons. | |
skel:search | <keyword> | Search for skeletons using keywords. |
All | [-D, --mdebug], [--help] | These flags are available for all commands. |
$ 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.
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
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" }
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
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
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
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
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
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
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
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
Use the --cleanall
flag to delete the .mimosa
directory as part of the clean.
$ mimosa watch --cleanall $ mimosa watch -C
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.
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
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
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
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
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
Using --minify
and --optimize
together signals both minification and optimization modules to perform their tasks.
$ mimosa build --minify --optimize $ mimosa build -mo
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
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
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
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
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!
Mimosa's module features have their own set of commands prefixed with mod:
. Read about them on the Modules page.
Mimosa includes help documentation for each command. Use --help
or -h
to bring up help.
$ mimosa --help $ mimosa new --help $ mimosa [command] --help
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
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
.