@openworkflow/cli) is the
primary way to set up your project, run workers, and launch the dashboard. The
CLI reads your openworkflow.config.ts by default, or you can override the path
with --config.
Installation
Commands
init
Initialize OpenWorkflow in a project with an existing package.json:
init is interactive and prompts for a backend, installs
dependencies, and creates a config, client, example workflow, and runner. It
also adds a worker script and updates .gitignore or .env for the selected
backend.
Options:
--backend <backend>- Selectsqlite,postgres, orboth. Withboth, PostgreSQL is used whenNODE_ENV=production; otherwise SQLite is used.-y, --yes- Skip prompts. Requires--backendand rejects existing configs.--skip-install- Create files without installing dependencies or changing dependency declarations. Prints the installation commands to run later.
worker start
Start a worker to process workflows:
--concurrency <n>- Number of concurrent workflow executions (overrides config)
- Loads your config file
- Discovers workflows in the configured directories
- Registers all workflows
- Starts polling for work
- Handles graceful shutdown on SIGINT/SIGTERM
dashboard
Start the web dashboard:
http://localhost:3000 by default.
To use a custom port:
doctor
Check your config, backend connection, and workflows for problems.
--version
Show the CLI version:
--help
Show help for any command:
Environment Variables
The CLI loads.env from the current directory before reading the config. You
can pass --env-file <path> to load a different .env file.
Telemetry
The CLI sends command names, backend types, CLI/Node.js versions, OS, architecture, and a random installation ID to PostHog by default. It does not send project contents, paths, or error messages. Disable telemetry with--no-telemetry or DO_NOT_TRACK=1 in your shell.
Any nonempty CI or OPENWORKFLOW_TELEMETRY_DISABLED also disables it.
Exit Codes
Graceful Shutdown
When runningworker start, the CLI handles shutdown signals:
- SIGINT (Ctrl+C) - Graceful shutdown
- SIGTERM - Graceful shutdown
- Stops accepting new work
- Waits for active workflows to complete
- Closes the backend connection