Skip to content

feat: Add Command Code provider (42 models from commandcode.ai) - #471

Open
themuuln wants to merge 3 commits into
automazeio:mainfrom
themuuln:feature/commandcode-provider
Open

feat: Add Command Code provider (42 models from commandcode.ai)#471
themuuln wants to merge 3 commits into
automazeio:mainfrom
themuuln:feature/commandcode-provider

Conversation

@themuuln

@themuuln themuuln commented Jul 16, 2026

Copy link
Copy Markdown

What this does

Adds Command Code as a new provider. For anyone who uses commandcode.ai — the model aggregator with Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM — this makes those models accessible right from VibeProxy.

The core problem: CC has its own API format. Different from OpenAI. Different endpoints, different SSE events, different message structure. CLIProxyAPIPlus only speaks OpenAI.

The fix: A small Rust binary (3.3MB) that sits between CLIProxyAPIPlus and CCs API. Translates requests in, responses out. One-way translation, transparent to the rest of the stack.

Architecture

Your CLI (Factory/Amp/pi) 
    → VibeProxy (:8317)
        → CLIProxyAPIPlus (:8318)
            → commandcode-proxy (:8399)
                → commandcode.ai

What changed

File Why
src/Sources/Resources/commandcode-proxy The translation shim. Built with Rust + axum, handles SSE streaming, tool calls, reasoning tokens. 3.3MB with LTO optimizations.
src/Sources/Resources/config.yaml Registers CC as an openai-compatibility provider with 24 model aliases
src/Sources/ServerManager.swift Starts/stops the shim alongside the main server. Follows existing CLIProxyAPIPlus pattern.
COMMANDCODE_PROXY.md Build documentation for rebuilding the binary

42 models, all available

Claude Opus 4.8, Sonnet 4.6, Haiku 4.5. GPT-5.5, 5.4, 5.3 Codex. Gemini 3.5 Flash. DeepSeek V4 Pro/Flash. Kimi K2.6. Qwen 3.7 Max. GLM 5.1. MiniMax M2.7. MiMo V2.5. Step 3.5 Flash.

Get your API key at commandcode.ai. Click "Add API Key" in VibeProxy Settings, paste it. Models show up as CC: Opus 4.7, CC: DeepSeek V4 Flash, etc.

Production features

  • Retry on 429/5xx: Exponential backoff with Retry-After header support
  • Connection pooling: pool_max_idle_per_host=4, 90s idle timeout
  • Request timeout: Configurable via REQUEST_TIMEOUT env var (default 600s)
  • Model alias mapping: Reads config.yaml, maps CC: prefix → actual model names

How to rebuild

cd ~/.workspace/commandcode-proxy && cargo build --release
cp target/release/commandcode-proxy ~/.workspace/vibeproxy/src/Sources/Resources/

Source repo: https://github.com/themuuln/commandcode-proxy

What I tested

  • Models: 42 models returned via /v1/models — confirmed working against live CC API
  • Streaming: DeepSeek V4 Flash gave full reasoning → content → usage → [DONE]. Clean OpenAI SSE format.
  • Tool calls: get_weather tool call came through with proper tool_calls SSE chunks. Function name, arguments, IDs all correct.
  • Auth relay: Invalid API key correctly returned CCs 401 as a 502. Valid key works end-to-end.
  • App: swift build compiles clean. App launches, all 3 processes start (CLIProxyMenuBar + cli-proxy-api-plus + commandcode-proxy).
  • Unit tests: 7 tests passing covering retry logic, model mapping, message conversion.
  • Binary size: 3.3MB (60% reduction from initial 8.4MB via LTO + strip optimizations)

themuuln added 3 commits July 16, 2026 21:32
Adds commandcode-proxy, a Rust translation shim that bridges Command Code's
proprietary API (POST /alpha/generate) to an OpenAI-compatible endpoint
(localhost:8399). VibeProxy then routes requests through its standard
openai-compatibility mechanism.

Components:
- commandcode-proxy binary (Rust/axum): SSE streaming, model list, tool calls
- ServerManager: lifecycle management alongside cli-proxy-api-plus
- config.yaml: static provider entry with 24 model aliases (CC: prefix)

Supports all Command Code models: Claude, GPT, Gemini, DeepSeek, Qwen, Kimi,
GLM, MiniMax, MiMo, and Step.
- Retry on 429/5xx with exponential backoff (MAX_RETRIES=3)
- Request timeout (REQUEST_TIMEOUT=60s)
- Connection pooling (pool_max_idle_per_host=4)
- Model alias mapping from config.yaml (24 aliases)
- Fix base-url to include /v1 (CLIProxyAPIPlus strips it)
@themuuln
themuuln force-pushed the feature/commandcode-provider branch from a2f437b to e95e39d Compare July 16, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant