CLI
Install and use the Retrace command-line interface to manage traces, forks, evaluations, and more.
Installation
Run the install script — it automatically detects your OS and architecture:
curl -fsSL https://retraceai.tech/install.sh | shSupports:
- macOS (Apple Silicon M1/M2/M3/M4, Intel)
- Linux (x86_64, ARM64)
- Windows (x86_64)
Manual Installation
If you prefer to download manually:
| Platform | Download |
|---|---|
| macOS Apple Silicon | curl -fsSL https://retrace-api.sfo3.cdn.digitaloceanspaces.com/cli/latest/retrace-darwin-aarch64 -o retrace |
| macOS Intel | curl -fsSL https://retrace-api.sfo3.cdn.digitaloceanspaces.com/cli/latest/retrace-darwin-x86_64 -o retrace |
| Linux x86_64 | curl -fsSL https://retrace-api.sfo3.cdn.digitaloceanspaces.com/cli/latest/retrace-linux-x86_64 -o retrace |
| Linux ARM64 | curl -fsSL https://retrace-api.sfo3.cdn.digitaloceanspaces.com/cli/latest/retrace-linux-aarch64 -o retrace |
| Windows x86_64 | curl -fsSL https://retrace-api.sfo3.cdn.digitaloceanspaces.com/cli/latest/retrace-windows-x86_64.exe -o retrace.exe |
After downloading manually, make it executable and move to your PATH:
chmod +x retrace && sudo mv retrace /usr/local/bin/Verify the installation:
retrace versionAuthentication
The CLI supports three authentication methods:
API Key
retrace auth login --key rt_live_your_key_hereGet your API key from Settings.
Browser Login (Device Flow)
retrace auth loginThis opens your browser and displays a code. Enter the code at the URL shown to authorize the CLI. Credentials are stored securely in your OS keyring (macOS Keychain, Windows Credential Manager, or Linux Secret Service).
Environment Variable (CI/CD)
export RETRACE_API_KEY=rt_live_your_key_here
retrace traces listThe environment variable takes priority over stored credentials.
Session Management
retrace auth whoami # Show authenticated user, email, plan
retrace auth status # Show auth method, API URL, session expiry
retrace auth logout # Clear all stored credentialsTraces
# List recent traces
retrace traces list
retrace traces list --limit 50 --status completed
retrace traces list --project <project_id> --json
# Inspect a trace
retrace traces get <trace_id>
retrace traces get <trace_id> --spans # Include span details
retrace traces get <trace_id> --json # Machine-readable output
# Delete a trace
retrace traces delete <trace_id> --forceForks
# Create a fork from a specific span
retrace forks create --trace <trace_id> --span <span_id> --input "modified prompt"
# Replay a fork (re-execute the agent)
retrace forks replay <fork_id>
retrace forks replay <fork_id> --wait # Wait for completion
# Compare original vs fork
retrace forks diff <fork_id>
retrace forks diff <fork_id> --jsonEvaluations
# Run an evaluation on one or more traces
retrace eval run --evaluation <eval_id> --traces <trace_id_1>,<trace_id_2>
# CI/CD quality gate
# Exits with code 0 if score >= threshold, code 1 if below
retrace eval gate --evaluation <eval_id> --trace <trace_id> --threshold 0.8CI/CD Integration
# GitHub Actions example
- name: Quality Gate
run: retrace eval gate --evaluation $EVAL_ID --trace $TRACE_ID --threshold 0.8
env:
RETRACE_API_KEY: ${{ secrets.RETRACE_API_KEY }}Tapes
# List your published tapes
retrace tapes list
retrace tapes list --json
# Publish a trace as a shareable tape
retrace tapes publish --trace <trace_id>
retrace tapes publish --trace <trace_id> --title "My Agent Run"Search
# Semantic search across all traces and spans
retrace search "error in payment processing"
retrace search "timeout" --limit 20
retrace search "user authentication" --jsonConfiguration
# Show current configuration
retrace config show
# Set configuration values
retrace config set api_url https://api.retraceai.tech
retrace config set output json # table | json | plain
retrace config set project_id <id>Configuration is stored in ~/.retrace/config.toml.
Self-Update
# Update to the latest version
retrace update
# Check for updates without installing
retrace update --checkLive Streaming
# Stream spans in real-time (WebSocket)
retrace traces tail
# Filter by span type
retrace traces tail --span-type llm_call
# Filter by trace name
retrace traces tail --name "my-agent"Watch Mode
# Auto-refresh traces list every 5 seconds
retrace traces list --watch 5
# Watch mode works on all list commands
retrace tapes list --watch 10
retrace sessions list --watch 5
retrace guardrails list --watch 30Interactive TUI
# Browse trace spans in a full-screen terminal UI
retrace traces get <id> --interactive
# Navigate with arrow keys, q to quitBulk Operations
# Preview traces matching filters
retrace traces bulk-delete --status failed
# Delete all failed traces (requires --force)
retrace traces bulk-delete --status failed --force
# Filter by name pattern
retrace traces bulk-delete --name "test-" --forceOutput Formats
All list/get commands support --json for machine-readable output:
# Pretty table (default)
retrace traces list
# JSON output (for scripting)
retrace traces list --json | jq '.[].name'