CommandCodeAI / CommandCodeAI/command-code

Support custom API base URL and API key (OpenAI-compatible provider)

未關閉
#640 0 則留言 5 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
沒有語言資料
星號
4k
分支
350
PR 合併指標
30 天內沒有已合併 PR

描述

Feature Request

Allow commandcode to use a custom API base URL and API key from external providers (e.g. any OpenAI-compatible gateway), instead of being hardwired to api.commandcode.ai.

Motivation

Right now all models are routed through Command Code's own backend (api.commandcode.ai). Users on other providers — or self-hosted / relay gateways that expose an OpenAI-compatible /v1 endpoint — cannot point commandcode at them. The only knob that exists, COMMANDCODE_API_URL, switches between Command Code's own prod/staging/local environments; it does not accept an external provider base URL.

Proposed behavior

Something like the existing opencode / Claude Code config model:

  • A config file and/or env vars, e.g.:
    • COMMANDCODE_BASE_URL=https://my-provider.example.com/v1
    • COMMANDCODE_API_KEY=sk-...
  • Optional custom model list (id → display name, context window, modalities) when pointing at a non-Command-Code backend.
  • Priority: CLI flag > config file > env var > current auth.
Use case

I maintain an opencode.jsonc with a custom provider (npm: @ai-sdk/openai-compatible, baseURL + apiKey) and would love to drive commandcode with the same endpoint/key instead of a separate Command Code subscription key.

Environment
  • commandcode 1.11.0
  • Linux, Node v26

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先追蹤現有的 COMMANDCODE_API_URL 設定與目前的驗證路徑。實作提議的 COMMANDCODE_BASE_URL 與 COMMANDCODE_API_KEY 來源,包括 CLI、設定檔、環境,以及目前驗證的優先順序,並支援選用的自訂模型中繼資料。當不需要 Command Code 訂閱金鑰即可使用相容於 OpenAI 的外部端點與金鑰時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
node.js
領域
api, cli
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。