Skip to content

CLI Overview

chant provides a CLI for building, linting, and managing infrastructure definitions.

The CLI is included in @intentius/chant. Install a lexicon package to get everything:

Terminal window
npm install --save-dev @intentius/chant-lexicon-aws
chant <command> [options] [path]
CommandDescription
initScaffold a new chant project
init lexiconScaffold a new lexicon plugin project
buildSynthesize and write infrastructure output
lintLint intent definitions with semantic rules
listList exported declarations in a project
importImport infrastructure templates and generate TypeScript
updateSync lexicon type definitions
doctorCheck project health and configuration

These commands are for lexicon authors — project users don’t typically need them.

CommandDescription
dev generateGenerate lexicon artifacts (+ validate + coverage)
dev publishPackage lexicon for distribution
dev onboardOnboard a new lexicon plugin
dev check-lexiconValidate a lexicon bundle

Run named Temporal workflows defined in *.op.ts files. Requires @intentius/chant-lexicon-temporal and a running Temporal server.

CommandDescription
run <name>Start an Op workflow (spawns worker + submits to Temporal)
run listList all Ops with current run status
run status <name>Show current workflow run state
run signal <name> <signal>Send a named signal to unblock a gate step
run cancel <name>Cancel the active workflow run
run log <name>Show run history for an Op
graphPrint the Op dependency graph

Capture and compare deployed infrastructure state using orphan git branches.

CommandDescription
state snapshot <env>Query API, save metadata to orphan branch
state show <env>Show latest state snapshot
state diff <env>Compare current build against last snapshot
state log [env]History of state snapshots
CommandDescription
serve lspStart the LSP server for editor integration
serve mcpStart MCP server for AI agent integration
Terminal window
# Initialize and build a project
chant init my-infra --lexicon aws
cd my-infra
chant build
# Lint definitions
chant lint
# Import existing templates
chant import template.json
# Check project health
chant doctor

The CLI automatically discovers infrastructure files based on these rules:

Included:

  • All .ts files in the specified directory and subdirectories

Excluded:

  • Files in node_modules/ directories
  • Test files: *.test.ts, *.spec.ts
  • TypeScript declaration files: *.d.ts

The CLI provides structured error output for different types of errors:

Reported when files can’t be loaded or imported. Common causes: missing dependencies, syntax errors, invalid import paths, circular dependencies.

Reported during serialization. Common causes: circular dependencies between resources, invalid attribute references, missing required properties.

Show stack traces on errors.

Display help information for the CLI.

Terminal window
chant --help