For every command, you can pass the
--save-options flag to remember the options you just passed for future usage.
--save-options defaults to
--save-options=project, which writes the
.leavesrc in your project, you can use
--save-options=global if you want this to be global to all your
The available commands are listed below.
You can run the initial setup to have shell completion by running:
$ leaves setup
Only zsh is supported for now, but PR are welcome.
To create a new project, just run:
$ leaves new PROJECT_NAME [--html=ejs] [--css=less]
you can then
$ leaves build [--development]
in your project directory. If you want a development build, without concatenation and minification, pass the
To build and watch your files, run
$ leaves [watch]
(which will run
leaves watch) in your project directory.
You can upgrade your leaves installation by running
$ leaves upgrade
This will run
npm update -g leaves for you and use
sudo only if needed.
In your working project, you can also run
$ leaves upgrade -o
to get the latest
Gruntfile.coffee and update your
package.json dependencies. Your
Gruntfile.coffee will be overwritten so be careful when you use it if you have some changes. This will
npm install for you to install the latest dependencies.
To publish to Heroku, you only need to have a valid account. To publish to Github, you need to have a remote pointing to github.com in your project.
$ leaves publish [--skip-build] [--skip-commit] [--skip-install] [--use-dev] [-p PROVIDER]
PROVIDER parameter can be
ftp. The default is
heroku. If you want to use the development build to deploy, pass
Your website will then be accessible at http://APP_NAME.herokuapp.com when publishing with Heroku and http://USERNAME.github.io/REPO_NAME.
with GitHub Pages. For heroku,
APP_NAME will default to the appName in
For FTP, you will be asked for your credentials, which will be stored in
$ leaves install [PACKAGES [-p PROVIDER] [--no-save]]
If no package is given, leaves will run
npm install and
If packages are given,
PROVIDER can be either
npm. If provider is not given, it will default to
New packages are installed using
--save by default. You can disable this behavior by passing
Fetch and prepare project for development.
$ leaves get GIT_REPOSITORY [-p PROTOCOL]
GIT_REPOSITORY can be anyting that would work with
git clone, or for GitHub repositories, the short syntax
user/repo can be used.
PROTOCOL is only relevant when using the short syntax, and can be
https (default) or
Leaves can be configured easily through the command line.
$ leaves config [TYPE] get key $ leaves config [TYPE] set key value $ leaves config [TYPE] unset key
TYPE can be
--local for the local configuration which is gitignored,
--project (default) for the project configuration which is not gitignored, or
--global for the configuration common to all project.
For example, if you always want to use
ftp upload for a project, you could run:
$ leaves config set commands.publish.provider ftp
If you always want to use less css instead of stylus, you could run
$ leaves config set --global commands.new.css less
Local configuration is saved at
PROJECT_ROOT/.leavesrc.local, project configuration is saved at
PROJECT_ROOT/.leavesrc and global configuration is saved at
$HOME/.leaves/config. It is
a normal JSON file, so you can of course edit it by hand without any problem.