Command Surface
| Command | Description |
|---|---|
chainbot help [command] | Show help directory or command-specific help |
chainbot version | Show the running ChainBot version |
chainbot init | Initialize a new workspace with the canonical layout |
chainbot status [--json] | Show non-executing workspace status snapshot |
chainbot validate | Validate root, workflow, trigger, and plugin contracts |
chainbot run | Execute the inferred top-level workflow |
chainbot serve | Start the background daemon |
chainbot stop | Request graceful daemon shutdown |
chainbot trigger list | List configured triggers |
chainbot trigger enable <trigger-id> | Enable a trigger |
chainbot trigger disable <trigger-id> | Disable a trigger |
chainbot observe [--json] [--limit <n>] [--trigger-id <id>] [--run-id <id>] | Inspect persisted run summaries, workflow logs, and trigger events |
chainbot list-runs | List persisted run summaries (JSON output) |
Root Resolution
CLI resolves the ChainBot root in this order:CHAINBOT_CONFIG_DIRenvironment variable if set and non-empty~/.chainbotas the default fallback
CHAINBOT_CONFIG_DIR must point to a complete ChainBot root, not a single config file.
Output Modes
| Command | Default output | --json available |
|---|---|---|
help | Human-readable | No |
version | Human-readable | No |
init | Human-readable | No |
status | Human-readable | Yes |
validate | Human-readable | No |
run | Human-readable | Yes |
serve | Human-readable | No |
stop | Human-readable | No |
trigger | Human-readable | No |
observe | Human-readable | Yes |
list-runs | JSON | No (always JSON) |
status Contract
status is a non-executing snapshot. It does not trigger workflow execution, trigger collection, runtime recovery, or incomplete-run state changes.
Default text output includes: Root, Workflows, Triggers, and Summary.
status --json returns:
serve.state values:
idle: no valid lease row, or coordination database does not existactive: lease row exists, is not expired, and owner is alivestale: lease row exists but should not block a newserve
validate Contract
validate checks:
- Root layout and
chainbot.tomlcontract - All workflow package manifests
- All trigger package manifests
- All plugin package manifests
run Contract
- Executes the uniquely inferred top-level workflow.
- Returns a usage error if multiple workflows exist and a unique top-level workflow cannot be determined.
- Does not require a trigger to be present.
trigger Mutations
chainbot trigger enable and chainbot trigger disable write directly to the trigger package’s config.toml enabled field.
Changes take effect on the next status, validate, serve, or run.
observe Contract
Provides read-only aggregation of:
run_summariesworkflow_runtime_logstrigger_event_records
--limit <n>: window of most recent records--trigger-id <id>: filter to a specific trigger--run-id <id>: filter to a specific run
Error Navigation
CLI errors always provide the next action:- Unsupported command: suggest the nearest known command and guide to
chainbot help - Missing root: guide to set
CHAINBOT_CONFIG_DIRor verify~/.chainbotpoints to a valid root - Missing
chainbot.toml: check that the root path is correct and the file exists - Invalid config: return a validation error with file path, line/column, and source snippet