Skip to main content
The Trace CLI is in active alpha (v0.1.0). Everything on this page reflects the shipping command surface. The AI commands (chat, agent, plan, review, ask) run through the Trace backend — free accounts get ask; agent/plan require a trial or paid plan. The local commands (erc, drc, gerbers, export, convert, rules, history, index) work without a subscription.

What it is

buildwithtrace is a terminal interface for Trace’s AI-powered EDA tools. On macOS and Windows, it requires the Trace desktop app to be installed (the CLI uses the desktop app’s local engine). On Linux, the CLI downloads a standalone engine automatically on first use — no desktop app needed.
  • Design with AIbuildwithtrace chat, buildwithtrace agent, and buildwithtrace plan give you the full agentic design loop, with file edits, tool execution, and plan mode, against your local .kicad_sch / .kicad_pcb / .trace_sch / .trace_pcb files.
  • Validate locallybuildwithtrace erc, buildwithtrace drc, and buildwithtrace gerbers run on a bundled engine, no cloud round-trip required. Perfect for CI.
  • Convert anythingbuildwithtrace convert turns Altium (.SchDoc / .PcbDoc / .PrjPcb) into KiCad with netlist-accurate connectivity, and moves losslessly between KiCad and Trace’s text DSL (.trace_sch / .trace_pcb).
  • Manufacturebuildwithtrace dfm, buildwithtrace bom, buildwithtrace components, and buildwithtrace order take you from design to fab.
  • Integratebuildwithtrace mcp serve exposes Trace as a Model Context Protocol server so Cursor, Claude Desktop, or any MCP client can drive it. The GitHub Action drops it into CI.
The same Trace account, plan, quota, versions, and teams back both the desktop app and the CLI. Work you do in one shows up in the other.

How it fits together

┌─────────────────────────────────────────────────────────┐
│  buildwithtrace (CLI)                                   │
│  • Local engine: ERC / DRC / Gerbers / PDF / SVG / STEP │
│  • Local converters: Altium ↔ KiCad ↔ Trace DSL         │
│  • Offline EDA index, rules, history (no network)       │
├─────────────────────────────────────────────────────────┤
│  api.buildwithtrace.com  (the same backend the app uses)│
│  • AI: chat / agent / plan / review / ask (SSE stream)  │
│  • Components, BOM, DFM, orders, versions, teams, billing│
└─────────────────────────────────────────────────────────┘
The “local engine” IS the Trace desktop app’s command-line binary (trace-cli). On macOS and Windows, the desktop app must be installed — the CLI detects it automatically. On Linux, if you don’t have the desktop app installed, the CLI downloads a standalone engine on first use. Either way, the commands work identically.
AI requests stream over Server-Sent Events. Tool calls (read file, write, grep, run ERC/DRC, snapshot, etc.) are dispatched back to the CLI and executed on your machine, against your files — your designs never have to leave your disk for the AI to work on them.
Bringing your own model key? buildwithtrace byok set anthropic|openai|gemini routes the AI through your provider (billed to you, not your Trace quota) while still using Trace’s EDA tools and prompts. See Bring Your Own Key.

Install

The CLI is a Python package (buildwithtrace) and requires Python 3.10+. It installs a single command: buildwithtrace. (There’s no trace binary — that name collides with the macOS system /usr/bin/trace.)
Want a shorter command? Add your own shell alias — alias trace=buildwithtrace. Note this shadows the macOS system /usr/bin/trace, so skip it on macOS unless you’re sure you don’t need the system tool.
pip install buildwithtrace
Verify the install:
buildwithtrace --version
buildwithtrace doctor      # checks API connectivity, auth, engine, Python, model provider

Authenticate

buildwithtrace auth login
This opens your browser for OAuth (Google by default; --provider github for GitHub). Tokens are stored in your OS keychain (com.buildwithtrace.cli), falling back to a 0600 file if no keychain is available. For headless / CI machines, use a token instead of the browser:
# For CI — create at buildwithtrace.com/dashboard/settings > Developer, or via CLI
export TRACE_API_TOKEN=trace_pat_xxx

# Or log in with a token explicitly
buildwithtrace auth login --token trc_xxx

# Or get a guided paste flow (open the URL on any machine)
buildwithtrace auth login --no-browser
Check who you are and your plan/quota at any time:
buildwithtrace whoami
buildwithtrace auth status

Quick start

# Ask a question — read-only, no files touched (works on the free plan)
buildwithtrace ask "What decoupling caps does an STM32F4 need?"

# Full interactive design session against a project
buildwithtrace chat --project ./my-board/

# One-shot, single-instruction edit (writes auto-approved)
buildwithtrace agent "Add a 100nF decoupling cap to every IC power pin" --project ./my-board/

# Multi-step plan mode: research → questions → plan → execute
buildwithtrace plan "Design a USB-C PD trigger board for 20V output"

# AI design review, written to a file
buildwithtrace review ./my-board/ --focus thermal,power --output review.md

# Local validation (uses the bundled engine — no account needed)
buildwithtrace erc ./my-board/board.kicad_sch
buildwithtrace drc ./my-board/board.kicad_pcb
buildwithtrace gerbers ./my-board/board.kicad_pcb --output ./fab/

# Convert an Altium project to KiCad
buildwithtrace convert project ./LegacyBoard/ --output ./kicad-out/

The command surface at a glance

CommandWhat it doesRuns
buildwithtrace chatInteractive AI design sessionBackend
buildwithtrace askOne-shot read-only questionBackend
buildwithtrace agentSingle auto-approved instructionBackend
buildwithtrace planResearch → plan → executeBackend
buildwithtrace reviewAI design reviewBackend
buildwithtrace signalTrace a net/component through connectivityBackend
buildwithtrace erc / drcElectrical / design rule checksLocal engine
buildwithtrace gerbersGerber + drill exportLocal engine
buildwithtrace exportPDF / SVG / netlist / BOM / STEP / posLocal engine
buildwithtrace convertAltium ↔ KiCad ↔ .trace_sch/.trace_pcbLocal
buildwithtrace indexOffline component/net lookupLocal
buildwithtrace rulesManage .trace/rules.mdLocal
buildwithtrace historyBrowse .history autosave (read-only)Local
buildwithtrace componentsSearch / check partsBackend
buildwithtrace bomGenerate / enrich BOMsBackend
buildwithtrace generateGenerate symbols / footprintsBackend
buildwithtrace dfmDFM autofill / checksBackend
buildwithtrace orderManufacturing ordersBackend
buildwithtrace versionsSchematic version snapshotsBackend
buildwithtrace teamsTeam workspacesBackend
buildwithtrace billingPlan, quota, upgradeBackend
buildwithtrace shareShareable conversation linksBackend
buildwithtrace altiumLive Altium Designer bridgeBackend + bridge
buildwithtrace byokBring your own LLM keyLocal
buildwithtrace mcpMCP server for AI assistantsLocal
buildwithtrace configCLI configurationLocal
buildwithtrace engineManage the local engine binaryLocal
buildwithtrace doctorDiagnose environment & connectivityLocal
buildwithtrace whoamiShow current userLocal
See the full CLI Command Reference for every flag and argument.

Security

The CLI executes AI tool calls (read, write, search-replace, delete) locally on your machine, behind the same sandbox the desktop app uses:
  • Project-directory sandbox — every file path is resolved (Path.resolve(), symlink-safe) and must live inside the project directory. Paths that escape it are rejected.
  • Extension allowlist — reads/writes are limited to EDA file types: .trace_sch, .trace_pcb, .kicad_sch, .kicad_pcb, .kicad_sym, .kicad_mod, Altium (.SchDoc, .PcbDoc, .SchLib, .PcbLib, .PrjPcb), plus .svg, .zip, .gbr, .drl, .md, and the fp-lib-table / sym-lib-table files. Anything else is blocked.
  • Write approval — in buildwithtrace chat, write/search-replace/delete tools prompt for approval before touching disk. Pass --yes to auto-approve (e.g. for scripted runs). buildwithtrace agent auto-approves by design; buildwithtrace ask and buildwithtrace review never write.
  • Credentials — auth tokens and BYOK keys live in your OS keychain (service com.buildwithtrace.cli), never in plaintext config. See Configuration.
Your design files never need to leave your machine for local commands (erc, drc, gerbers, export, convert, index). AI commands stream the relevant file content to the backend so the model can reason about it; tool execution always happens locally.

Caveats & FAQ

Local commands require the Trace desktop app (or KiCad)

buildwithtrace erc, drc, gerbers, and export are thin wrappers around the Trace desktop app’s C++ engine binary (trace-cli). You need the desktop app (or KiCad) installed on the same machine. The CLI cannot run these commands without it.
The CLI searches these locations for the engine:
PriorityLocationNotes
1TRACE_ENGINE_PATH env varExplicit override
2/Applications/Trace.app/ (macOS)Desktop app bundle
3%LOCALAPPDATA%\Programs\Trace\ (Windows)Desktop app install
4/usr/bin/trace-cli or /opt/trace/ (Linux)System install or AppImage
5kicad-cli in PATHKiCad fallback (same engine, different branding)
If none are found, the CLI shows: “Trace/KiCad CLI not found. Install Trace from buildwithtrace.com” Why not bundle it? The engine is ~150 MB of compiled C++ with platform-specific GUI dependencies. Bundling it into a Python wheel would make installation impractical. The architecture is: lightweight Python CLI orchestrates → heavyweight C++ engine executes. Don’t want the full desktop app? On Linux, the CLI auto-downloads a self-contained engine on first use (~200 MB AppImage). On macOS/Windows, the desktop app is required — it’s a free download at buildwithtrace.com/download.
Need the engine (C++ binary):
  • buildwithtrace erc — Electrical Rule Check
  • buildwithtrace drc — Design Rule Check
  • buildwithtrace gerbers — Gerber/drill export
  • buildwithtrace export — PDF/SVG/STEP export
Pure Python (no engine needed):
  • buildwithtrace convert — format conversion (Altium ↔ KiCad ↔ Trace)
  • buildwithtrace index — local project indexing
  • buildwithtrace rules — TraceRules management
  • buildwithtrace history — git-based local history (needs git in PATH)
  • buildwithtrace ask/chat/agent/plan/review — AI commands (need network, not engine)
  • buildwithtrace auth — authentication
  • buildwithtrace byok — key management
  • buildwithtrace doctor — diagnostics
If you save a file with Trace 1.4 and try to run ERC with an older engine (e.g., from a KiCad 8.0 install), you’ll get “Failed to load schematic.” The CLI detects this and suggests updating. Fix: update the desktop app from buildwithtrace.com/download.
The CLI requires Python 3.10 at minimum. Common pitfalls:
  • macOS: The system Python (/usr/bin/python3) is often 3.9. Install via brew install python@3.12 or pyenv install 3.12.
  • Ubuntu 20.04 LTS: Ships Python 3.8. Use the deadsnakes PPA: sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt install python3.12.
  • Symptom: SyntaxError or ImportError on install/import if version is too old.
CommandFree planTrial / Paid
ask
chat
agent
plan
review
The CLI shows a clear error (“Access denied — this feature requires a paid plan”) if your plan doesn’t support the command. Run buildwithtrace auth status to check.Local commands (erc, drc, gerbers, export, convert, index, rules, history) never require auth or a subscription.
The Altium converter handles most real-world projects, but has known edge cases:
  • Fonts: Custom Altium fonts render as DM Sans. Text sizing may differ slightly.
  • 3D models: Embedded STEP models are referenced but not extracted into separate files.
  • Custom pad shapes: Arbitrary polygon pads approximated as bounding primitive.
  • Harness connectors & multi-level bus aliases: Partially supported; deep nesting may lose connectivity.
  • Expression-based design rules: Converted to comments (KiCad DRC doesn’t support expression rules).
  • Large files (>200 MB PcbDoc): No size guard — may use significant RAM on memory-constrained machines.
  • Non-UTF-8 text: Characters not representable in UTF-8 are replaced with .
If a conversion fails, the error message identifies the exact record or object that caused it. Report issues at support@buildwithtrace.com.
When converting .trace_sch → .kicad_sch or .trace_pcb → .kicad_pcb, the converter needs access to KiCad symbol/footprint libraries to produce accurate geometry. Without them:
  • Symbols get placeholder rectangles with correct pins but approximate dimensions
  • Footprints get placeholder pads based on pin count but imprecise geometry
The CLI downloads KiCad symbol libraries (~30 MB) to ~/.trace/libraries/ on first use. If the download fails (offline, GitHub unreachable), conversion still works but with reduced visual fidelity.
The CLI installs only as buildwithtrace. macOS ships /usr/bin/trace (a kernel tracing tool) — shadowing it would break system debugging. For a shorter alias:
alias bt=buildwithtrace  # add to ~/.zshrc or ~/.bashrc
The CLI stores auth tokens in your OS keychain:
  • macOS: Keychain Access (service com.buildwithtrace.cli)
  • Windows: Credential Manager
  • Linux: libsecret (GNOME Keyring / KWallet)
Fallback: If the keychain is unavailable (locked, denied, headless server, Docker, missing libsecret), credentials fall back to ~/.config/trace/credentials.json. The CLI does not warn you about this fallback.CI/Docker: Set TRACE_API_TOKEN=trc_xxx as an environment variable instead. This bypasses the keychain entirely.
buildwithtrace auth login opens a browser for OAuth. This fails in:
  • SSH sessions without X11 forwarding
  • WSL2 without BROWSER set
  • Docker containers
  • Headless CI servers
Workaround: Log in on a machine with a browser, copy the token, and either:
buildwithtrace auth login --token YOUR_ACCESS_TOKEN
# or
export TRACE_API_TOKEN=trc_xxx
The CLI respects standard proxy environment variables:
export HTTP_PROXY=http://proxy.corp.com:8080
export HTTPS_PROXY=http://proxy.corp.com:8080
SSL inspection (MITM proxies): If your corporate proxy injects custom CA certificates, you may get SSL errors. Fix:
export SSL_CERT_FILE=/path/to/corporate-ca-bundle.crt
# or
export REQUESTS_CA_BUNDLE=/path/to/corporate-ca-bundle.crt
Buffering proxies: Some proxies buffer HTTP responses. This affects SSE streaming — you’ll see long pauses then bursts of text instead of smooth streaming. The CLI still works correctly; it’s a UX difference.Run buildwithtrace doctor to diagnose connectivity issues — it checks proxy settings and reports them.
buildwithtrace erc and buildwithtrace drc run entirely locally (engine binary + files). They never contact the Trace backend. This means:
  • Work on forked PRs where secrets aren’t available
  • Work fully offline
  • Work behind restrictive firewalls
Requirement: The CI runner needs the Trace engine. On Linux runners (most common), the CLI auto-downloads the AppImage on first use. No manual setup needed:
- name: Install Trace CLI
  run: pip install buildwithtrace
- name: Run ERC
  run: buildwithtrace erc my-schematic.kicad_sch --exit-zero
CodeMeaning
0Success
1General failure (conversion error, API error, unexpected exception)
2Authentication required or failed
5Engine binary not found / unavailable
10ERC/DRC found violations (design has issues but the command ran correctly)
Use --exit-zero on erc/drc to always return 0 (useful when you want violations as informational, not blocking).
The CLI has no file locking. Running two buildwithtrace agent or buildwithtrace chat sessions against the same project simultaneously can result in:
  • Last-write-wins on .trace_sch / .kicad_sch files
  • Race conditions in the trace→kicad conversion
The desktop app uses hash-based optimistic concurrency + per-file mutexes. The CLI does not (single-process design). If you need parallel AI sessions, use separate project directories or the desktop app.
When the AI reads/writes files during chat or agent mode, it’s restricted to:
  • Only files inside your project directory (path traversal blocked)
  • Only EDA file types: .trace_sch, .trace_pcb, .kicad_sch, .kicad_pcb, .kicad_sym, .kicad_mod, Altium formats, .svg, .zip, .gbr, .drl, .md, .net
The AI cannot read your .py, .json, .csv, .pdf, .png, or other non-EDA files. If it tries, the CLI blocks it with a security error. This is intentional — the sandbox prevents accidental data exfiltration.
buildwithtrace byok set anthropic sk-ant-xxx stores the key in your OS keychain, never in config files or shell history. To rotate: run buildwithtrace byok set again with the new key. To remove: buildwithtrace byok clear.
Without network, AI commands fail immediately with a clear error. Local commands work fully offline as long as:
  • The engine binary is already installed (desktop app or KiCad present)
  • Symbol libraries are already cached (for conversion quality)
Pre-cache everything while online: install the desktop app, then run buildwithtrace convert once to trigger library download.
buildwithtrace history uses your system git binary to read the .history/ repository the desktop app maintains. If git is not in your PATH, the command fails with a clear error. Install git from git-scm.com.
The CLI sends anonymous usage analytics (PostHog) and crash reports. To disable:
export TRACE_NO_ANALYTICS=1   # disable PostHog analytics
export TRACE_NO_REPORTS=1     # disable crash report submission
Add these to your shell profile for permanent opt-out.
AI commands have a 300-second stream timeout. If the model takes longer (very complex tasks) or your connection is slow:
  • The CLI shows: “Stream timed out after 300s”
  • Partial output is still visible in your terminal
  • The conversation may be in an inconsistent state — start a new one rather than --resume
If you’re behind a buffering proxy, the effective timeout may feel shorter because idle time between chunks counts against it.

Where to go next

Command Reference

Every command, subcommand, flag, and exit code.

Bring Your Own Key

Route the AI through your own Anthropic, OpenAI, or Gemini key.

MCP Server & Agent Plugin

npx plugins add buildwithtrace/trace-plugin — skills + MCP for Cursor, Claude, Codex.

Automation & CI/CD

JSON output, exit codes, GitHub Actions, headless auth.

Configuration

config.toml, environment variables, environments, credentials.

Roadmap

What’s shipped, what’s coming, and the doc↔code gaps we’re closing.

TraceRules

Persistent design preferences the AI follows automatically.