CLI
The Craft CLI allows you to develop, build, start your application, and more.
Basic usage
craft <command> [options]
Reference
Global options:
| Option | Description |
|---|---|
| -h, --help | Show usage help |
| -v, --version | Print version and exit |
Commands:
| Command | Description |
|---|---|
| run <file> | Execute routes from a single JavaScript file. |
| dev | Start development mode (watch, hot reload, admin portal) |
| build | Build 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:
| Option | Description |
|---|---|
| <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:
| Option | Description |
|---|---|
| --env <path> | Load environment variables from a .env file |
| --open | Open admin portal in the default browser |
| --no-ui | Start without the admin portal |
Build wip
Build for production and emit a routes manifest.
Status: planned
craft build [--env <.env path>]
Options:
| Option | Description |
|---|---|
| --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:
| Option | Description |
|---|---|
| <config> | Path to a config file exporting a CraftConfig |
| --env <path> | Load environment variables from a .env file |
| --open | Open admin portal in the default browser |
| --no-ui | Start without the admin portal |