CLI Reference
DiscoTrace ships a zero-dependency thin Python CLI (scripts/discotrace_cli.py) built directly over the OpenAPI v1 REST API. It requires only Python 3.10+ (standard library only) and outputs clean JSON for scripting, CI pipelines, and terminal workflows.
Setup & authentication
Section titled “Setup & authentication”Set your workspace API key in your environment (or pass --api-key on any command):
export DISCOTRACE_API_KEY="dt_live_your_key_here"# Optional: override portal URL for stagingexport DISCOTRACE_API_URL="https://app.discotrace.com"Run commands directly with python3 scripts/discotrace_cli.py <command> (or alias discotrace="python3 scripts/discotrace_cli.py").
Global flags
Section titled “Global flags”| Flag | Environment Variable | Default | Description |
|---|---|---|---|
--api-url |
DISCOTRACE_API_URL |
https://app.discotrace.com |
Portal base URL. |
--api-key |
DISCOTRACE_API_KEY |
(required) | Workspace API key (dt_live_... or dt_test_...). |
Commands
Section titled “Commands”| Command | Arguments & Flags | REST Endpoint |
|---|---|---|
me |
— | GET /api/v1/me |
credits |
— | GET /api/v1/credits |
studies |
— | GET /api/v1/studies |
study <slug> |
slug |
GET /api/v1/studies/{slug} |
traces <slug> |
--situation, --agent, --mode (named|live|shown|edit|article), --limit (default 25) |
GET /api/v1/studies/{slug}/traces |
reservations <slug> |
slug |
GET /api/v1/studies/{slug}/reservations |
drafts <slug> |
slug |
GET /api/v1/studies/{slug}/drafts |
estimate |
--roster (consumer|enterprise_frontier|enterprise_max), --cells (default 9), --precision (standard|high_precision), --scope (pass1_baseline|recheck_pass2|free_discovery), --shown-cells, --edit-tests |
POST /api/v1/credits/estimate |
jobs |
— | GET /api/v1/jobs |
run <slug> |
--kind (baseline_pass|recheck_pass|experiment_run|draft_refresh|free_discovery), --dry-run, --idempotency-key |
POST /api/v1/jobs |
Common examples
Section titled “Common examples”# 1. Inspect workspace identity, credit balance, and studiespython3 scripts/discotrace_cli.py mepython3 scripts/discotrace_cli.py creditspython3 scripts/discotrace_cli.py studies
# 2. Filter graded live-search traces for a specific AI surfacepython3 scripts/discotrace_cli.py traces core-discovery --mode live --agent claude --limit 10
# 3. Read coded buyer reservations and Content Center draftspython3 scripts/discotrace_cli.py reservations core-discoverypython3 scripts/discotrace_cli.py drafts core-discovery
# 4. Run a deterministic pre-flight credit quote for a 3x3 Pass 2 recheckpython3 scripts/discotrace_cli.py estimate --roster consumer --cells 9 --scope recheck_pass2
# 5. Queue a dry-run post-ship recheck safely with an idempotency keypython3 scripts/discotrace_cli.py run core-discovery \ --kind recheck_pass \ --dry-run \ --idempotency-key "ci-recheck-2026-11-29"Exit codes
Section titled “Exit codes”0— HTTP2xxresponse (including202 Acceptedwhen a job entersawaiting_approval).1— HTTP4xxor5xxAPI error (structured JSON printed tostdout).2— MissingDISCOTRACE_API_KEYor invalid CLI invocation.