mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
- Add custom_agents.rs: Load agents from ~/.hanzo/agents, ~/.claude/agents, ~/work/hanzo/agents/agents - Support YAML frontmatter in .md files and .json agent configs - Add /use and /agent slash commands to switch personas - Add /python, /typescript, /rust, /go language-specific commands - Add vibe and copilot agent backends - Support HANZO_AGENTS_PATH env var for custom directories Agents: python, typescript, rust, go (first-class language support) Compatible with Claude Code ~/.claude/agents format
Claude CLI to OpenAI-compatible API Proxy
This proxy enables @hanzo/dev (and other OpenAI-compatible clients) to use your authenticated Claude Hanzo Dev CLI as a backend, without needing API keys.
How It Works
┌─────────────┐ HTTP/JSON ┌─────────────┐ stdin/stdout ┌─────────────┐
│ @hanzo/dev │ ─────────────────► │ Proxy │ ──────────────────► │ Claude CLI │
│ CLI │ ◄───────────────── │ :9999 │ ◄────────────────── │ (claude) │
└─────────────┘ OpenAI-compat └─────────────┘ text └─────────────┘
Quick Start
1. Start the Proxy
cd ~/work/hanzo/dev/cli-proxy
PORT=9999 node claude-proxy.js
2. Configure @hanzo/dev
Add to ~/.hanzo/config.toml:
model_provider = "claude-cli"
model = "claude-cli"
[model_providers.claude-cli]
name = "Claude CLI"
base_url = "http://localhost:9999/v1"
wire_api = "chat"
3. Use @hanzo/dev
# Interactive mode
dev
# Exec mode
echo "What is 2+2?" | dev exec --full-auto
Testing
Direct proxy test with curl:
curl -s http://localhost:9999/v1/chat/completions \
-X POST \
-H "Content-Type: application/json" \
-d '{"model":"claude-cli","messages":[{"role":"user","content":"What is 2+2?"}]}' \
| jq .
Expected response:
{
"choices": [{
"message": {
"role": "assistant",
"content": "4"
}
}]
}
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/v1/models |
GET | List available models |
/v1/chat/completions |
POST | Chat completions (main endpoint) |
Model Mapping
| Request Model | Claude Model |
|---|---|
claude-cli |
Default (Sonnet) |
claude-opus |
claude-opus-4-5-20251101 |
claude-sonnet |
claude-sonnet-4-20250514 |
claude-haiku |
claude-haiku-4-5-20251001 |
gpt-4* |
Default |
Features
- Zero API Keys: Uses your authenticated Claude Hanzo Dev CLI
- OpenAI Compatible: Works with any OpenAI-compatible client
- Multi-Message Support: Handles system/user/assistant roles
- Telemetry Filtering: Cleans JSON artifacts from CLI output
- CORS Enabled: Works with browser-based clients
Requirements
- Node.js 16+
- Claude Hanzo Dev CLI installed and authenticated (
claude --version)
Troubleshooting
Port Already in Use
PORT=8080 node claude-proxy.js # Use different port
Claude CLI Not Found
Ensure Claude Hanzo Dev CLI is installed:
npm install -g @anthropic-ai/claude-dev
claude auth login
Testing the Integration
Run the integration test:
./test-integration.sh
License
MIT - Part of the @hanzo/dev CLI orchestration project.