Reference

CLI

Run Routecraft capabilities from the command line.

Basic usage

craft <command> [options]

Global options:

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

More commands coming

dev, build, start, and exec are planned for future releases.

Project scaffolding

New projects are created via npm create routecraft, a separate scaffolding package -- not a craft subcommand:

npm create routecraft@latest [project-name]

Options:

OptionDescription
-h, --helpShow usage help
-y, --yesSkip interactive prompts and use defaults
-f, --forceOverwrite existing directory
--skip-installSkip installing dependencies
-e, --example <name or url>Example to use (none, hello-world) or GitHub URL
--use-npm, --use-pnpm, --use-yarn, --use-bunChoose package manager
--no-src-dirPlace project files at root instead of src/
--no-gitSkip git initialization

Commands

run

Load one or more capabilities from a TypeScript file and start the Routecraft context. The process runs as long as the capabilities run -- finite capabilities exit after completing; long-lived sources keep the process running until the context is stopped or a signal is received.

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

The file must export a capability (or array of capabilities) as its default export, and optionally a craftConfig named export. See the Configuration reference for the config export format.

Options:

OptionDescription
<file>TypeScript or JavaScript file (.ts/.mjs/.js/.cjs) to execute
--env <path>Load environment variables from a .env file
Previous
Configuration