chant init
Scaffold a new chant project with the standard directory structure and configuration files.
Synopsis
Section titled “Synopsis”chant init <path> --lexicon <name> [flags]| Flag | Description |
|---|---|
-d, --lexicon <name> | Select lexicon (required) |
-t, --template <name> | Init template (e.g. node-pipeline, docker-build) |
--force | Overwrite existing files |
Description
Section titled “Description”chant init creates a new project at the specified path. It generates the full directory layout, TypeScript configuration, lint configuration, and a sample resource file so you can begin writing definitions immediately.
Generated files
Section titled “Generated files”| File | Purpose |
|---|---|
src/ sample resources | Starter resource definitions |
chant.config.ts | Project configuration (lexicons, strict lint preset) |
tsconfig.json | TypeScript compiler options |
package.json | Dependencies |
.gitignore | Ignores generated files |
chant init my-infra --lexicon awscd my-infrachant build
# Overwrite existing fileschant init my-infra --lexicon aws --forceLexicon scaffold mode
Section titled “Lexicon scaffold mode”To scaffold a new lexicon plugin project (for lexicon authors), use:
chant init lexicon <name> [path] [--force]This creates a complete lexicon plugin project with stubs for every required lifecycle method. See init lexicon for full details.
# Scaffold a new lexiconchant init lexicon k8s
# Scaffold at a custom pathchant init lexicon gcp ./my-gcp-lexiconExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Project created successfully |
| 1 | Error (target path is not empty or could not be created) |