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 paid plan, free agent credits, or an active legacy trial. 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.
  • Build on Trace — the Python (buildwithtrace-sdk) and Node (@buildwithtrace/sdk) SDKs are standalone agent clients: they run the client-side tool-execution loop themselves, so agent and plan work directly from your own code without the CLI installed. See SDKs.
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

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.
Verify the install:

Authenticate

This opens your browser to the Trace login page ({frontend}/login?callback=http://localhost:PORT/callback) and waits on a loopback callback. You sign in in the browser — password, Google, GitHub, or magic link, with the captcha solved there — and the page bounces the tokens back to the CLI. (The old --provider flag is deprecated; the provider is now chosen in the browser.) Tokens are stored in your OS keychain (com.buildwithtrace.cli), falling back to a 0600 file if no keychain is available. For headless / CI / SSH machines, skip the browser:

Personal Access Tokens (CI/automation)

A browser login gives you a short-lived (~1h) session JWT — fine for an immediate pipe, but it expires. For CI, mint a long-lived Personal Access Token (trace_pat_..., shown once):
Scopes are mcp:all (default — full CLI/MCP access) or partner:read. You can also create PATs in the dashboard (Settings → Developer → Create Token), which has a scope + expiry picker.
Creating, listing, and revoking tokens requires an interactive login session (a browser/email login) — a PAT cannot manage tokens. This keeps a leaked PAT from minting more tokens or revoking your others. (Enforced server-side.)
Check who you are and your plan/quota at any time:

Quick start

The command surface at a glance

See the full CLI Command Reference for every flag and argument.

SDKs (build on Trace from code)

Prefer to drive Trace from your own scripts, services, or apps instead of the terminal? Two official SDKs wrap the same backend the CLI and desktop app use. They are standalone agent clients — each runs the client-side tool-execution loop itself, so the full agentic design loop (agent and plan, with file edits and tool calls executed locally against your files) works directly from the SDK, with no CLI installed.
Requires Python 3.10+. Import root is buildwithtrace_sdk (distinct from the buildwithtrace CLI package).
The SDKs authenticate the same way as the CLI — a Trace account plus TRACE_API_TOKEN (or TRACE_API_KEY), see Configuration — and hit the same backend, so your plan, quota, versions, and teams are shared across the desktop app, the CLI, and the SDKs.
The SDKs are a separate product from the buildwithtrace CLI. The CLI installs (pip install buildwithtrace, brew install buildwithtrace/tap/buildwithtrace, npx buildwithtrace) stay exactly as documented above — buildwithtrace-sdk / @buildwithtrace/sdk are additional packages for programmatic use, not replacements.

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: 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.
New accounts get free agent credits (~$5 one-time + a small monthly top-up) that unlock the agentic commands until exhausted. 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. If your plan doesn’t allow the mode, the CLI prints a clean upgrade CTA (no traceback) and exits with code 4:
Agent mode requires a paid plan. Upgrade at buildwithtrace.com/pricing to continue — or use ‘ask’ mode (free), or bring your own key.
Run buildwithtrace auth status to check your plan. BYOK does not bypass this gate — bringing your own key skips Trace’s cost cap, but you still need at least the plan that unlocks agent/plan (free accounts can only use ask, even with their own key).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:
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=trace_pat_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:
The CLI respects standard proxy environment variables:
SSL inspection (MITM proxies): If your corporate proxy injects custom CA certificates, you may get SSL errors. Fix:
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:
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. Analytics is privacy-first: it records only command names, durations, exit codes, and version/OS info — never file contents, file paths, net/component names, or your prompts (a hard PII scrub drops anything that isn’t a short enum/number/boolean). It’s auto-disabled in CI, and source installs (no baked key) never phone home. To disable everywhere:
Add these to your shell profile for permanent opt-out.
Once per 24h (cached, non-blocking), the CLI checks PyPI for a newer stable release and prints a one-line notice to stderr (never stdout, so piped/--json output is never corrupted):
It’s automatically skipped in CI, in JSON/non-TTY contexts, and for buildwithtrace mcp. Disable it entirely with export TRACE_NO_UPDATE_CHECK=1 (or TRACE_NO_ANALYTICS=1).
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.