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
migrateTranslate a workflow between lexicons (e.g. GitHub Actions → GitLab CI)
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. Snapshots are stored on an orphan git branch (chant/lifecycle); lifecycle diff --live queries the cloud directly for drift detection. AWS, Temporal, K8s, GCP, and Azure surface their resources entity-keyed; Helm and Docker surface runtime artifacts. See chant lifecycle for the full surface.

CommandDescription
lifecycle snapshot <env>Query lexicon plugins, save resource + artifact metadata to orphan branch
lifecycle show <env>Show latest lifecycle snapshot
lifecycle diff <env>Compare current build against last snapshot (digest mode)
lifecycle diff <env> --liveQuery cloud right now and report drift (six categories: missing, orphan, disappeared, drifted, etc.)
lifecycle log [env]History of lifecycle 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