Your first change
Show the whole prompt
Read https://intentius.io/chant/ci/first-change/
Generate this repository's pipeline with `npx chant build --components --generate <forge> --pr-loop --env <env> --output <file>` and the flags the page shows, and open a change with the pipeline.
List the credentials and tokens a person must set up; do not create them yourself.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.Optional: hand this page to your coding agent
Read https://intentius.io/chant/ci/first-change/Generate this repository's pipeline with `npx chant build --components --generate <forge> --pr-loop --env <env> --output <file>` and the flags the page shows, and open a change with the pipeline.List the credentials and tokens a person must set up; do not create them yourself.Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.You need a chant project on GitHub, GitLab or Forgejo.
Declare a component
Section titled “Declare a component”import { phase, type Component } from "@intentius/chant/components";
export const network: Component = { name: "network", dependsOn: [], deploy: [ phase("Apply", [step]), // the step for your platform, from the table below ],};| Platform | Step |
|---|---|
| Kubernetes | { kind: "kubectl-apply", stack: "network", manifest: "dist/network.yaml" } |
| AWS | { kind: "cfn-deploy", stack: "network", template: "dist/network.json" } |
| Azure | { kind: "arm-deploy", resourceGroup: "network", template: "dist/network.json" } |
| GCP | { kind: "gcp-apply", stack: "network", manifest: "dist/network.yaml" } |
List the environment in chant.config.ts as environments: ["prod"]. Plan previews lists the step kinds that can plan.
Generate the pipeline
Section titled “Generate the pipeline”npx chant build --components --generate github --pr-loop --env prod \ --pr-build-command 'chant build src --lexicon <yours> -o dist/<your file>' \ --before-script 'npm ci --no-audit --no-fund' \ --before-script 'echo "$PWD/node_modules/.bin" >> "$GITHUB_PATH"' \ --output .github/workflows/chant-pr.yml| Forge | --generate | --output |
|---|---|---|
| GitHub | github | .github/workflows/chant-pr.yml |
| Forgejo | forgejo | .forgejo/workflows/chant-pr.yml |
| GitLab | gitlab | .gitlab-ci.yml |
--pr-build-command builds your file before each plan. The two --before-script lines install chant in each job. On GitLab, the second line is export PATH="$PWD/node_modules/.bin:$PATH", and you also set CHANT_FORGE_TOKEN, a project access token with the api scope, as a masked variable.
The plan and record jobs need credentials for your platform, allowed to read what the plan compares against.
Push one change
Section titled “Push one change”Commit the component and the pipeline on a branch, and open it for review. One note appears with the plan and its approve line. Read it, then approve it. The merge records the plan and deploys nothing.
Generate the pipeline has every flag.