traceroot-cli repo.
Set up a repository
Run this from the root of the repository you want to trace:Run without prompts
Setup never prompts when it isn’t attached to a terminal, whenCI is set to anything but empty or false, or with --no-input or --json. Pass what it would otherwise ask for:
npx -y traceroot-cli@latest login first, then run setup without --api-key. Login prints a URL and a code for a person to confirm in a browser, and waits, so a coding agent has to show them to you. If setup exits 10, it can’t choose for you, usually because you have several projects or none: follow the remedy it prints. With several projects, you can pass --project.
Without prompts, setup notes uncommitted changes instead of asking, and writes the instrumentation task to .traceroot/prompts/setup-instrument.md rather than running a coding agent. Pass --agent claude or --agent codex to run one. After the task is done and the application has run, rerun the same setup command with --resume, such as npx -y traceroot-cli@latest setup --no-input --resume, to get a link to the first trace. Exit codes lists what each code means, and Coding agents has these steps as a prompt.
Setup flags
Install
Every command also runs throughnpx, as above. To keep the traceroot command, install the CLI globally:
traceroot. Without a global install, replace it with npx -y traceroot-cli@latest.
The CLI needs Node.js 20.3 or later, and setup needs 20.12 or later. traceroot --version prints the version you have.
Authenticate
The CLI authenticates with either a browser login (the default interactive device flow) or a project API key (for CI environments and scripts).Browser login (default)
Runtraceroot login to sign in through your browser:
~/.config/traceroot/credentials.json. If no browser opens, open the URL yourself. A key or saved credential changes what login does.
API key login (CI & scripts)
For CI pipelines, automated scripts, or headless environments, use a project API key (tr-...):
./.traceroot/config.json.
Or set TRACEROOT_API_KEY, which a saved browser login outranks. A project API key can’t create or change resources.
Create API keys in traceroot Cloud or your self-hosted dashboard.
Verify credentials
Confirm your active identity:- Browser login: Displays your authenticated email address, host URL, active project (or a hint to select one), and accessible workspaces.
- API key login: Displays your workspace, project, host URL, and a masked key hint (e.g.
tr-d0a3-57e3).
Scope to a project
A browser login identifies you across your workspaces rather than binding to one project, and commands such astraces and evals are project-scoped, so pick a project first. An API key is already scoped to its project, so a key login can skip this step.
List the projects you can access to find your project ID:
TRACEROOT_PROJECT_ID so later commands need no extra flags, or pass --project <id> to individual commands:
Inspect and export traces
Once authenticated and scoped to a project, list, inspect, and export traces:Diagnose and add skills
doctor checks credentials, traceroot files, the repository, the environment, and the installed skills. setup doctor diagnoses a setup that didn’t complete. Both take --service <path> in a monorepo, and exit 1 when a check fails.
instrument writes a prompt for a coding agent to add traceroot, without editing your code. It takes --agent (claude, codex, or generic), --print to write the prompt to stdout, --output <path>, and --force to overwrite an existing prompt. setup is the usual route.
skills list shows the skills bundled with the CLI and where they’re installed. skills install copies one into an agent’s skill directory, and takes --agent, --force, and --dry-run to show what it would write. Coding agents lists the skills to use.
Command reference
Add--json to any command for machine-readable output, or run traceroot <command> --help for the full flag list.
The sql commands are documented in Read-only SQL.
Output and exit codes
Scripting and CI covers JSON output, exit codes, and the flags most commands share.Next steps
Each command group has its own page under Commands, starting with Traces.Authentication and Configuration
Which credential, project, and host the CLI uses.
Scripting and CI
JSON output, exit codes, and JSON request bodies.
Evaluations from the Terminal
Read datasets, evaluations, and past runs.
Troubleshoot setup
Fix a setup that stopped before the first trace.