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 摘要。