CLI

The Craft CLI allows you to develop, build, start your application, and more.

Basic usage

craft <command> [options]

Reference

Global options:

OptionDescription
-h, --helpShow usage help
-v, --versionPrint version and exit

Commands:

CommandDescription
run <file>Execute routes from a single JavaScript file.
devStart development mode (watch, hot reload, admin portal)
buildBuild for production and emit a routes manifest
start <config>Start a RouteCraft context from a config file

Run

Execute routes from a single JavaScript file once and exit once all routes have completed.

craft run <file> [--env <.env path>]

Options:

OptionDescription
<file>JavaScript file (.mjs/.js/.cjs) containing routes to execute
--env <path>Load environment variables from a .env file

Dev wip

Start development mode with file watching, hot reload, and the admin portal.

Status: planned

craft dev [--env <.env path>] [--port <number>] [--open] [--no-ui]

Options:

OptionDescription
--env <path>Load environment variables from a .env file
--openOpen admin portal in the default browser
--no-uiStart without the admin portal

Build wip

Build for production and emit a routes manifest.

Status: planned

craft build [--env <.env path>]

Options:

OptionDescription
--env <path>Load environment variables from a .env file

Start wip

Start a RouteCraft context from a config file. The admin portal can be enabled via configuration.

craft start <config> [--env <.env path>]

Options:

OptionDescription
<config>Path to a config file exporting a CraftConfig
--env <path>Load environment variables from a .env file
--openOpen admin portal in the default browser
--no-uiStart without the admin portal