Reference / Trace App CLI

Trace CLI

Chat with Trace from your terminal, and run checks, fabrication files, board updates and Workspaces commands with trace-cli, the command-line tool that comes with the Trace app.

trace-cli is the command-line tool that comes with the Trace app. Run it in a project folder to chat with Trace in your terminal, as you would in the app. It also runs ERC and DRC, writes fabrication files, updates a board from its schematic, converts between Trace and KiCad files and works with Workspaces projects, from a terminal or a script.

New in Trace 3.3: the full chat in the terminal, / commands, its own sign-in and Tools > Install trace-cli Command.

Before you start

  1. Install the Trace app. trace-cli comes with it, so there is nothing else to download.
  2. Put trace-cli on your PATH, so any terminal can run it. See Find trace-cli.
  3. Sign in with trace-cli auth login. See Sign in.

Checks, exports, board updates and conversions run on your computer and work without signing in. Chat, basic routing, advanced layout and Workspaces commands use your Trace account: they need you signed in and, for AI work, available usage on your plan. See Billing.

Find trace-cli

On macOS and Windows, open the Trace app and choose Tools > Install trace-cli Command…. Then open a new terminal window and check it:

trace-cli --version
  • macOS: Trace adds trace-cli to /usr/local/bin, and asks for your password if that folder needs it. Without the password it uses ~/.local/bin and tells you how to add that folder to your PATH. Open Trace from your Applications folder first: Trace can't install the command while it runs from the disk image.
  • Windows: Trace adds its bin folder to your user PATH. When you update Trace, the next start points it at the new version.
  • Tools > Uninstall trace-cli Command… takes it off your PATH again. Trace itself stays as it is.

You can also run trace-cli by its full path:

  • macOS: /Applications/Trace.app/Contents/MacOS/trace-cli, or the same place inside your copy of Trace.
  • Windows: trace-cli.exe in the bin folder of your Trace installation, in a folder named after the Trace version, for example C:\Program Files\Trace\3.3\bin\trace-cli.exe. If you installed Trace for your user only, look in %LOCALAPPDATA%\Programs\Trace\3.3\bin.
  • Linux: trace-cli is included in the Trace AppImage. If you need help running it on Linux, email hello@buildwithtrace.com.

trace-cli doctor checks that everything is ready: whether trace-cli is on your PATH, your sign-in, the connection to Trace, the project in the current folder and your terminal.

Sign in

trace-cli auth login

This opens your browser to sign in to Trace, then returns to the terminal. trace-cli keeps its own sign-in, separate from the app's, so signing in or out here never signs the Trace app out. If your browser is on another computer, add --no-browser to print the sign-in address instead.

If you haven't run auth login, trace-cli can borrow the Trace app's sign-in while the app is signed in on this computer. That sign-in only lasts while the app keeps it fresh, so auth login is the better choice for regular use.

trace-cli auth status

auth status shows the account trace-cli is signed in to and which sign-in it is using. It exits with a nonzero code when it isn't signed in.

trace-cli auth logout signs trace-cli out. The Trace app stays signed in. When trace-cli is borrowing the app's sign-in, it changes nothing and tells you to sign out in the app.

For a build server or a coding assistant that can't open a browser, see Sign in without a browser.

Chat with Trace in your terminal

New in Trace 3.3. Open a terminal in your project folder and run:

trace-cli

trace-cli finds the Trace project in the current folder, or in the folders above it, and opens a chat about it. To work on another project, add --project with its folder, .kicad_pro or design file. The chat works on the project's schematic and board together. It starts in the schematic, or in the board if you name the board with --project, and /sch and /pcb move between them.

The chat talks to the same assistant as the chat in the Trace app, with the same models and tools, and it starts in Agent mode, which can edit your design.

  • Type a request and press Enter. Trace shows each step it takes, ticked off as it goes, and streams its reply.
  • Steer while it works. Type a message while Trace is busy and it reads it at its next step.
  • Esc stops Trace. Shift+Tab switches between Ask, Agent and Plan. Press Ctrl+C twice to leave.
  • Type @ to name a file in your project, and press Tab to complete commands, their options and file names.
  • Cards appear in the chat when Trace needs you: questions, approvals, part reviews, file deletions and plans. A question marks Trace's Recommended answer and counts down to it: if you don't answer in time, Trace goes with the recommended answer.
  • Paid runs show their price first. Before an advanced layout run, the chat shows what it costs a minute and the most it can cost, with Run, Run with another time budget (minutes) and Don't run it. Nothing is charged unless you choose to run it.
  • Basic routing waits for you. Trace asks Route the board? before it routes, with Route it and Don't route.

Don't change the same design in the Trace app and in trace-cli at the same time. If the app has the project open, the terminal chat still saves its design edits to the files and the app notices the change. Project settings, such as DRC exclusions, are left to the app.

Like the chat in the app, the assistant runs on Trace's servers, so the parts of your design it needs are sent there.

Commands in the chat

Type / to see the commands; the list narrows as you type. /help lists them all.

CommandWhat it does
/erc, /drc, /checkRun the electrical rules check, the design rule check, or both. --all shows every finding.
/fixAsk Trace to fix what the last check found.
/update-pcbUpdate the board from the schematic. --delete-extra removes footprints no longer in the schematic.
/refill, /finish, /repair, /annotateRefill copper zones; finish the board (teardrops, zones and a decoupling check); repair DRC findings; number the schematic's parts.
/export KINDWrite gerbers, drill, pos, bom, netlist, pdf, svg, step, glb, ipc2581 or odb files. --out picks the folder.
/fabWrite the fabrication package: Gerbers, drill and position files and a bill of materials, zipped.
/bom, /renderWrite the bill of materials, or a 3D picture of the board's top or bottom.
/prep, /score, /metricsCheck that the board is ready for layout, score the placement, or measure the layout.
/previewShow the schematic, /preview pcb the board, /preview web the live view in your browser. /preview off and /preview on turn the pictures that follow Trace's edits off and on.
/undoPut the design back as it was before the last change in this chat.
/plan approve, adjust, research, cancelAnswer Trace's plan.
/mode, /modelSwitch between ask, agent and plan, or choose the model.
/sch, /pcbWork in the schematic or the board.
/new, /resumeStart a new conversation, or continue an earlier one about this project.
/status, /project, /doctorShow the project, mode and conversation; the project's files; or check that everything is ready.
/quitLeave the chat.

Exports go to a fabrication or outputs folder in your project unless you choose another with --out. Check the layers, drill files and units before you send files to a manufacturer.

See your design

When Trace changes the schematic or the board, the chat shows a picture of it once the changes settle. Pictures show in terminals that can draw images, such as iTerm2 and kitty.

In a terminal that can't, such as macOS Terminal, /preview opens the live view in your browser instead. It shows the schematic and the board as the editors draw them, sharp at any zoom, and redraws as Trace changes the design. Scroll to zoom, drag to pan, and double-click to fit. /preview web opens it from any terminal.

Your chats and the app

Chats from the terminal show in the Trace app's chat history, and the terminal can pick up the app's chats. /resume lists earlier chats about the project, from either one, and trace-cli chat -c continues the latest.

/undo puts the design back as it was before your last request or command in this chat. If the files changed since then, for example in the Trace app, it tells you; /undo --force puts them back anyway.

Use it in a script

Give one message with -m and trace-cli prints the reply and exits:

trace-cli chat --mode ask -m "Explain how this circuit is powered"

Piped, redirected or run with -m, the chat never waits for you: it declines part previews and file deletions unless you add --auto-approve, and it doesn't start basic routing or paid runs unless you allow them. See AI chat options.

Checks and outputs without the chat

Each chat command also runs on its own, in the project folder:

trace-cli check
trace-cli drc --json --exit-code-violations
trace-cli fab

These find the project the same way, print a short report, and with --json print one JSON document instead. With --exit-code-violations, a check exits with code 5 when it finds errors. See Project commands.

To work on one file at a time, use the sch and pcb commands. Save your work in Trace first: trace-cli reads and writes the saved files, not what's open in the editor. When you try a command that changes files, start with a copy of your project.

trace-cli sch erc ./my-board/my-board.trace_sch --output ./erc-report.json --format json
trace-cli pcb drc ./my-board/my-board.trace_pcb --output ./drc-report.json --format json
trace-cli pcb export gerbers ./my-board/my-board.trace_pcb --output ./gerbers/
trace-cli pcb update ./my-board/my-board.trace_pcb

The command reference lists the commands and their options. Each command also prints its own help with --help, for example trace-cli pcb update --help.

Coding assistants

AI coding assistants, such as Claude Code or Codex, can work with Trace through trace-cli:

  • trace-cli guide --write adds instructions for them to your project's AGENTS.md and CLAUDE.md.
  • Every project command gives its results as JSON with --json.
  • trace-cli mcp connects Trace to an assistant that uses MCP. See MCP.

Workspaces commands

trace-cli workspaces works with Workspaces projects you have opened in Trace on this computer, using the same local copy of the project as the app.

Pass the full path to the project's .kicad_pro file in that local copy with --project. Look around first; reading works even while the project is open in Trace:

trace-cli workspaces status --project /full/path/to/my-board.kicad_pro
trace-cli workspaces changes --project /full/path/to/my-board.kicad_pro
trace-cli workspaces branches --project /full/path/to/my-board.kicad_pro

For commands that change the project, such as commit, push, pull and switch, save your work and close the project in Trace first. Each one shows what it is about to do and asks you to confirm with y. Commit saves a version on this computer; Push publishes it to the project in Workspaces.

trace-cli workspaces commit --project /full/path/to/my-board.kicad_pro -m "Add USB-C input"
trace-cli workspaces push --project /full/path/to/my-board.kicad_pro

To be able to check on an action later, give it your own request ID with --request-id (any new UUID). If the reply gets lost, for example because the connection dropped, look up what happened with that ID before you try again:

trace-cli workspaces receipt --project /full/path/to/my-board.kicad_pro --request-id REQUEST_ID

The command reference lists every Workspaces command, and Automation & CI/CD shows how to use them in scripts.