Command Line Interface

For most users, the primary way to use roots will be through the command line. Although the public API mirrors the command line very closely, this piece will cover all the commands and options you can use on the command line. Also note that if you run any command with the -h short flag, it will display help text on how to correctly use that command and all the available options.

Also before we get started, let's clear up some terminology. A positional argument is an argument that is simply typed out, without any sort of flag. For example:

$ program /foo/bar

Here, you can see a program being run with one positional argument, and no flags at all. The positional argument here looks like a path, but it could be anything. There can also be more than one positional argument.

An optional argument, also potentially known as a flag argument, looks more like this:

$ program --foo bar

Here, the optional argument foo is set to bar. Sometimes, the arguments have no value, it's just their presence that is needed, as such:

$ program --foo

You can also call a program with both positional and optional arguments:

$ program /foo/bar --baz

And finally, many optional arguments also have "short flag" versions, which use one dash instead of two and are a single letter. For example, --foo might be abbreviated also as -f. With the basics out of the way, let's jump into the actual commands!

New

The new command creates a new roots project from a template.

Alises: init, create

Positional

Optional

Watch

The watch command compiles the project, opens it in a local server, then watches a project for changes to the code. When the code changes, the project is re-compiled and the browser window is reloaded.

Positional

Optional

Compile

The compile command compiles your project once to the output directory, which usually will be public unless you have changed it.

Positional

Optional

Template

The template command allows you to interact with roots' templates for starting out new projects. This command is a simple wrapper over sprout. It also has it's own sub-commands listed below, so just running roots template won't do anything, you need to follow it with one of the below commands, like roots template list, for example.

Alias: tpl

Template Add

Adds a new template that you can use with the roots new command.

Positional

Template Remove

Removes a template that you have previously added.

Positional

Template Default

Makes a specified template the default to be used any time that roots new is run.

Positional

Template List

Lists all the currently installed templates. No additonal arguments, you can run this on its own.

Clean

Removes the compiled output from a given project.

Positional

Analytics

Enables or disabled roots' analytics. Analytics are anonymous, reveal no personal information, the data is public, and is only used to help the core developers to improve roots for you.

Optional