Skip to content

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.

Set your workspace API key in your environment (or pass --api-key on any command):

Terminal window
export DISCOTRACE_API_KEY="dt_live_your_key_here"
# Optional: override portal URL for staging
export 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").

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_...).
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
Terminal window
# 1. Inspect workspace identity, credit balance, and studies
python3 scripts/discotrace_cli.py me
python3 scripts/discotrace_cli.py credits
python3 scripts/discotrace_cli.py studies
# 2. Filter graded live-search traces for a specific AI surface
python3 scripts/discotrace_cli.py traces core-discovery --mode live --agent claude --limit 10
# 3. Read coded buyer reservations and Content Center drafts
python3 scripts/discotrace_cli.py reservations core-discovery
python3 scripts/discotrace_cli.py drafts core-discovery
# 4. Run a deterministic pre-flight credit quote for a 3x3 Pass 2 recheck
python3 scripts/discotrace_cli.py estimate --roster consumer --cells 9 --scope recheck_pass2
# 5. Queue a dry-run post-ship recheck safely with an idempotency key
python3 scripts/discotrace_cli.py run core-discovery \
--kind recheck_pass \
--dry-run \
--idempotency-key "ci-recheck-2026-11-29"
  • 0 — HTTP 2xx response (including 202 Accepted when a job enters awaiting_approval).
  • 1 — HTTP 4xx or 5xx API error (structured JSON printed to stdout).
  • 2 — Missing DISCOTRACE_API_KEY or invalid CLI invocation.