phoenix/js/packages/phoenix-cli at main · Arize-ai/phoenix
GitHub
- Immediate Debugging: Fetch the most recent trace of a failed or unexpected run with a single command
- Bulk Export: Export large numbers of traces to JSON files for offline analysis or building evaluation datasets
- Terminal Workflows: Integrate trace data into your existing tools, piping output to Unix utilities like
jq - AI Coding Assistants: Use with Claude Code, Cursor, Windsurf, or other AI-powered tools to analyze agent traces
@arizeai/phoenix-cli is open-source! Issues and PRs welcome.
Installation
Quick Start
Environment Variables
| Variable | Description |
|---|---|
PHOENIX_HOST | Phoenix API endpoint (e.g., http://localhost:6006) |
PHOENIX_PROJECT | Project name or ID |
PHOENIX_API_KEY | API key for authentication (if required) |
PHOENIX_CLIENT_HEADERS | Custom headers as JSON string |
Commands
px projects
List all available projects.
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | Output format: pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
--limit <number> | Maximum projects to fetch per page | 100 |
px traces [directory]
Fetch recent traces from the configured project.
| Option | Description | Default |
|---|---|---|
[directory] | Save traces as JSON files to directory | stdout |
-n, --limit <number> | Number of traces to fetch (newest first) | 10 |
--last-n-minutes <number> | Only fetch traces from the last N minutes | — |
--since <timestamp> | Fetch traces since ISO timestamp | — |
--endpoint <url> | Phoenix API endpoint | From env |
--project <name> | Project name or ID | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress output | — |
--max-concurrent <number> | Maximum concurrent fetches | 10 |
px trace <trace-id>
Fetch a specific trace by ID.
| Option | Description | Default |
|---|---|---|
--file <path> | Save to file instead of stdout | stdout |
--format <format> | pretty, json, or raw | pretty |
--endpoint <url> | Phoenix API endpoint | From env |
--project <name> | Project name or ID | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
Output Formats
pretty (default) — Human-readable tree view:
json — Formatted JSON with indentation.
raw — Compact JSON for piping to jq or other tools.
JSON Structure
llm.model_name, llm.token_count.*, input.value, output.value, tool.name, and exception.*.
Examples
Debug failed traces
Find slowest traces
Extract LLM models used
Count errors
Use with AI Coding Assistants
Phoenix CLI is designed to work seamlessly with AI coding assistants like Claude Code, Cursor, and Windsurf.Claude Code
Ask Claude Code:px --help and fetch your traces for analysis.
Cursor / Windsurf
Run the CLI in the terminal and ask the AI to interpret:Related
Retrieve Traces via CLI
User guide for fetching traces from the command line
@arizeai/phoenix-client
TypeScript client for the Phoenix API

