feat(claude-cli): add local Claude Code CLI provider bridge

Spawn the local `claude` binary as a subprocess and expose it as an
Anthropic Messages-compatible provider. Hosted in brightstaff
(`CLAUDE_CLI_LISTEN_ADDR`), with session reuse, idle TTL, and watchdog.

User-facing surface is `model_providers: [{ model: claude-cli/* }]` —
the Python CLI auto-fills name/provider_interface/base_url/access_key
and the launcher (native + supervisord) enables the bridge listener
only when at least one claude-cli provider is present.
This commit is contained in:
Spherrrical 2026-05-04 12:57:53 -07:00
parent b71a555f19
commit 9fdfeb7cbf
26 changed files with 2847 additions and 2 deletions

View file

@ -0,0 +1,27 @@
version: v0.4.0
# Claude Code CLI as a Plano model_provider.
#
# The single line below is everything you need: Plano detects the
# `claude-cli/*` namespace, auto-fills the provider_interface, base_url and
# placeholder access_key, and starts a localhost bridge inside brightstaff
# that shells out to the `claude` binary on your $PATH for each request.
#
# Requirements:
# - `claude --version` must work in the same shell as `planoai up`.
# - Auth happens via the CLI's own `claude auth login` (no API key needed
# in Plano).
#
# Optional overrides via env (set before `planoai up`):
# CLAUDE_CLI_BIN=/custom/path/to/claude
# CLAUDE_CLI_PERMISSION_MODE=default
# CLAUDE_CLI_LISTEN_ADDR=127.0.0.1:14001
listeners:
- type: model
name: model_listener
port: 12000
model_providers:
- model: claude-cli/*
default: true