{"id":29806326,"url":"https://github.com/Davincible/claude-code-open","last_synced_at":"2025-07-28T14:08:06.615Z","repository":{"id":305996583,"uuid":"1024596185","full_name":"Davincible/claude-code-open","owner":"Davincible","description":"Claude Code with any LLM provider (OpenRouter, Gemini, Kimi K2)","archived":false,"fork":false,"pushed_at":"2025-07-23T04:23:10.000Z","size":506,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-23T05:23:06.277Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Davincible.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-23T00:51:09.000Z","updated_at":"2025-07-23T05:14:23.000Z","dependencies_parsed_at":"2025-07-23T05:23:30.712Z","dependency_job_id":"f5b1a95d-9f5f-4d44-ba94-9ed7c4b614aa","html_url":"https://github.com/Davincible/claude-code-open","commit_stats":null,"previous_names":["davincible/claude-code-open"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Davincible/claude-code-open","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davincible%2Fclaude-code-open","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davincible%2Fclaude-code-open/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davincible%2Fclaude-code-open/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davincible%2Fclaude-code-open/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Davincible","download_url":"https://codeload.github.com/Davincible/claude-code-open/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Davincible%2Fclaude-code-open/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267527835,"owners_count":24102019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-28T14:05:57.251Z","updated_at":"2025-07-28T14:08:06.597Z","avatar_url":"https://github.com/Davincible.png","language":"Go","readme":"\u003cdiv align=\"center\"\u003e\n\n# 🚀 Claude Code Open\n\n*A universal LLM proxy that connects Claude Code to any language model provider*\n\n[![Go Version](https://img.shields.io/github/go-mod/go-version/Davincible/claude-code-open)](https://golang.org)\n[![License](https://img.shields.io/github/license/Davincible/claude-code-open)](LICENSE)\n[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)]()\n\n**Production-ready LLM proxy server** that converts requests from various LLM providers to Anthropic's Claude API format. Built with Go for high performance and reliability.\n\nAs simple as `CCO_API_KEY=\"\u003copenrouter key\u003e\" cco code` and then selecting `openrouter,qwen/qwen3-coder` as model and voila\n\n---\n\n*Inspired by [Claude Code Router](https://github.com/musistudio/claude-code-router) but rebuilt from the ground up to actually work reliably.*\n\n\u003c/div\u003e\n\n## ✨ Features\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n### 🌐 Multi-Provider Support\n- **OpenRouter** - Multiple models from different providers\n- **OpenAI** - Direct GPT model access\n- **Anthropic** - Native Claude model support\n- **NVIDIA** - Nemotron models via API\n- **Google Gemini** - Gemini model family\n\n### ⚡ Zero-Config Setup\n- Run with just `CCO_API_KEY` environment variable\n- No configuration file required to get started\n- Smart defaults for all providers\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n### 🔧 Advanced Configuration\n- **YAML Configuration** with automatic defaults\n- **Model Whitelisting** with pattern matching\n- **Dynamic Model Selection** using comma notation\n- **API Key Protection** for enhanced security\n\n### 🔄 Smart Request Handling\n- **Dynamic Request Transformation** between formats\n- **Automatic Provider Detection** and routing\n- **Streaming Support** for all providers\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## 🚀 Quick Start\n\n\u003e **💡 Note**: When installed with `go install`, the binary is named `claude-code-open`. Throughout this documentation, you can substitute `cco` with `claude-code-open` or create an alias as shown in the installation section.\n\n### 📦 Installation\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e📥 Option 1: Install with Go (Recommended)\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\nThe easiest way to install is using Go's built-in installer:\n\n```bash\n# Install directly from GitHub\ngo install github.com/Davincible/claude-code-open@latest\n\n# The binary will be installed as 'claude-code-open' in $(go env GOBIN) or $(go env GOPATH)/bin\n# Create an alias for shorter command (optional)\necho 'alias cco=\"claude-code-open\"' \u003e\u003e ~/.bashrc  # or ~/.zshrc\nsource ~/.bashrc  # or ~/.zshrc\n\n# Or create a symlink (Linux/macOS) - handles both GOBIN and GOPATH\nGOBIN_DIR=$(go env GOBIN)\nif [ -z \"$GOBIN_DIR\" ]; then\n    GOBIN_DIR=\"$(go env GOPATH)/bin\"\nfi\nsudo ln -s \"$GOBIN_DIR/claude-code-open\" /usr/local/bin/cco\n\n# One-liner version:\n# sudo ln -s \"$([ -n \"$(go env GOBIN)\" ] \u0026\u0026 go env GOBIN || echo \"$(go env GOPATH)/bin\")/claude-code-open\" /usr/local/bin/cco\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🔨 Option 2: Build from Source\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\n```bash\n# Clone the repository\ngit clone https://github.com/Davincible/claude-code-open\ncd claude-code-open\n\n# Build with Make (creates 'cco' binary)\nmake build\nsudo make install  # Install to /usr/local/bin\n\n# Or build manually\ngo build -o cco .\nsudo mv cco /usr/local/bin/\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e⚙️ Option 3: Install with Custom Binary Name\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\n```bash\n# Install with go install and create symlink using Go environment\ngo install github.com/Davincible/claude-code-open@latest\nGOBIN_DIR=$(go env GOBIN); [ -z \"$GOBIN_DIR\" ] \u0026\u0026 GOBIN_DIR=\"$(go env GOPATH)/bin\"\nsudo ln -sf \"$GOBIN_DIR/claude-code-open\" /usr/local/bin/cco\n\n# Or use go install with custom GOBIN (if you have write permissions)\nGOBIN=/usr/local/bin go install github.com/Davincible/claude-code-open@latest\nsudo mv /usr/local/bin/claude-code-open /usr/local/bin/cco\n\n# Or install to a custom directory you own\nmkdir -p ~/.local/bin\nGOBIN=~/.local/bin go install github.com/Davincible/claude-code-open@latest\nln -sf ~/.local/bin/claude-code-open ~/.local/bin/cco\n# Add ~/.local/bin to PATH if not already there\necho 'export PATH=\"$HOME/.local/bin:$PATH\"' \u003e\u003e ~/.bashrc\n```\n\n\u003c/details\u003e\n\n---\n\n### 🔑 Quick Start with CCO_API_KEY\n\nFor the fastest setup, you can run without any configuration file using just the `CCO_API_KEY` environment variable:\n\n```bash\n# Set your API key (works with any provider)\n# This is the API key of the provider you want to use, can be any one of the supported providers\n# Then in Claude Code you set the model with \u003cprovider\u003e,\u003cmodel name\u003e e.g. openrouter,moonshotai/kimi-k2\nexport CCO_API_KEY=\"your-api-key-here\"\n\n# Start the router immediately - no config file needed!\n# Although you can create a config if you want to store your API keys for all providers\ncco start  # or claude-code-open start\n\n# The API key will be used for whichever provider your model requests\n# e.g., if you use \"openrouter,anthropic/claude-sonnet-4\" -\u003e key goes to OpenRouter\n# e.g., if you use \"openai,gpt-4o\" -\u003e key goes to OpenAI\n```\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003e🔑 How CCO_API_KEY Works\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\n\n✅ **Single API Key** - Use one environment variable for all providers  \n✅ **Provider Detection** - Key automatically routed to correct provider  \n✅ **No Config Required** - Run immediately without config files  \n✅ **Fallback Priority** - Provider-specific keys take precedence  \n\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n### ⚙️ Full Configuration (Optional)\n\nFor advanced setups with multiple API keys, generate a complete YAML configuration:\n\n```bash\ncco config generate  # or claude-code-open config generate\n```\n\nThis creates `config.yaml` with all 5 supported providers and sensible defaults. Then edit the file to add your API keys:\n\n```yaml\n# config.yaml\nhost: 127.0.0.1\nport: 6970\napi_key: your-proxy-key  # Optional: protect the proxy\n\nproviders:\n  - name: openrouter\n    api_key: your-openrouter-api-key\n    model_whitelist: [\"claude\", \"gpt-4\"]  # Optional: filter models\n  - name: openai\n    api_key: your-openai-api-key\n  # ... etc\n```\n\nAlternatively, use the interactive setup:\n\n```bash\ncco config init  # or claude-code-open config init\n```\n\n### 🎯 Usage\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**🚀 Start the Service**\n```bash\ncco start\n# or\nclaude-code-open start\n```\n\n**📊 Check Status**\n```bash\ncco status\n# or\nclaude-code-open status\n```\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**💬 Use with Claude Code**\n```bash\ncco code [arguments]\n# or\nclaude-code-open code [...]\n# Auto-starts if not running\n```\n\n**⏹️ Stop the Service**\n```bash\ncco stop\n# or\nclaude-code-open stop\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## 🔄 Dynamic Model Selection\n\nThe router supports explicit provider and model selection using comma notation, which overrides all automatic routing logic:\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003e🤖 Automatic Routing (Fallback)\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\n\nWhen no comma is present in the model name, the router applies these rules in order:\n\n1. **📄 Long Context** - If tokens \u003e 60,000 → use `LongContext` config\n2. **⚡ Background Tasks** - If model starts with \"claude-3-5-haiku\" → use `Background` config  \n3. **🎯 Default Routing** - Use `Think`, `WebSearch`, or model as-is\n\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n## 🏗️ Architecture\n\n### 🧩 Core Components\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n📁 **`internal/config/`** - Configuration management  \n🔌 **`internal/providers/`** - Provider implementations  \n🌐 **`internal/server/`** - HTTP server and routing  \n🎯 **`internal/handlers/`** - Request handlers (proxy, health)  \n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n🔧 **`internal/middleware/`** - HTTP middleware (auth, logging)  \n⚙️ **`internal/process/`** - Process lifecycle management  \n💻 **`cmd/`** - CLI command implementations  \n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### 🔌 Provider System\n\nThe router uses a modular provider system where each provider implements the `Provider` interface:\n\n```go\ntype Provider interface {\n    Name() string\n    SupportsStreaming() bool\n    TransformRequest(request []byte) ([]byte, error)\n    TransformResponse(response []byte) ([]byte, error)\n    TransformStream(chunk []byte, state *StreamState) ([]byte, error)\n    IsStreaming(headers map[string][]string) bool\n    GetEndpoint() string\n    SetAPIKey(key string)\n}\n```\n\n## ⚙️ Configuration\n\n### 📁 Configuration File Location\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**🐧 Linux/macOS**\n- `~/.claude-code-open/config.yaml` *(preferred)*\n- `~/.claude-code-open/config.json`\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**🪟 Windows**  \n- `%USERPROFILE%\\.claude-code-open\\config.yaml` *(preferred)*\n- `%USERPROFILE%\\.claude-code-open\\config.json`\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003e **🔄 Backward Compatibility**: The router will also check `~/.claude-code-router/` for existing configurations and use them automatically, with a migration notice.\n\n### 📄 YAML Configuration Format (Recommended)\n\nThe router now supports modern YAML configuration with automatic defaults:\n\n```yaml\n# Server settings\nhost: 127.0.0.1\nport: 6970\napi_key: your-proxy-key-here  # Optional: protect proxy with authentication\n\n# Provider configurations  \nproviders:\n  # OpenRouter - Access to multiple models\n  - name: openrouter\n    api_key: your-openrouter-api-key\n    # url: auto-populated from defaults\n    # default_models: auto-populated with curated list\n    model_whitelist: [\"claude\", \"gpt-4\"]  # Optional: filter models by pattern\n\n  # OpenAI - Direct GPT access\n  - name: openai\n    api_key: your-openai-api-key\n    # Automatically configured with GPT-4, GPT-4-turbo, GPT-3.5-turbo\n\n  # Anthropic - Direct Claude access\n  - name: anthropic\n    api_key: your-anthropic-api-key\n    # Automatically configured with Claude models\n\n  # Nvidia - Nemotron models\n  - name: nvidia \n    api_key: your-nvidia-api-key\n\n  # Google Gemini\n  - name: gemini\n    api_key: your-gemini-api-key\n\n# Router configuration for different use cases\nrouter:\n  default: openrouter,anthropic/claude-sonnet-4\n  think: openai,o1-preview\n  long_context: anthropic,claude-sonnet-4\n  background: anthropic,claude-3-haiku-20240307\n  web_search: openrouter,perplexity/llama-3.1-sonar-huge-128k-online\n```\n\n### 📜 Legacy JSON Format\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e📋 JSON Configuration (Click to expand)\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\nThe router still supports JSON configuration for backward compatibility:\n\n```json\n{\n  \"HOST\": \"127.0.0.1\",\n  \"PORT\": 6970,\n  \"APIKEY\": \"your-router-api-key-optional\",\n  \"Providers\": [\n    {\n      \"name\": \"openrouter\",\n      \"api_base_url\": \"https://openrouter.ai/api/v1/chat/completions\",\n      \"api_key\": \"your-provider-api-key\",\n      \"models\": [\"anthropic/claude-sonnet-4\"],\n      \"model_whitelist\": [\"claude\", \"gpt-4\"],\n      \"default_models\": [\"anthropic/claude-sonnet-4\"]\n    }\n  ],\n  \"Router\": {\n    \"default\": \"openrouter,anthropic/claude-sonnet-4\",\n    \"think\": \"openrouter,anthropic/claude-sonnet-4\", \n    \"longContext\": \"openrouter,anthropic/claude-sonnet-4\",\n    \"background\": \"openrouter,anthropic/claude-3-5-haiku\",\n    \"webSearch\": \"openrouter,perplexity/llama-3.1-sonar-large-128k-online\"\n  }\n}\n```\n\n\u003c/details\u003e\n\n### ⚙️ Configuration Features\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n✅ **Auto-Defaults** - URLs and model lists auto-populated  \n✅ **YAML Priority** - YAML takes precedence over JSON  \n✅ **Model Whitelisting** - Filter models by pattern  \n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n✅ **Smart Model Management** - Auto-filtered by whitelists  \n✅ **Proxy Protection** - Optional API key authentication  \n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### 🗺️ Router Configuration\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n🎯 **`default`** - Default model when none specified  \n🧠 **`think`** - Complex reasoning tasks (e.g., o1-preview)  \n📄 **`long_context`** - Requests with \u003e60k tokens  \n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n⚡ **`background`** - Background/batch processing  \n🌐 **`web_search`** - Web search enabled tasks  \n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003e **Format**: `provider_name,model_name` (e.g., `openai,gpt-4o`, `anthropic,claude-sonnet-4`)\n\n## 💻 Commands\n\n### 🔧 Service Management\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"33%\"\u003e\n\n**🚀 Start Service**\n```bash\ncco start [--verbose] [--log-file]\n```\n\n\u003c/td\u003e\n\u003ctd width=\"33%\"\u003e\n\n**📊 Check Status**\n```bash\ncco status\n```\n\n\u003c/td\u003e\n\u003ctd width=\"33%\"\u003e\n\n**⏹️ Stop Service**\n```bash\ncco stop\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### ⚙️ Configuration Management\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**📁 Generate Config**\n```bash\ncco config generate [--force]\n```\n\n**🔧 Interactive Setup**\n```bash\ncco config init\n```\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**👁️ Show Config**\n```bash\ncco config show\n```\n\n**✅ Validate Config**\n```bash\ncco config validate\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### 💬 Claude Code Integration\n\n```bash\n# Run Claude Code through the router\ncco code [args...]\n\n# Examples:\ncco code --help\ncco code \"Write a Python script to sort a list\"\ncco code --resume session-name\n```\n\n## 🔌 Adding New Providers\n\nTo add support for a new LLM provider:\n\n1. **Create Provider Implementation**:\n   ```go\n   // internal/providers/newprovider.go\n   type NewProvider struct {\n       name     string\n       endpoint string\n       apiKey   string\n   }\n   \n   func (p *NewProvider) TransformRequest(request []byte) ([]byte, error) {\n       // Implement Claude → Provider format transformation\n   }\n   \n   func (p *NewProvider) TransformResponse(response []byte) ([]byte, error) {\n       // Implement Provider → Claude format transformation\n   }\n   \n   func (p *NewProvider) TransformStream(chunk []byte, state *StreamState) ([]byte, error) {\n       // Implement streaming response transformation (Provider → Claude format)\n   }\n   ```\n\n2. **Register Provider**:\n   ```go\n   // internal/providers/registry.go\n   func (r *Registry) Initialize() {\n       r.Register(NewOpenRouterProvider())\n       r.Register(NewOpenAIProvider())\n       r.Register(NewAnthropicProvider())\n       r.Register(NewNvidiaProvider())\n       r.Register(NewGeminiProvider())\n       r.Register(NewYourProvider()) // Add here\n   }\n   ```\n\n3. **Update Domain Mapping**:\n   ```go\n   // internal/providers/registry.go\n   domainProviderMap := map[string]string{\n       \"your-provider.com\": \"yourprovider\",\n       // ... existing mappings\n   }\n   ```\n\n## 🚧 Development\n\n### 📋 Prerequisites\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n🐹 **Go 1.24.4** or later  \n🔑 **LLM Provider API Access** (OpenRouter, OpenAI, etc.)  \n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n💻 **Development Tools** (optional)  \n🔥 **Air** (hot reload - auto-installed)  \n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### 🔥 Development with Hot Reload\n\n```bash\n# Development with hot reload (automatically installs Air if needed)\nmake dev\n\n# This will:\n# - Install Air if not present\n# - Start the server with `cco start --verbose`\n# - Watch for Go file changes\n# - Automatically rebuild and restart on changes\n```\n\n### 🏗️ Building\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**🔨 Single Platform**\n```bash\ngo build -o cco .\n# or\nmake build\ntask build\n```\n\n**🌍 Cross-Platform**\n```bash\nmake build-all\ntask build-all\n```\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**🎯 Manual Cross-Compilation**\n```bash\nGOOS=linux GOARCH=amd64 go build -o cco-linux-amd64 .\nGOOS=darwin GOARCH=amd64 go build -o cco-darwin-amd64 .\nGOOS=windows GOARCH=amd64 go build -o cco-windows-amd64.exe .\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### 🧪 Testing\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"33%\"\u003e\n\n**🔍 Basic Tests**\n```bash\ngo test ./...\nmake test\ntask test\n```\n\n\u003c/td\u003e\n\u003ctd width=\"33%\"\u003e\n\n**📊 Coverage**\n```bash\ngo test -cover ./...\nmake coverage\ntask test-coverage\n```\n\n\u003c/td\u003e\n\u003ctd width=\"33%\"\u003e\n\n**🛡️ Security**\n```bash\ntask security\ntask benchmark  \ntask check\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### ⚡ Task Runner\n\nThe project includes both a traditional `Makefile` and a modern `Taskfile.yml` for task automation. [Task](https://taskfile.dev/) provides more powerful features and better cross-platform support.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e📋 Available Tasks (Click to expand)\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\n```bash\n# Core development tasks\ntask build              # Build the binary\ntask test               # Run tests \ntask fmt                # Format code\ntask lint               # Run linter\ntask clean              # Clean build artifacts\n\n# Advanced tasks\ntask dev                # Development mode with hot reload\ntask build-all          # Cross-platform builds\ntask test-coverage      # Tests with coverage report\ntask benchmark          # Run benchmarks\ntask security           # Security audit\ntask check              # All checks (fmt, lint, test, security)\n\n# Service management\ntask start              # Start the service (builds first)\ntask stop               # Stop the service\ntask status             # Check service status\n\n# Configuration\ntask config-generate    # Generate example config\ntask config-validate    # Validate current config\n\n# Utilities\ntask deps               # Download dependencies\ntask mod-update         # Update all dependencies\ntask docs               # Start documentation server\ntask install            # Install to system\ntask release            # Create release build\n```\n\n\u003c/details\u003e\n\n## 🚀 Production Deployment\n\n### 🐧 Systemd Service (Linux)\n\nCreate `/etc/systemd/system/claude-code-open.service`:\n\n```ini\n[Unit]\nDescription=Claude Code Open\nAfter=network.target\n\n[Service]\nType=simple\nUser=your-user\nExecStart=/usr/local/bin/cco start\n# Or if using go install without symlink:\n# ExecStart=%h/go/bin/claude-code-open start\n# Or with dynamic Go path:\n# ExecStartPre=/usr/bin/env bash -c 'echo \"GOPATH: $(go env GOPATH)\"'\n# ExecStart=/usr/bin/env bash -c '\"$(go env GOPATH)/bin/claude-code-open\" start'\nRestart=always\nRestartSec=5\n\n[Install]\nWantedBy=multi-user.target\n```\n\nEnable and start:\n```bash\nsudo systemctl enable claude-code-open\nsudo systemctl start claude-code-open\n```\n\n### 🌐 Environment Variables\n\nThe router respects these environment variables:\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n🔑 **`CCO_API_KEY`** - Universal API key for all providers  \n🏠 **`CCO_HOST`** - Override host binding  \n🔌 **`CCO_PORT`** - Override port binding  \n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n📁 **`CCO_CONFIG_PATH`** - Override config file path  \n📊 **`CCO_LOG_LEVEL`** - Set log level (debug, info, warn, error)  \n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n#### 🔑 CCO_API_KEY Behavior\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003e🔑 How CCO_API_KEY Works\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\n\n1️⃣ **No Config File** - Creates minimal config with all providers  \n2️⃣ **Config File Exists** - Serves as fallback for missing provider keys  \n3️⃣ **Provider Selection** - Key sent to requested provider automatically  \n4️⃣ **Priority** - Provider-specific keys override CCO_API_KEY  \n\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n```bash\n# Use your OpenAI API key directly with OpenAI\nexport CCO_API_KEY=\"sk-your-openai-key\"\ncco start\n\n# This request will use your OpenAI key:\n# - \"openai,gpt-4o\"\n```\n\n## 📊 Monitoring\n\n### 💓 Health Check\n\n```bash\ncurl http://localhost:6970/health\n```\n\n### 📝 Logs \u0026 Metrics\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**📋 Log Information**\n- Request routing and provider selection\n- Token usage (input/output)  \n- Response times and status codes\n- Error conditions and debugging info\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**📈 Operational Metrics**\n- Request count and response times\n- Token usage statistics  \n- Provider response status codes\n- Error rates by provider\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## 🔧 Troubleshooting\n\n### ⚠️ Common Issues\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd width=\"50%\"\u003e\n\n**🚫 Service Won't Start**\n- Check config: `cco config validate`\n- Check port: `netstat -ln | grep :6970`\n- Enable verbose: `cco start --verbose`\n\n**🔑 Authentication Errors**\n- Verify provider API keys in config\n- Check router API key if enabled\n- Ensure Claude Code env vars are set\n\n\u003c/td\u003e\n\u003ctd width=\"50%\"\u003e\n\n**⚙️ Transformation Errors**\n- Enable verbose logging for details\n- Check provider compatibility\n- Verify request format matches schema\n\n**🐌 Performance Issues**\n- Monitor token usage in logs\n- Use faster models for background tasks\n- Check network latency to provider APIs\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### 🐛 Debug Mode\n\n```bash\ncco start --verbose\n```\n\n\u003cdiv align=\"center\"\u003e\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003e🔍 Debug Information\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e\n\n✅ Request/response transformations  \n✅ Provider selection logic  \n✅ Token counting details  \n✅ HTTP request/response details  \n\n\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\n## 📜 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n## 📈 Changelog\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🎯 v0.3.0 - Latest Release\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\n✨ **New Providers** - Added Nvidia and Google Gemini support (5 total providers)  \n📄 **YAML Configuration** - Modern YAML config with automatic defaults  \n🔍 **Model Whitelisting** - Filter available models per provider using patterns  \n🔐 **API Key Protection** - Optional proxy-level authentication  \n💻 **Enhanced CLI** - New `cco config generate` command  \n🧪 **Comprehensive Testing** - 100% test coverage for all providers  \n📋 **Default Model Management** - Auto-populated curated model lists  \n🔄 **Streaming Tool Calls** - Fixed complex streaming parameter issues  \n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e⚡ v0.2.0 - Architecture Overhaul\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\n🏗️ **Complete Refactor** - Modular architecture  \n🔌 **Multi-Provider Support** - OpenRouter, OpenAI, Anthropic  \n💻 **Improved CLI Interface** - Better user experience  \n🛡️ **Production-Ready** - Error handling and logging  \n⚙️ **Configuration Management** - Robust config system  \n🔄 **Process Lifecycle** - Proper service management  \n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e🌱 v0.1.0 - Initial Release\u003c/b\u003e\u003c/summary\u003e\n\n\u003cbr\u003e\n\n🎯 **Proof-of-Concept** - Initial implementation  \n🔌 **Basic OpenRouter** - Single provider support  \n🌐 **Simple Proxy** - Basic functionality  \n\n\u003c/details\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Made with ❤️ for the Claude Code community**\n\n\u003c/div\u003e\n","funding_links":[],"categories":["代理与API工具","Proxies \u0026 Model Integrations"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavincible%2Fclaude-code-open","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDavincible%2Fclaude-code-open","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavincible%2Fclaude-code-open/lists"}