CLI Commands
Command-line interface reference for the Traccia SDK.
The Traccia CLI manages configuration, checks connectivity, and runs eval gates. Python commands use traccia. TypeScript commands use traccia-ts. Pricing commands differ. Python uses traccia pricing status, traccia pricing refresh, and traccia pricing clear. TypeScript uses traccia-ts pricing:status, traccia-ts pricing:refresh, and traccia-ts pricing:clear.
Global Options
These options can be used with any command:
--config PATHPath to config file (default: ./traccia.toml or ~/.traccia/config.toml)
traccia config init
Initialize a new traccia.toml configuration file in the current directory with default values and helpful comments.
Usage
traccia config init [OPTIONS]Options
--forceOverwrite existing config file if present
Example
# Create traccia.toml in current directorytraccia config init
# Overwrite existing configtraccia config init --forceNext steps after init
- Edit the file to add your API key and endpoint
- Run
traccia doctorto validate - Run
traccia checkto test connectivity
traccia doctor
Validate your Traccia configuration and diagnose common issues. This command checks for config files, environment variables, validates configuration structure, and reports potential problems.
Usage
traccia doctor [OPTIONS]What it checks
Config file existence
Looks for traccia.toml in standard locations
Environment variables
Lists all set Traccia env vars
Configuration validity
Validates config structure and values
Exporter configuration
Ensures at least one exporter is enabled
Endpoint setup
Checks if OTLP endpoint is configured when needed
Rate limiting
Reports rate limiting settings if enabled
Example Output
๐ฉบ Running Traccia configuration diagnostics...
โ
Found config file: ./traccia.toml
๐ Environment variables: โ
TRACCIA_API_KEY is set
๐ Validating configuration...โ
Configuration is valid
๐ Configuration summary: โข API Key: โ
Set โข Endpoint: http://localhost:4318/v1/traces โข Sample Rate: 1.0 โข OTLP Exporter: โ
Enabled โข Console Exporter: โ Disabled โข File Exporter: โ Disabled โข Auto-patching: โ
Enabled
============================================================โ
No issues found! Your configuration looks good.
๐ก Tip: Run `traccia check` to test connectivity to your endpointExample
# Validate default configtraccia doctor
# Validate specific config filetraccia doctor --config /path/to/traccia.tomltraccia check
Test connectivity to your configured exporter endpoint. This command attempts to reach the endpoint and reports whether it's accessible.
Usage
traccia check [OPTIONS]Options
--endpoint URLOverride endpoint URL for this check (useful for testing different backends)
--api-key KEYAPI key for authentication (overrides config)
Examples
# Check configured endpointtraccia check
# Check specific endpointtraccia check --endpoint http://localhost:4318/v1/traces
# Check with custom API keytraccia check --api-key your-api-key-here
# Check production endpointtraccia check --endpoint https://api.traccia.ai/v2/traces --api-key prod-keyExpected responses
Exit Codes
0Success - endpoint is reachable1Failure - endpoint unreachable or configuration errortraccia pricing
Manage the local LLM pricing snapshot that the SDK uses to estimate costs at span-end time. The snapshot is stored in ~/.cache/traccia/pricing.json and resolves with higher priority than the bundled snapshot shipped inside the SDK wheel.
traccia pricing status
Show the current pricing source, its age in days, and the number of models in the active snapshot.
traccia pricing statusPricing snapshot status Source : local_cache File : /Users/you/.cache/traccia/pricing.json Age : 1 day(s) Models : 2547 Warning : NoneThe SDK emits a logger.info reminder when the snapshot is older than 7 days, and a logger.warning when older than 30 days.
traccia pricing refresh
Download the latest pricing and write it to the local cache. By default, the command tries the Traccia platform first (which maintains an up-to-date snapshot in sync with your org overrides), then falls back to the upstream open-source pricing database if the platform is unreachable.
Usage
traccia pricing refresh [--source upstream]Options
--source upstreamSkip the platform and fetch directly from the upstream LiteLLM pricing database. Useful when you do not have a Traccia account or want to bypass any org-level overrides. With no flag, the command tries the platform first, then the upstream source. --source platform is a parse error. TypeScript has no --source flag. Use traccia-ts pricing:refresh.
Examples
# Default: platform first, upstream fallbacktraccia pricing refresh
# Force upstream (skips platform, no account needed)traccia pricing refresh --source upstreamExample output
# First run โ new snapshot downloadedPricing updated from platform (2547 models)
# Subsequent run โ cached, no downloadPricing is already up to date (304 Not Modified)
# Platform unreachable โ fallback usedPlatform unreachable, falling back to upstream...Pricing updated from upstream (2547 models)ETag caching
If-None-Match on the next run. If pricing has not changed, the platform responds with HTTP 304 and no data is transferred.traccia pricing clear
Remove the local cache file. The SDK reverts to the bundled snapshot that ships inside the SDK wheel until you run traccia pricing refresh again.
traccia pricing clearLocal pricing cache cleared. SDK will use bundled snapshot.Pricing and the Traccia platform
traccia pricing refresh syncs the platform's current snapshot to your SDK so that llm.cost.usd (SDK-emitted) and platform_cost_usd (platform-recomputed) converge, but the platform will always recompute costs server-side regardless. See Platform Costs for the full picture.traccia eval
Run a task script against a saved dataset, store an experiment, and exit non-zero when a gate misses. TypeScript is traccia-ts eval. The walkthrough, exit codes, and GitHub Action are in Run Evals In CI.
Usage
traccia eval SCRIPT --output summary.json --dataset DATASET [--scorer NAME]...traccia-ts eval SCRIPT --output summary.json --dataset DATASET [--scorer NAME]...Required
SCRIPTPython file that defines task, or a TypeScript module that exports it. Local scorers live on scorers and are passed as local:name.
--output PATHSummary JSON. This file is the contract. The process exit code is the gate.
--dataset NAMEDataset name or id in the workspace for TRACCIA_API_KEY.
Gates
--scorer NAMERepeatable platform scorer, or local:name.
--informational NAMESelected scorer that skips the pass-rate bar. An error still fails the check.
--min-pass-rate RATEAbsolute bar from 0 to 1. With no bar, exit 0 is Execution Only.
--max-drop POINTSAllowed drop in percentage points. 0.05 means five points, not five percent. Needs one baseline. A local scorer cannot pass this bar.
--baseline-prompt NAME / --baseline-experiment IDPass one. Add --baseline-panel when the baseline has more than one panel.
--max-task-cost-increase RATIO, --max-judge-cost-increase RATIO, --max-latency-increase RATIORelative caps. 0.2 is 20 percent above the baseline. Incomplete cost or latency fails before the ratio is applied.
--allow-dataset-change, --allow-concurrency-mismatchThe dataset flag does not waive a change that happens during the run. The concurrency flag does not waive the latency cap.
--name TITLEReplaces the whole title. The default is the script name, or the dataset name when the file is task, eval, main, index, or run, followed by eval. When TRACCIA_GIT_HEAD_REF is set, the title adds ยท and the branch. Otherwise a pull request number adds ยท PR and that number.
--prompt NAMEStores that prompt on the experiment so promotion can attach the run. Requires --prompt-version or --prompt-label.
Exit codes
0 pass, 1 quality miss, 2 a bad command, a baseline that cannot be used, a script that will not load, or invalid TRACCIA_PROVIDER_KEYS, 3 untrustworthy evidence, including a task error and a task script that exits early, 4 the experiment did not save, 5 the summary file was not written, 130 the run was interrupted. Evidence is decided before a low score.
Prompt evidence is explicit
evaluate() in Python SDK 0.1.33 and TypeScript SDK 0.1.19 can still attach production when you pass a prompt name with no version or label, and it prints a deprecation warning. traccia eval requires --prompt-version or --prompt-label with --prompt.Environment Variables
Common environment variables recognized by the CLI and SDK:
TRACCIA_API_KEY or AGENT_DASHBOARD_API_KEYAPI key for authentication
TRACCIA_ENDPOINT or AGENT_DASHBOARD_ENDPOINTEndpoint URL for trace ingestion
TRACCIA_SAMPLE_RATESampling rate (0.0 to 1.0)
TRACCIA_ENABLE_METRICSEnable OpenTelemetry metrics emission (true/false)
TRACCIA_METRICS_ENDPOINTOTLP/HTTP endpoint for metrics (overrides config)
TRACCIA_DEBUGEnable debug logging (true/false)
TRACCIA_PROMPT_API_BASEOverride the prompt and eval API base. traccia eval uses this with TRACCIA_API_KEY.
TRACCIA_PROVIDER_KEYSJSON object of provider names to API keys for LLM-judge and Jev scorers. It overrides OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY or GOOGLE_API_KEY, GROQ_API_KEY, and TYPESAFE_API_KEY. Invalid JSON is exit 2. The keys are not written into the summary.
Set these from the job's own variables in any CI. The GitHub Action sets the same variables for you. The names are TRACCIA_GIT_CHECKOUT_SHA, TRACCIA_GIT_GITHUB_SHA, TRACCIA_GIT_HEAD_SHA, TRACCIA_GIT_HEAD_REF, TRACCIA_GIT_BASE_REF, TRACCIA_PR_NUMBER, TRACCIA_GIT_REPOSITORY, and TRACCIA_GIT_ACTOR.
For a complete list of environment variables, see the Configuration Reference.
Common Workflows
Setting up a new project
# 1. Install Tracciapip install traccia
# 2. Create config filetraccia config init
# 3. Edit traccia.toml to add your settings# (set endpoint, api_key, etc.)
# 4. Validate configurationtraccia doctor
# 5. Test connectivitytraccia checkDebugging connectivity issues
# Check your configurationtraccia doctor
# Test specific endpointstraccia check --endpoint http://localhost:4318/v1/tracestraccia check --endpoint https://api.traccia.ai/v2/traces
# Enable debug logging in your appexport TRACCIA_DEBUG=truepython your_app.pySwitching environments
# Development (local OTLP)export TRACCIA_ENDPOINT=http://localhost:4318/v1/tracesexport TRACCIA_DEBUG=truetraccia check
# Production (Traccia platform)export TRACCIA_ENDPOINT=https://api.traccia.ai/v2/tracesexport TRACCIA_API_KEY=your-production-keytraccia checkNext Steps
ยฉ 2026 Traccia.