Reference / Trace App CLI

CLI Configuration

How trace-cli signs in, finds your project files and takes its options.

trace-cli has no settings file to edit. It keeps its own sign-in, reads your project's own settings, and takes everything else as options on each command. It reads the Trace app's settings, such as your libraries, but doesn't change them.

Sign-in

trace-cli auth login
trace-cli auth status
trace-cli auth status --json
  • auth login opens your browser to sign in. trace-cli keeps this sign-in to itself, so signing in or out in the terminal never changes the Trace app's sign-in.
  • Until you run auth login, trace-cli can borrow the Trace app's sign-in while the app is signed in on the same computer. That only lasts while the app keeps it fresh.
  • auth status says which sign-in trace-cli is using, and exits with a nonzero code if there is none.
  • trace-cli auth logout signs trace-cli out. The Trace app stays signed in.
  • Run trace-cli as the same user account you signed in with. Each user account on a computer has its own sign-in.
  • auth status --json includes your name, email and account and device IDs. Remove them before you share the output.

Signing in gives trace-cli your account. AI commands also need available usage on your plan (see Billing), and Workspaces commands need access to the project.

Sign in without a browser

On a build server, or for a coding assistant that can't open a browser, sign in with an API token:

  1. On the web dashboard, open Settings, then API Tokens under Developer, and create a token with Full access. Choose when it expires.
  2. Give it to trace-cli in one of two ways:
    • Save it for this user account: pipe it into trace-cli auth login --with-token, for example from your build system's secret store.
    • Or set the TRACE_TOKEN environment variable to the token for the job. It takes priority over any other sign-in.
printf '%s' "$MY_TRACE_TOKEN" | trace-cli auth login --with-token

Treat a token like a password: keep it out of scripts, chat messages and design files, and keep it in your build system's secret store. trace-cli auth logout forgets a saved token, but the token keeps working elsewhere until you revoke it in API Tokens. To stop using TRACE_TOKEN, unset it.

Project files

trace-cli reads the same files as the Trace app, so keep a project together:

  • The schematic (.trace_sch) or board (.trace_pcb) and its matching .xo file.
  • The project file (.kicad_pro), which holds the rule severities, net classes and other project settings. Without it, trace-cli chat warns you and ERC and DRC fall back to default settings.
  • The project's library tables, so parts and footprints resolve.
  • .trace/rules.md, if you have one. trace-cli chat sends it to the assistant just as the app does. See TraceRules.

trace-cli chat and the project commands find the project in the current folder, or in the folders above it. --project names another one: its folder, its .kicad_pro or a design file. If a folder holds more than one project, name the one you want. Workspaces commands take the full path to the .kicad_pro in the local copy Trace keeps of a Workspaces project.

Command options

Options are set on each command. The ones you will use most:

OptionUsed byWhat it does
--project PATHchat, project commandsThe project to work on, instead of the one in the current folder.
--mode askchatAnswers only, no edits. The default mode, agent, can edit your files.
--model NAMEchatgpt-astra, gpt-sol, genie-2-flash or genie-2.
--format jsonchatOne JSON event per line.
--no-interactive, --auto-approvechatDecline or accept part previews and file deletions without asking. Neither one stops Agent mode from editing.
--allow-route, --allow-spendchatLet a script start basic routing, or paid advanced layout runs up to --max-minutes N, without asking.
--jsonproject commandsPrint one JSON document.
--output FILE, --format jsonsch erc, pcb drcWrite the report as JSON.
--exit-code-violationssch erc, pcb drcExit with code 5 when there are findings.
--jsonworkspacesPrint the result on one line.
--yesworkspacesConfirm an action without the prompt.
--request-id IDworkspacesName an action so you can look it up later.

The command reference has the full list, and --help on any command shows its options.

Your data

Checks, exports, board updates and conversions run entirely on your computer. Chat, basic routing, advanced layout and Workspaces work with Trace's servers, as they do in the app: the assistant receives the parts of your design it needs to answer.

Chats from the terminal are kept with the Trace app's chat history on this computer, so either one can pick them up.

trace-cli has no option for your own model provider key. See BYOK availability.