Project Structure
chant init creates a project that keeps resource definitions, type information and configuration in separate places.
Top-Level Layout
Section titled “Top-Level Layout”my-infra/├── src/│ └── main.ts # Resource definitions├── .chant/│ ├── types/ # Generated type definitions (gitignored)│ ├── meta/ # Lexicon metadata cache (gitignored)│ └── rules/ # Lexicon lint rules (gitignored)├── skills/ # Lexicon skill files (gitignored)├── chant.config.ts # Project configuration├── tsconfig.json # TypeScript config for your editor and tsc├── package.json└── .gitignoreSource Directory (src/)
Section titled “Source Directory (src/)”This is where your resource definitions live. Every .ts file that exports values adds resources to the build output.
src/config.ts defines shared configuration using typed sub-resource constructors. These are imported directly by resource files via import { ... } from "./config".
Configuration Files
Section titled “Configuration Files”chant.config.ts
Section titled “chant.config.ts”Project-level settings for linting, lexicon declarations, and evaluation:
export default { lexicons: ["aws"],};See Config File Reference for all fields.
tsconfig.json
Section titled “tsconfig.json”Standard TypeScript configuration for your editor and tsc. This is the file chant init writes.
{ "compilerOptions": { "target": "ES2022", "module": "esnext", "moduleResolution": "bundler", "types": ["node"], "strict": true, "esModuleInterop": true, "skipLibCheck": true, "declaration": true, "outDir": "./dist", "rootDir": "./src" }, "include": ["src"], "exclude": ["node_modules", "dist"]}bundler resolution lets ./config stay extensionless, which is how chant resolves it. See TypeScript Configuration for details.
Examples to learn from
Section titled “Examples to learn from”The repository ships examples in three tiers: a golden teaching example to start from, small feature examples per lexicon, and full reference deployments. Start with the getting-started example. See Examples — Tiers and Layout for the full map.