feat: add Claude Code CLI as LLM provider#10
Open
Steve wants to merge 1 commit into
Open
Conversation
Users with a Claude Pro/Max subscription but no API key can now use Phoenix code generation via the `claude` CLI. The provider auto-detects when the CLI is available and falls back to it when no ANTHROPIC_API_KEY or OPENAI_API_KEY is set. - New `ClaudeCliProvider` in `src/llm/claude-cli.ts` pipes prompts via stdin to `claude -p` with `--system-prompt` for system messages - Provider resolution auto-detects `claude` CLI as third-priority fallback - Also adds missing `@types/node` dev dependency needed for build Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Steve
pushed a commit
to collectiveleap/phoenix
that referenced
this pull request
Jun 7, 2026
Implements the OBSERVABILITY-HARNESS-OUTCOMES acceptance criteria so the spec→app pipeline runs unattended and is diagnosable in seconds. Spine (O1/O2/O8): per-call RunJournal (.phoenix/runs/<id>), streaming provider interface (claude-cli via spawn, anthropic/openai via SSE) with TTFB + byte counting, wall-clock watchdog + caffeinate keep-awake that distinguishes startup-stall / stream-stall / returned-then-wedged. Honesty (O3–O7,O10): typechecker probe (missing tool ≠ type errors, zero phantom repairs), canonicalization reports the mode that actually ran + per-clause classification reasons, provider/config resolution with source and conflict warnings, tracked scaffold writer that preserves hand-edits, plan inspection with heading→module mapping and oversize flags. Controller (O9,O11–O16): preflight gate, pid run-lock + signal teardown + detached process-group kill, config-driven policy + `run --dry-run`, acceptance gate (typecheck + boot + 200), content-addressed resume, and `phoenix run`/`runs` supervisor with a live status surface. New CLI: run, runs, preflight. Regression suite covers appendix chad#1–chad#10. 468 tests pass (49 new); tsc clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude-cliLLM provider that uses theclaudeCLI (claude -p) for code generationphoenix bootstrapwithout needing a separate API key — the provider auto-detects the authenticated CLIMotivation
The quick start requires an
ANTHROPIC_API_KEYorOPENAI_API_KEY, but many Claude users have a Pro/Max subscription that doesn't include API access. This removes that friction — ifclaudeCLI is installed and authenticated, code generation just works.Changes
src/llm/claude-cli.ts(new):ClaudeCliProviderimplementing theLLMProviderinterface. Pipes prompts via stdin toclaude -pwith--system-promptfor system messages.src/llm/resolve.ts: Auto-detectsclaudeCLI as third-priority fallback after Anthropic and OpenAI API keyssrc/llm/provider.ts: Addsclaude-clitoDEFAULT_MODELSpackage.json: Adds missing@types/nodedev dependencyTest plan
claude -pworks with stdin piping and--system-promptphoenix bootstraponexamples/todo-app— all 3 IUs generated real code (not stubs)localhost:3000🤖 Generated with Claude Code