Home/Docs/Guides/CI Mode

Use bake in CI/CD pipelines.

CI Mode

Global flags

Every bake command supports:

FlagDescription
--ciPlain, color-free output; no spinners; no interactive prompts
--jsonStructured JSON output; no decorative text

CI usage

bash
# Deploy in CI
bake deploy --ci --yes

# Audit gate
bake audit --ci && echo "Passed" || echo "Failed"

# Stats as JSON
bake stats --json | jq '.invocations'

Non-interactive behavior

In CI/JSON contexts:

  • No interactive prompts (wallet creation, confirmation dialogs)
  • No spinners or progress bars
  • No color codes
  • Errors go to stderr with structured output

Wallet in CI

CI environments need a wallet. Options:

  1. Environment variable: Set ANCHOR_WALLET to a keypair path
  2. Pre-created keypair: Place id.json in the expected location
  3. bake login in setup step: Create wallet before deploy step
yaml
# GitHub Actions example
- name: Setup wallet
  run: bake login --ci

- name: Deploy
  run: bake deploy --ci --yes

Exit codes

All commands use consistent exit codes:

  • 0 โ€” success
  • Non-zero โ€” failure (specific codes vary by command)

See Exit Codes for details.

Sourced from local MDX in docs/content/docs