Skip to main content
The CLI is built to run unattended. Local validation needs no account; AI commands need a token. This page covers headless auth, exit codes, JSON output, and ready-to-use CI recipes.

Headless authentication

In non-interactive environments, authenticate with a token instead of the browser. Two options:
  1. Dashboard (recommended for CI): Go to buildwithtrace.com/dashboard/settings > Developer > Create Token. This generates a long-lived Personal Access Token (trace_pat_...), with a scope (mcp:all default / partner:read) + expiry picker. Shown once — copy it.
  2. CLI: Run buildwithtrace auth login on a machine with a browser, then buildwithtrace auth token --create --name ci-bot to mint a PAT (or plain buildwithtrace auth token to print the shorter-lived session token).
Creating/listing/revoking tokens needs an interactive login session — a PAT can’t manage tokens. Mint PATs on your laptop (or the dashboard) and inject them into CI as a secret.
When TRACE_API_TOKEN is set, every command uses it automatically — no buildwithtrace auth login needed. Local-only commands (erc, drc, gerbers, export, convert, index) don’t need a token at all.

Non-interactive behavior

When CI is set (GitHub Actions, GitLab CI, etc.) or TRACE_NO_INTERACTIVE=1 is set:
  • Output defaults to JSON.
  • Confirmation prompts (like the symbol-generation credit prompt) are skipped.
  • Preview/accept-edit-reject loops auto-accept.
You can also force JSON per-invocation with the global --json flag or TRACE_JSON=1.

Exit codes

Gate your pipeline on these:

GitHub Actions

Use the official action. It installs Python if needed, installs the CLI, wires TRACE_API_TOKEN, and runs buildwithtrace doctor.
Supported runners: ubuntu-* and macos-*. Windows runners are not yet supported. Add TRACE_API_TOKEN as a repository secret under Settings → Secrets and variables → Actions.

Validate on every PR

ERC/DRC run on the bundled engine and need no token — these jobs work on forked PRs where secrets aren’t available.

AI design review on PRs

Generate Gerbers on release

Matrix across multiple boards

Other CI systems

Any runner with Python 3.10+ works:

Scripting recipes

Batch convert a folder of Altium projects

Export manufacturing files for every board

Pipe the API token to another tool

Consume JSON output

Environment variables for CI

See the full list on the Configuration page.