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 |
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 |
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