GitHub
Phoenix CLI is a command-line interface for your Phoenix projects. Fetch traces, list datasets, export experiment results, and access prompts directly from your terminal—or pipe them into AI coding agents like Claude Code, Codex, Cursor, and OpenCode.
You can use Phoenix CLI for:
- Immediate Debugging: Fetch the most recent trace of a failed or unexpected run with a single command
- Bulk Export: Export large numbers of traces or experiment results to JSON files for offline analysis
- Dataset & Experiment Access: List datasets and retrieve full experiment data including runs, evaluations, and trace IDs
- Prompt Introspection: View and export prompt templates for analysis, optimization, or use with other tools
- Terminal Workflows: Integrate trace and experiment 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 traces, experiments, and optimize prompts
Don’t see a use-case covered? @arizeai/phoenix-cli is open-source! Issues and PRs welcome.
Installation#
Or run directly with npx:
Quick Start#
Environment Variables#
| Variable | Description |
|---|---|
PHOENIX_ENDPOINT | 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 |
CLI flags take priority over environment variables.
Profiles#
A profile saves the endpoint, project, API key, and headers for a Phoenix instance under a name like prod or staging. Activate a profile and every px command picks up those settings without re-exporting environment variables. Environment variables and CLI flags still override the active profile, so existing scripts keep working.
px profile create <name>#
Create a new profile.
| Option | Description | Default |
|---|---|---|
<name> | Profile name (alphanumeric, hyphens, underscores) | — |
--endpoint <url> | Phoenix API endpoint | — |
--project <name> | Default project name | — |
--api-key <key> | Phoenix API key | — |
--header <key=value> | Custom HTTP header (repeatable) | — |
--activate | Make this the active profile after creation | Off |
px profile list#
List all profiles. The active profile is marked in a current column (kubectl-style).
| Option | Description | Default |
|---|---|---|
--format <format> | Output format: pretty, json, or raw | pretty |
px profile show [name]#
Show a profile (defaults to the active one).
| Option | Description | Default |
|---|---|---|
[name] | Profile name | active profile |
--format <format> | Output format: pretty, json, or raw | pretty |
px profile use <name>#
Set the active profile. Reports the transition (Switched active profile: staging → prod); a no-op if the profile is already active.
px profile edit <name>#
Open a profile in $PHOENIX_EDITOR if set, otherwise $EDITOR, falling back to vi. The CLI validates the JSON on save and re-opens the editor on validation failure. Edits are discarded if the editor exits non-zero.
px profile delete <name>#
Delete a profile. Deleting the active profile leaves no profile active — set a new one with px profile use <name>.
| Option | Description | Default |
|---|---|---|
--yes | Skip the confirmation prompt | — |
Editor autocomplete via JSON Schema#
@arizeai/phoenix-cli publishes a JSON Schema for the settings file. Add a $schema key to enable autocomplete and validation in editors that support JSON Schema:
Commands#
px setup#
Wire your app up to Phoenix. Run it from your app’s root directory. Setup establishes the connection (endpoint, project, auth) and saves it to a gitignored .env.phoenix file, then optionally hands a coding agent (Claude Code, Codex, Cursor, OpenCode) an instrumentation task and waits until a real trace arrives. After that it can point px at the new project and install Phoenix skills so the agent can query what you captured.
For CI or non-interactive agents, pass flags instead of answering prompts:
Setup’s definition of done is a trace the API confirmed arriving, not a completed hand-off, and the exit code says which happened:
| Exit | Meaning |
|---|---|
0 | Verified, registered only, or you chose “verify later” at the prompt |
6 | The wait ran out with no trace — tracing is not confirmed working |
Other codes follow the CLI-wide contract: 2 cancelled, 3 invalid flags, 4
auth, 5 unreachable endpoint. In --format json|raw, verification is
verified, notVerified, or deferred and is absent when there was nothing to
verify; tracesVerified is the boolean shorthand for verification == "verified". Don’t score a run on the hand-off agent’s own exit code — it may
edit the app correctly and then exit badly, or exit cleanly having delivered
nothing.
Re-run individual steps later with the subcommands:
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix API endpoint | From env |
--project <name> | Project name to target | From env |
--no-input | Never prompt; fail instead of asking (for CI/agents) | — |
--instrument / --no-instrument | Whether to hand instrumentation to a coding agent | Prompted |
--agent <agent> | Coding agent to hand off to: claude, codex, cursor, opencode | Prompted |
--language <lang...> | Language(s) to instrument (repeatable) | Detected |
--skills / --no-skills | Whether to install Phoenix coding-agent skills | Prompted |
--docs-mcp / --no-docs-mcp | Connect the Phoenix docs MCP server to the agent instead of downloading docs | Prompted |
--yolo | Let the agent run without per-step confirmation | — |
--format <format> | pretty, json, or raw | pretty |
px setup mcp#
Register the Phoenix remote MCP server (<endpoint>/mcp) with a coding agent, so it can search, query, and operate on your Phoenix data. The endpoint is inferred from --endpoint, the active profile, or PHOENIX_ENDPOINT — you never re-type it. See Remote MCP Server for what the server exposes.
Where an agent ships an mcp add (Claude, Codex, Gemini, VS Code global) the CLI drives it; the rest get a merge into their config file (~/.cursor/mcp.json, ~/.config/opencode/opencode.json, .vscode/mcp.json).
Auth defaults to OAuth — the config is URL-only and the agent opens Phoenix’s browser login on first use. For headless clients, pass an API-key bearer header with --header:
| Option | Description | Default |
|---|---|---|
--agent <agent> | Agent to configure: claude, codex, gemini, cursor, opencode, vscode | Prompted |
--global / --local | User-wide config, or this repo’s (Codex is global-only) | --global |
--endpoint <url> | Phoenix base URL (skips inference) | Inferred |
--profile <name> | Profile to infer the endpoint from | Active profile |
--header <header> | Name: value header for the API-key fallback (repeatable) | OAuth (none) |
--no-input | Headless mode; requires --agent and defaults scope to global | — |
--format <format> | pretty, json, or raw | pretty |
pxi#
Launch PXI (Phoenix Intelligence), the AI engineering agent, as an interactive terminal chat against a running Phoenix server. It is the same server-side agent that powers the in-browser assistant, so models, skills, and permissions are configured on the server. Inside the chat, tool calls render with a per-tool icon, a status glyph, and a short command excerpt, and slash commands (/help, /new, /temporary, /sessions, /model, /compact, /exit) are handled locally. See PXI for the full guide.
pxi requires a Phoenix server on 20.0.0 or newer and runs a preflight check against the server’s model catalog and credentials before the chat opens.
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix base URL | PHOENIX_ENDPOINT |
--api-key <key> | Phoenix API key | PHOENIX_API_KEY |
--profile <name> | Saved Phoenix CLI profile to read connection settings from | Active profile |
--provider <provider> | Built-in model provider (e.g. ANTHROPIC, OPENAI, GOOGLE) | ANTHROPIC |
--model <model> | Model name | claude-opus-5 |
--custom-provider-id <id> | Custom provider from Settings → Models (requires --model) | — |
--bypass-edits | Apply edits without manual approval | Manual approval |
--enable-web-access | Allow PXI to consult the web for grounding | Off |
--enable-subagents | Allow the server to attach subagents (including server-side bash) | Off |
--enable-graphql-mutations | Allow PXI to run state-changing GraphQL mutations | Off |
--ingest-traces | Persist this session’s PXI traces locally in Phoenix | Off |
--export-remote-traces | Export this session’s PXI traces to a configured remote collector | Off |
--attach-user-id | Attach the authenticated Phoenix user to PXI traces | Off |
--skip-model-preflight | Skip the model catalog and credential checks before launch | — |
px project list#
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 project get <name>#
Fetch a single project by exact name. Output is a single record (not an array). On a name miss, the command exits with a failure code and writes a structured error to stderr in --format json/raw.
| Option | Description | Default |
|---|---|---|
<name> | Exact project name | — |
--format <format> | pretty, json, or raw | pretty |
--limit <number> | Page size for the underlying lookup | 100 |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
px trace list [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 | — |
--include-annotations | Include trace and span annotations | — |
--include-notes | Include trace and span notes | — |
--max-concurrent <number> | Maximum concurrent fetches | 10 |
px trace get <trace-id>#
Fetch a specific trace by ID.
| Option | Description | Default |
|---|---|---|
--file <path> | Save to file instead of stdout | stdout |
--include-annotations | Include trace and span annotations | — |
--include-notes | Include trace and span notes | — |
--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 | — |
px trace annotate <trace-id>#
Create or update a trace annotation by OpenTelemetry trace ID. Passing --identifier upserts a specific annotation instance, so repeated calls with the same identifier overwrite rather than append — the key primitive for reversible, script-driven coding sessions.
| Option | Description | Default |
|---|---|---|
<trace-id> | OpenTelemetry trace ID | — |
--name <name> | Annotation name (what is being measured) | Required |
--label <label> | Categorical result (e.g. pass, fail) | — |
--score <number> | Numeric score | — |
--explanation <text> | Free-text justification | — |
--annotator-kind <kind> | HUMAN, LLM, or CODE | HUMAN |
--identifier <id> | Annotation identifier; repeated calls with the same value upsert in place | — |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
At least one of --label, --score, or --explanation is required.
px trace add-note <trace-id>#
Add a free-text note to a trace by OpenTelemetry trace ID. Notes are a reserved annotation type: a trace can carry multiple notes, and passing --identifier upserts a specific note instead of appending.
| Option | Description | Default |
|---|---|---|
<trace-id> | OpenTelemetry trace ID | — |
--text <text> | Note text to attach to the trace | Required |
--identifier <id> | Note identifier; repeated calls with the same value upsert in place | — |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
px trace-annotations delete#
Bulk-delete trace annotations for the configured project. Requires --all (delete every matching row) or both --start-time and --end-time to bound the delete to a [start_time, end_time) window — --name, --identifier, and --annotator-kind are narrowing filters and never authorize the request on their own. Deletes are disabled by default; set PHOENIX_CLI_DANGEROUSLY_ENABLE_DELETES=true first.
| Option | Description | Default |
|---|---|---|
--all | Delete every matching row (authorizes the request) | — |
--start-time <timestamp> | Start of the delete window (with --end-time, authorizes the request) | — |
--end-time <timestamp> | End of the delete window (exclusive) | — |
--name <name> | Narrow to annotations with this name | — |
--identifier <id> | Narrow to annotations with this identifier | — |
--annotator-kind <kind> | Narrow to HUMAN, LLM, or CODE | — |
-y, --yes | Skip the confirmation prompt | — |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
Set PHOENIX_CLI_DANGEROUSLY_ENABLE_DELETES=true to enable this command.
px span list [file]#
Fetch individual spans from the configured project with comprehensive filtering.
| Option | Description | Default |
|---|---|---|
[file] | Save spans as JSON to file | stdout |
-n, --limit <number> | Maximum spans to fetch (newest first) | 100 |
--last-n-minutes <number> | Only fetch spans from the last N minutes | — |
--since <timestamp> | Fetch spans since ISO timestamp | — |
--span-kind <kinds...> | Filter by span kind (LLM, CHAIN, TOOL, RETRIEVER, EMBEDDING, AGENT, RERANKER, GUARDRAIL, EVALUATOR, DECISION, UNKNOWN) | — |
--status-code <codes...> | Filter by status code (OK, ERROR, UNSET) | — |
--name <names...> | Filter by span name(s) | — |
--trace-id <ids...> | Filter by trace ID(s) | — |
--parent-id <id> | Filter by parent span ID (use "null" for root spans) | — |
--attribute <filters...> | Filter by attribute key-value pairs. Format: key:value. Repeat to AND multiple filters. Values containing colons are supported (split on first : only). To match a string attribute that looks like a number or boolean, JSON-quote the value (e.g., 'user.id:"12345"'). Requires Phoenix server ≥ 14.9.0. | — |
--include-annotations | Include span annotations in output | Off |
--include-notes | Include span notes in output | Off |
--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 indicators | — |
px span annotate <span-id>#
Create or update a span annotation by OpenTelemetry span ID. As with px trace annotate, passing --identifier upserts a specific annotation instance so repeated calls overwrite rather than append.
| Option | Description | Default |
|---|---|---|
<span-id> | OpenTelemetry span ID | — |
--name <name> | Annotation name (what is being measured) | Required |
--label <label> | Categorical result (e.g. pass, fail) | — |
--score <number> | Numeric score | — |
--explanation <text> | Free-text justification | — |
--annotator-kind <kind> | HUMAN, LLM, or CODE | HUMAN |
--identifier <id> | Annotation identifier; repeated calls with the same value upsert in place | — |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
At least one of --label, --score, or --explanation is required.
px span add-note <span-id>#
Notes are a reserved annotation type. Unlike other annotations, notes are open-ended and multiple notes can be attached to the same span. Passing --identifier upserts a specific note instead of appending.
| Option | Description | Default |
|---|---|---|
<span-id> | OpenTelemetry span ID | — |
--text <text> | Note text to attach to the span | Required |
--identifier <id> | Note identifier; repeated calls with the same value upsert in place | — |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
px span-annotations delete#
Bulk-delete span annotations for the configured project. Same authorization gate as px trace-annotations delete — requires --all or both --start-time and --end-time, with --name/--identifier/--annotator-kind as narrowing filters. Set PHOENIX_CLI_DANGEROUSLY_ENABLE_DELETES=true to enable it.
Accepts the same options as px trace-annotations delete.
px session list#
List sessions (multi-turn conversations) for a project.
| Option | Description | Default |
|---|---|---|
-n, --limit <number> | Maximum number of sessions to return | 10 |
--order <order> | Sort order: asc or desc | desc |
--include-annotations | Include session annotations, excluding notes | — |
--include-notes | Include session notes when present | — |
--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 indicators | — |
px session get <session-id>#
View a session’s conversation flow, including all traces (turns) in the session.
| Option | Description | Default |
|---|---|---|
--include-annotations | Include session annotations, excluding notes | Off |
--include-notes | Include session notes when present | Off |
--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 | — |
px session annotate <session-id>#
Add or update an annotation on a session. Address the session by GlobalID or by user-provided session_id.
| Option | Description | Default |
|---|---|---|
--name <name> | Annotation name (what is being measured) | Required |
--label <label> | Categorical result (e.g. pass, fail) | — |
--score <number> | Numeric score | — |
--explanation <text> | Free-text justification | — |
--annotator-kind <kind> | HUMAN, LLM, or CODE | HUMAN |
--identifier <id> | Annotation identifier; repeated calls with the same value upsert in place | — |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
At least one of --label, --score, or --explanation is required.
px session add-note <session-id>#
Add a free-text note to a session. Address the session by GlobalID or by user-provided session_id. A session can carry multiple notes; passing --identifier upserts a specific note instead of appending. Requires Phoenix server >= 14.17.0.
| Option | Description | Default |
|---|---|---|
--text <text> | Note text to add | Required |
--identifier <id> | Note identifier; repeated calls with the same value upsert in place | — |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
px session-annotations delete#
Bulk-delete session annotations for the configured project. Same authorization gate as the trace and span equivalents — requires --all or both --start-time and --end-time. Set PHOENIX_CLI_DANGEROUSLY_ENABLE_DELETES=true to enable it.
Accepts the same options as px trace-annotations delete.
px dataset list#
List all available datasets.
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
--limit <number> | Maximum number of datasets | — |
px dataset get <dataset-identifier>#
Fetch examples from a dataset.
| Option | Description | Default |
|---|---|---|
--split <name> | Filter by split (can be used repeatedly) | — |
--version <id> | Fetch from specific dataset version | latest |
--file <path> | Save to file instead of stdout | stdout |
--format <format> | pretty, json, or raw | pretty |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
px experiment list --dataset <name-or-id>#
List experiments for a dataset, optionally exporting full data to files.
| Option | Description | Default |
|---|---|---|
--dataset <name-or-id> | Dataset name or ID (required) | — |
[directory] | Export experiment JSON files to directory | stdout |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
--limit <number> | Maximum number of experiments | — |
px experiment get <experiment-id>#
Fetch a single experiment with all run data, including inputs, outputs, evaluations, and trace IDs.
| 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 |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
px prompt list#
List all available prompts.
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--format <format> | pretty, json, or raw | pretty |
--no-progress | Disable progress indicators | — |
--limit <number> | Maximum number of prompts | — |
px prompt get <prompt_identifier>#
Show a Phoenix prompt.
Supports multiple output formats including a text format optimized for piping to AI coding assistants.
| Option | Description | Default |
|---|---|---|
--tag <name> | Get prompt version by tag name | — |
--version <id> | Get specific prompt version by ID | latest |
--format <format> | pretty, json, raw, or text | pretty |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
The text format outputs prompt content with XML-style role tags, ideal for piping to AI assistants:
px annotation-config list#
List annotation configurations defined in your Phoenix instance.
| Option | Description | Default |
|---|---|---|
--format <format> | pretty, json, or raw | pretty |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
--limit <number> | Maximum number of configs | — |
px annotation-config get <config-identifier>#
Fetch a single annotation configuration by name or ID.
| Option | Description | Default |
|---|---|---|
--format <format> | pretty, json, or raw | pretty |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
px annotation-config create#
Create a new annotation configuration via POST /v1/annotation_configs. Configs come in three types: CATEGORICAL (a fixed set of labels, each with an optional numeric score), CONTINUOUS (a numeric range), and FREEFORM (free text).
| Option | Description | Default |
|---|---|---|
--type <type> | CATEGORICAL, CONTINUOUS, or FREEFORM (required) | — |
--name <name> | Annotation config name (required) | — |
--description <description> | Description | — |
--optimization-direction <dir> | MINIMIZE, MAXIMIZE, or NONE | NONE |
--value <label[=score]> | Categorical label (repeatable; CATEGORICAL configs) | — |
--values <json> | Categorical values as JSON (CATEGORICAL configs) | — |
--lower-bound <number> | Lower bound (CONTINUOUS/FREEFORM configs) | — |
--upper-bound <number> | Upper bound (CONTINUOUS/FREEFORM configs) | — |
--threshold <number> | Threshold (FREEFORM configs) | — |
--format <format> | pretty, json, or raw | pretty |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
--value and --values are mutually exclusive. --type and --optimization-direction are case-insensitive. Invalid input — including flags that don’t apply to the chosen type — exits with INVALID_ARGUMENT.
px annotation-config update <config-identifier>#
Update an annotation configuration by name or ID. Only the fields you pass are changed — the command fetches the existing config, merges your flags, and writes the result back via PUT /v1/annotation_configs/{id}. The config type is immutable; to change it, delete and recreate the config.
| Option | Description | Default |
|---|---|---|
--name <name> | New name | — |
--description <description> | New description | — |
--optimization-direction <dir> | MINIMIZE, MAXIMIZE, or NONE | — |
--value <label[=score]> | Categorical label (repeatable; CATEGORICAL configs) | — |
--values <json> | Categorical values as JSON (CATEGORICAL configs) | — |
--lower-bound <number> | Lower bound (CONTINUOUS/FREEFORM configs) | — |
--upper-bound <number> | Upper bound (CONTINUOUS/FREEFORM configs) | — |
--threshold <number> | Threshold (FREEFORM configs) | — |
--format <format> | pretty, json, or raw | pretty |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
At least one field flag is required. Invalid input — including flags that don’t apply to the config’s type — exits with INVALID_ARGUMENT.
px annotation-config delete <config-id>#
Delete an annotation configuration by ID. Like all delete commands, this is disabled unless PHOENIX_CLI_DANGEROUSLY_ENABLE_DELETES=true is set, and prompts for confirmation unless --yes is passed.
| Option | Description | Default |
|---|---|---|
-y, --yes | Skip confirmation prompt | — |
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--no-progress | Disable progress indicators | — |
px auth login#
Log in with the browser-based OAuth flow and store tokens on the selected profile. The login URL is always printed to stderr, so SSH and headless users can open it manually. OAuth CLI sessions act with the permissions of the user who logged in, and the CLI refreshes expiring access tokens automatically for REST, GraphQL, and PXI requests.
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix API endpoint | From env/profile |
--api-key <key> | Phoenix API key | From env |
--profile <name> | Profile to store OAuth tokens in | Active profile |
--no-browser | Print the login URL without opening a browser | — |
--no-input | Do not prompt for a pasted redirect URL | — |
--format <format> | pretty, json, or raw | pretty |
The command pre-flights the server’s OAuth authorization server before opening a browser, so it fails cleanly when the server is unreachable or does not run the OAuth authorization server. If the target profile also has an API key, the key takes precedence over the OAuth session until it is removed.
px auth logout#
Clear OAuth tokens from the selected profile. Logout best-effort revokes the refresh token on the server (against the endpoint that issued the tokens) and leaves any configured API key untouched.
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--profile <name> | Profile to clear OAuth tokens from | Active profile |
--format <format> | pretty, json, or raw | pretty |
px auth status#
Show the current Phoenix authentication status, including the configured endpoint, credential source, identity, and OAuth access level/expiry when applicable.
| Option | Description | Default |
|---|---|---|
--endpoint <url> | Phoenix API endpoint | From env |
--api-key <key> | Phoenix API key | From env |
--profile <name> | Profile to use | Active profile |
--format <format> | pretty, json, or raw | pretty |
px api graphql <query>#
Make authenticated GraphQL queries against the Phoenix API. Output is {"data": {...}} JSON — pipe with jq '.data.<field>' to extract values. Only queries are permitted; mutations and subscriptions are rejected before hitting the server.
| Argument/Option | Description | Default |
|---|---|---|
<query> | GraphQL query string | — |
--endpoint <url> | Phoenix API endpoint | $PHOENIX_ENDPOINT |
--api-key <key> | Phoenix API key | $PHOENIX_API_KEY |
Discover the schema with introspection#
Use introspection to explore what fields and types are available without leaving your terminal:
Projects#
Available fields: id, name, traceCount, recordCount, tokenCountTotal, tokenCountPrompt, tokenCountCompletion, createdAt, updatedAt.
Datasets#
Available fields: id, name, description, exampleCount, experimentCount, evaluatorCount, createdAt, updatedAt.
Experiments#
Experiments are nested under datasets in the GraphQL schema:
To inspect individual run outputs, errors, and trace IDs:
Available run fields: traceId, output, error, latencyMs, startTime, endTime.
Evaluators#
Instance summary#
┌─ Trace: abc123def456 │ │ Input: What is the weather in San Francisco? │ Output: The weather is currently sunny… │ │ Spans: │ └─ ✓ agent_run (CHAIN) - 1250ms │ ├─ ✓ llm_call (LLM) - 800ms │ └─ ✓ tool_execution (TOOL) - 400ms └─
Spans include OpenInference semantic attributes like llm.model_name, llm.token_count.*, input.value, output.value, tool.name, and exception.*.
Examples#
Debug failed traces#
Find slowest traces#
Find errored spans#
Inspect LLM spans with annotations#
Extract LLM models used#
Count errors#
List datasets and experiments#
Analyze experiment results#
Work with prompts#
Query the GraphQL API directly#
Use with AI Coding Assistants#
The Phoenix CLI pairs well with AI coding assistants like Claude Code, Cursor, and Windsurf. For hands-off access, connect an agent to Phoenix once with px setup mcp or install Phoenix skills; the examples below drive the CLI directly instead.
Claude Code#
Ask Claude Code:
Claude Code will discover the CLI via px --help and fetch your traces for analysis.
Prompt Optimization with Claude Code#
Pipe your Phoenix prompts directly to Claude Code for analysis and optimization suggestions:
You can also ask Claude Code to work with your prompts interactively:
Cursor / Windsurf#
Run the CLI in the terminal and ask the AI to interpret:
For prompt work:
Related#
License#
Apache 2.0

