Skip to content

CI/CD with abt

Check an abt project on every pull request. Each command below runs in a project made with abt init, which has no pyproject.toml.

Step Command Fails the job when Needs a model key
Compile abt compile an agent, workflow, test file, tool, skill or abt.yaml is invalid No
Test plan abt test --dry-run a test suite is invalid. It lists every case and calls no model No
Formatting abt lint a file is not in canonical format (abt lint --fix rewrites it) No
Tests abt test a test case fails Yes. Each case calls the judge model

abt doctor is advisory by default. It exits 0 after printing its report, whatever it finds, except when it could not check the whole project (no agent to check, or an agent whose env_var() is unset): then it exits 1. Add --fail-on warning (or --fail-on error) to fail the job when a finding reaches that severity. On a project that already has findings, commit a baseline (abt doctor --write-baseline doctor-baseline.json) and gate with --baseline doctor-baseline.json so only new findings fail the job. --format json gives tooling the findings. See Doctor.

Example: GitHub Actions

profiles.yaml is git-ignored, so CI has none. Define the target from environment variables instead: ABT_TARGET selects it and ABT_TARGET__<TARGET>__* fills it in. Keep the values in the CI secret store. See Env-var-only targets. Only the Test step needs the API key, so the example sets it there.

# .github/workflows/abt.yml
name: abt
on: [pull_request]

jobs:
  check:
    runs-on: ubuntu-latest
    env:
      ABT_TARGET: ci
      ABT_TARGET__CI__MODEL_ID: anthropic:claude-haiku-5-5
      MCP_GITHUB_TOKEN: ${{ secrets.MCP_GITHUB_TOKEN }}   # only for `abt compile --live` and runs that use the source
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v3

      - name: Install abt
        run: |
          uv venv --python 3.12
          uv pip install "abt-core[all]"
          echo "$PWD/.venv/bin" >> "$GITHUB_PATH"

      - name: Compile
        run: abt compile

      - name: Test plan
        run: abt test --dry-run

      - name: Formatting
        run: abt lint

      # Needs a real model key: each test case calls the judge model.
      - name: Test
        env:
          ABT_TARGET__CI__CREDENTIALS__ANTHROPIC__API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: abt test --fail-fast

The install step creates .venv and puts it on PATH for the later steps. [all] installs every optional integration. Name only the extras you use to shorten the job (see Installation). Run the commands from the directory that holds abt.yaml, or pass --project-root. For another provider, change the model ID and the credentials namespace to match your agents.

A passing compile and test plan end like this, with exit code 0:

$ abt compile
  Manifest ready (2 agents).
Compiled 2 agent(s).
...
$ abt test --dry-run
...
No LLM calls or test execution performed.

A failure prints an ERROR: line and exits non-zero.

Compile credentials

Compile reads every mcps/*.json file. A plain abt compile, abt doctor or abt list only warns about an unset {{ env_var('NAME') }}, so a static-check job needs no MCP credentials. abt compile --live fails on it with MCP source validation failed, and a run that loads the source's tools fails with MCP source '<name>': env_var: not set and no default was given: <VAR> (E_ENV_VAR_MISSING). Set the variable in the job, as above, for those.

Tool specs from packages are checked only when the packages are installed, so run abt deps before abt compile in CI.

abt compile --live goes further. It starts each MCP server to fetch its tool list (see MCP integrations), and it fails when a server cannot be listed or when an agent names a tool its server does not expose. It resolves remote skills and external context too. Give the job the credentials for all of these. If a pull-request job has no credentials for your MCP servers or remote skills, run plain abt compile there, which still fails on an invalid agent, an unknown tool or an MCP source that does not exist, and keep --live for a scheduled job that has them.

Run abt doctor --deep (LLM-reviewed findings, not just static rules) on a schedule or in a separate, slower job rather than on every PR. It needs a model key and calls the judge model four times per agent (one call per rubric dimension).

See Testing and Doctor for the full flag reference, and Configuration for profile and credential resolution.