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
describeShow the effective, fully-resolved configuration for one component
searchAnswer an estate question with a compact, edge-aware query
importImport infrastructure templates and generate TypeScript
auditAudit an existing repo’s CI/CD pipelines for security issues
migrateTranslate a workflow between lexicons (e.g. GitHub Actions → GitLab CI)
carve adviseRank which Terraform resources are cheap to carve into native chant
carve emit/bridge/applyCarve a resource out of Terraform, incrementally and reversibly
vendorPull reusable patterns into your repo, pinned and checksummed
updateSync lexicon type definitions
doctorCheck project health and configuration
emulatorBoot, stop, and inspect a lexicon’s local cloud emulator

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
dev surface-diffDiff a regenerated lexicon’s API surface against its baseline

Run named, phased workflows defined in *.op.ts files. The local runtime is built in and needs nothing installed; --on <lexicon> hands the run to a configured lexicon that hosts one instead.

CommandDescription
run <name>Run an Op on the resolved runtime
run listList all Ops with the run state the runtime reports
run status <name>Show the latest run’s state
run approve <op> <gate>Record a gate’s resolution, then wake the hosting runtime
run cancel <name>Cancel the active 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, fountain, 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 (seven categories: missing, orphan, disappeared, newly observed, drifted, unchanged, unobserved)
lifecycle whoami <env>Who chant would act as in each configured lexicon, and what that principal is scoped to — read-only, before anything acts
lifecycle log [env]History of lifecycle snapshots

Record immutable deploy events and reconcile them against live truth, joined by artifact digest. See chant components and Observability.

CommandDescription
components release <env>Append one immutable release record (component, digest, git sha, run id, actor) to the chant/lifecycle branch
components status [env]What’s built vs. what’s deployed where, joined by digest (--live reconciles against live + ownership; --compare-to <env> cross-checks a digest across environments)
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. For chant build, also list every resolved build parameter and every per-file fold decision instead of the one-line summaries.

Display help information for the CLI.

Terminal window
chant --help