CommandCodeAI / CommandCodeAI/command-code

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

Open
#640 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
4k
Forks
350
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing COMMANDCODE_API_URL configuration and current authentication path. Implement the proposed COMMANDCODE_BASE_URL and COMMANDCODE_API_KEY sources, including CLI, config-file, environment, and current-auth precedence, plus optional custom model metadata. Done means an OpenAI-compatible external endpoint and key can be used without a Command Code subscription key.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js
Domain
api, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.