CLI Overview
chant provides a CLI for building, linting, and managing infrastructure definitions.
Installation
Section titled “Installation”The CLI is included in @intentius/chant. Install a lexicon package to get everything:
npm install --save-dev @intentius/chant-lexicon-awschant <command> [options] [path]Commands
Section titled “Commands”| Command | Description |
|---|---|
init | Scaffold a new chant project |
init lexicon | Scaffold a new lexicon plugin project |
build | Synthesize and write infrastructure output |
lint | Lint intent definitions with semantic rules |
list | List exported declarations in a project |
import | Import infrastructure templates and generate TypeScript |
migrate | Translate a workflow between lexicons (e.g. GitHub Actions → GitLab CI) |
update | Sync lexicon type definitions |
doctor | Check project health and configuration |
Lexicon Development Commands
Section titled “Lexicon Development Commands”These commands are for lexicon authors — project users don’t typically need them.
| Command | Description |
|---|---|
dev generate | Generate lexicon artifacts (+ validate + coverage) |
dev publish | Package lexicon for distribution |
dev onboard | Onboard a new lexicon plugin |
dev check-lexicon | Validate a lexicon bundle |
Op Commands
Section titled “Op Commands”Run named Temporal workflows defined in *.op.ts files. Requires @intentius/chant-lexicon-temporal and a running Temporal server.
| Command | Description |
|---|---|
run <name> | Start an Op workflow (spawns worker + submits to Temporal) |
run list | List 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 |
graph | Print the Op dependency graph |
State Commands
Section titled “State Commands”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.
| Command | Description |
|---|---|
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> --live | Query cloud right now and report drift (six categories: missing, orphan, disappeared, drifted, etc.) |
lifecycle log [env] | History of lifecycle snapshots |
Server Commands
Section titled “Server Commands”| Command | Description |
|---|---|
serve lsp | Start the LSP server for editor integration |
serve mcp | Start MCP server for AI agent integration |
Common Workflows
Section titled “Common Workflows”# Initialize and build a projectchant init my-infra --lexicon awscd my-infrachant build
# Lint definitionschant lint
# Import existing templateschant import template.json
# Check project healthchant doctorFile Discovery
Section titled “File Discovery”The CLI automatically discovers infrastructure files based on these rules:
Included:
- All
.tsfiles in the specified directory and subdirectories
Excluded:
- Files in
node_modules/directories - Test files:
*.test.ts,*.spec.ts - TypeScript declaration files:
*.d.ts
Error Handling
Section titled “Error Handling”The CLI provides structured error output for different types of errors:
Discovery Errors
Section titled “Discovery Errors”Reported when files can’t be loaded or imported. Common causes: missing dependencies, syntax errors, invalid import paths, circular dependencies.
Build Errors
Section titled “Build Errors”Reported during serialization. Common causes: circular dependencies between resources, invalid attribute references, missing required properties.
Global Options
Section titled “Global Options”--verbose, -v
Section titled “--verbose, -v”Show stack traces on errors.
--help, -h
Section titled “--help, -h”Display help information for the CLI.
chant --helpSee Also
Section titled “See Also”- Getting Started Guide — learn the basics
- Core Type System — understand the type system