Replies: 2 comments
-
|
in my opinion, it would be better to use a plugin system to provide support for commandcode. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Because of this limitation, I ended up building my own proxy. Feel free to check it out nasrulhadi/proxy-commandcode |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Request to add Command Code (a coding agent + model gateway by Langbase) as a provider. The interesting part is the Go plan: $1/month with $10 of included credits and deal multipliers that push effective usage to ~$40 on selected OSS models (pricing, pricing limits). Roster includes DeepSeek V4 Pro, Kimi K2.7 Code, GLM-5.2, MiniMax M3, Qwen 3.7 Max, MiMo V2.5 Pro, Nemotron 3 Ultra, etc. (21 open-weight models, several with 1M context).
The Go plan is genuinely the best $1 in the space right now, and CLIProxyAPI is the obvious home for it — but there's a wrinkle that's worth flagging up front.
The wrinkle: Go plan works via
/alpha/generate, not/provider/v1/*The gateway exposes three generation endpoints:
POST /provider/v1/messagesPOST /provider/v1/chat/completionsPOST /alpha/generateOn the Go plan, both
/provider/v1/*paths return:{ "error": { "message": "Your Go plan doesn't include API access. Upgrade to Pro or higher…", "code": "upgrade_required" } }/alpha/generateis the endpoint thecmdCLI itself uses on every turn, so it is not plan-gated. The catch: it speaks a custom envelope, not OpenAI or Anthropic shape. So serving Go-plan users means a translator, exactly the kind of thing CLIProxyAPI does well.Auth is a plain
user_...API key (same key as the CLI, from https://commandcode.ai/settings/billing) — no OAuth needed, unlike Codex/Claude/Gemini.The protocol is already reverse-engineered and battle-tested
There's a mature reference implementation with a full wire-protocol spec:
safzanpirani/pi-commandcode-provider— working OpenAI→envelope + NDJSON→SSE translator.docs/wire-protocol.md— strictconfigenvelope, Vercel-AI-SDKModelMessage[]schema, tool format, every NDJSON event type, usage shape.Request
{ "config": { /* schema-strict; all fields required, neutral defaults OK */ }, "memory": "", "taste": null, "skills": null, "permissionMode": "standard", "params": { "model": "deepseek/deepseek-v4-pro", "system": "…", "messages": [ /* Vercel AI SDK ModelMessage[] — NOT OpenAI, NOT Anthropic */ ], "tools": [ /* name + input_schema (JSON Schema) */ ], "max_tokens": 32000, "stream": true } }Response = newline-delimited JSON, NOT SSE
Known sharp edges (verified from open issues in other routers)
stream:falseis rejected (400/ECONNRESET) — must forcestream:trueand buffer server-side. decolua/9router#1840, fixed in #1843.bufio.Scanner's default limit — needs an unbounded reader.configenvelope is schema-strict; the gateway's 400 usefully lists the exact missing field paths.Demand is real (this is not hypothetical)
A code/issue search of this repo for
commandcodereturns zero matches today. But the ecosystem is actively building it independently:decolua/9routercan1357/oh-my-pisafzanpirani/pi-commandcode-providerHaeMeto/Command-Code-AI-Proxy/alpha/generatedev2k6/command-code-proxy-server/provider/v1/*) so it can't serve Go planSame feature request also open elsewhere: anomalyco/opencode#26338. The knowledge and the demand both exist; what's missing is a canonical home, which CLIProxyAPI is the natural fit for.
Stability note (being candid)
/alpha/generateis an undocumented CLI-internal endpoint, and thecommand-codenpm package is at0.40.0and moves frequently — the protocol drifts and thex-command-code-versionheader must track it. That's the same risk class as this project's existing OAuth/CLI-wrapping providers (Claude Code, Codex, Gemini CLI), and centralizing it here with CI is exactly what would keep consumers current instead of each fork re-deriving on every CLI bump.Proposed contribution
I've gathered a full evidence bundle (protocol spec, reference impl source, model roster, credit multipliers, stability assessment) and would like to open a PR. Two routes, and I'd like your steer on which you prefer:
Example provider under
examples/— a Go Command Code provider built on the v7 SDK pattern already shown inexamples/custom-provider/main.go(sdktr.Register(openai.chat → commandcode, reqXform, respXform)+ anExecutorhitting/alpha/generate+ model registration inOnAfterStart). This path is open to contributors.Built-in provider — I noticed
pr-path-guard.ymlblocksinternal/translator/**changes in PRs, so a built-in translator would need your team to land it. If you'd prefer it built-in, I'm happy to hand over a ready diff + tests and let you commit, or however you prefer to work.My default plan is route 1 (example provider) unless you'd rather it be built-in.
Question for maintainers: preferred route (1 example provider vs 2 built-in), and any provider naming convention you'd like me to follow (e.g.
commandcode,command-code,cmd)?I'll open the PR against
devper the retarget workflow once you confirm direction.cc maintainers
Beta Was this translation helpful? Give feedback.
All reactions