chant state
Synopsis
Section titled “Synopsis”chant state snapshot <env> [lexicon]chant state show <env>chant state diff <env>chant state log [env]Description
Section titled “Description”chant state captures point-in-time snapshots of deployed infrastructure by querying the cloud provider API and saving the result to a git orphan branch. Snapshots enable drift detection — comparing what’s currently built against what was last deployed.
The environment name (e.g. dev, staging, prod) must be declared in chant.config.ts under environments.
Subcommands
Section titled “Subcommands”state snapshot <env>
Section titled “state snapshot <env>”Query the provider API for the current deployed state, then save a snapshot to the chant-state/<env> orphan branch.
chant state snapshot devchant state snapshot prod aws # snapshot only the aws lexiconstate show <env>
Section titled “state show <env>”Print the latest saved snapshot for an environment.
chant state show devstate diff <env>
Section titled “state diff <env>”Build the current project and compare the output against the last snapshot for that environment. Reports added, removed, and modified resources.
chant state diff devstate log [env]
Section titled “state log [env]”List the history of snapshots. Omit env to show all environments.
chant state log # all environmentschant state log dev # just devExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (invalid environment, API failure, no snapshot found) |
See Also
Section titled “See Also”chant build— build current output for diffing- Configuration — declare
environmentsinchant.config.ts