explaingit

dev2k6/command-code-proxy-server

3GoAudience · developerComplexity · 2/5ActiveSetup · easy

TLDR

A small Go proxy that exposes an OpenAI-compatible API in front of the CommandCode service so any OpenAI-style client can use CommandCode models.

Mindmap

mindmap
  root((command-code-proxy-server))
    Inputs
      OpenAI chat requests
      Bearer API key
      CLI flags
    Outputs
      OpenAI SSE stream
      Models list
      Health status
    Use Cases
      Point OpenAI clients at CommandCode
      Local dev proxy
      Model name aliasing
    Tech Stack
      Go
      HTTP
      SSE

Things people build with this

USE CASE 1

Run a localhost proxy that lets OpenAI SDKs talk to CommandCode models

USE CASE 2

Map short aliases like deepseek-v4-pro or kimi2.6 to full upstream model IDs

USE CASE 3

Forward per-request Authorization Bearer keys to api.commandcode.ai

USE CASE 4

Stream chat completions as OpenAI-style SSE chunks to existing chat UIs

Tech stack

GoHTTPSSE

Getting it running

Difficulty · easy Time to first run · 5min

Build needs Go 1.26.2 or newer, and a valid CommandCode API key is required for actual calls.

In plain English

This project is a small server, written in Go, that sits between a client app and a service called CommandCode. Many AI tools speak the OpenAI API style for chat, so this proxy translates OpenAI-style requests into the CommandCode style and back. The point is that any app that already knows how to talk to OpenAI can talk to CommandCode models instead, just by pointing it at this local server. The proxy exposes the two endpoints OpenAI-compatible clients expect: a list-models endpoint at /v1/models and a chat endpoint at /v1/chat/completions. Both streaming and non-streaming responses are supported. By default the server listens on 127.0.0.1 port 55990, but the host and port are configurable with command line flags. There is also a health check at /health that returns a simple ok status. API keys can come from two places. Each incoming request can include its own Authorization Bearer header, which is the preferred path, and the server will pass that key upstream. Alternatively you can pass a default key with the -api-key flag when starting the server, and that key is used when a request does not include its own. If neither is present, the request is rejected with 401 Unauthorized. The README lists short aliases for many model names, so for example you can ask for deepseek-v4-pro or kimi2.6 and the proxy maps that to the full upstream model ID. Unknown names are forwarded as-is. Under the hood, the proxy converts the OpenAI message format into CommandCode's, sends the request to api.commandcode.ai, and converts streaming events back into OpenAI-style SSE chunks. On startup it also checks GitHub tags for a newer version of itself and fetches the latest npm version of the command-code package to include as an upstream header, cached for 30 minutes. Go 1.26.2 or newer is required to build it.

Copy-paste prompts

Prompt 1
Build command-code-proxy-server from source with Go 1.26.2 and run it on 127.0.0.1:55990
Prompt 2
Configure my Cursor client to point at this proxy and use the kimi2.6 alias
Prompt 3
Add a new model alias to the proxy that maps to a CommandCode model ID
Prompt 4
Set a default -api-key flag so clients without an Authorization header still work
Prompt 5
Trace how the proxy converts OpenAI streaming events into CommandCode requests and back
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.