npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

commandcode-api-proxy

v0.1.4

Published

OpenAI-compatible API proxy for Command Code. Use your Command Code subscription from any OpenAI client.

Readme

Command Code API Proxy

npm version downloads/month

OpenAI-compatible API proxy for Command Code. Use your Command Code subscription from any OpenAI-compatible client — OpenCode, Claude Code, or plain curl.

Why?

Command Code exposes two API surfaces:

| Surface | Protocol | Plan required | | ------------------------------- | ----------------------------- | ------------------------------- | | /provider/v1/chat/completions | OpenAI-compatible | Provider tier (paid add-on) | | /alpha/generate | Custom (Vercel AI SDK stream) | Your standard subscription |

This proxy talks /alpha/generate upstream and standard OpenAI downstream — so your existing plan works from any tool.

Run the proxy

# Clone & run from source
git clone https://github.com/thaolaptrinh/commandcode-api-proxy.git
cd commandcode-api-proxy
npm install
npm run build && npm start

# Or run directly (no install)
npx commandcode-api-proxy

# Or install globally
npm install -g commandcode-api-proxy
commandcode-api-proxy

On first run, the proxy prompts for your Command Code API key (get it from https://commandcode.ai/settings). Other ways to provide it are in Authentication.

Authentication

Provide your API key via --api-key, the CC_API_KEY env var, or save it with auth login (stored at ~/.config/commandcode-api-proxy/auth.json).

CLI auth commands

From source, replace commandcode-api-proxy with npm run auth -- (e.g. npm run auth -- login).

# Save a new API key
commandcode-api-proxy auth login

# Overwrite existing key
commandcode-api-proxy auth login --force

# Remove saved key
commandcode-api-proxy auth logout

CLI options

| Option | Description | Default | | --------------------- | --------------------------------- | ----------- | | --host | Bind address | 127.0.0.1 | | --port | Port | 8787 | | --api-key | Command Code API key | — | | --setup-opencode | Generate OpenCode provider config | — | | --setup-claude-code | Generate Claude Code model config | — |

Equivalent env vars (lower priority than CLI flags):

| Env var | Description | | ---------------- | -------------------------------------------- | | HOST | Bind address | | PORT | Port | | CC_API_KEY | Command Code API key | | CC_API_BASE | Upstream API base URL | | CC_CLI_VERSION | CLI version sent upstream | | LOG_LEVEL | Log level (info, debug, etc.) |

Endpoints

| Endpoint | Protocol | | -------------------------------- | --------- | | GET /health | — | | GET /v1/models | OpenAI | | POST /v1/chat/completions | OpenAI | | POST /v1/messages | Anthropic | | POST /v1/messages/count_tokens | Anthropic |

All endpoints accept any auth token (use proxy-managed) — the proxy injects your real Command Code key upstream.

Client configuration

OpenCode

Run setup to auto-generate the provider config at ~/.config/opencode/opencode.json:

npx commandcode-api-proxy --setup-opencode

All CC models are listed directly — pick the one you want from the model selector.

Or add a commandcode provider manually — point baseURL at the proxy and use any model ID from the Model aliases table:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "commandcode": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Command Code",
      "options": {
        "baseURL": "http://127.0.0.1:8787/v1",
        "apiKey": "proxy-managed"
      },
      "models": {
        "deepseek-v4-pro": { "name": "DeepSeek V4 Pro" }
      }
    }
  }
}

Claude Code

Claude Code only offers three tiers — sonnet, opus, haiku. The setup maps each tier to a Command Code model via env vars in claude-settings.json:

npx commandcode-api-proxy --setup-claude-code

If a settings file already exists, re-run with --force to overwrite it.

| Claude Code tier | Env var | Maps to | | ---------------- | -------------------------------- | --------------------------- | | sonnet | ANTHROPIC_DEFAULT_SONNET_MODEL | deepseek/deepseek-v4-pro | | opus | ANTHROPIC_DEFAULT_OPUS_MODEL | deepseek/deepseek-v4-pro | | haiku | ANTHROPIC_DEFAULT_HAIKU_MODEL | deepseek/deepseek-v4-flash|

Edit those env vars in the settings file to point at other CC models. To force every claude-* request to a single model regardless of tier, set ANTHROPIC_DEFAULT_MODEL. Then run:

claude --settings ~/.config/commandcode-api-proxy/claude-settings.json

Or set an alias:

alias claude-proxy="claude --settings ~/.config/commandcode-api-proxy/claude-settings.json"
claude-proxy

Model aliases

Short names work in addition to full model IDs:

| Alias | Maps to | | -------------------------------------------------- | ------------------------------ | | deepseek-v4-pro, deepseek-v4, deepseek-pro | deepseek/deepseek-v4-pro | | deepseek-v4-flash, deepseek-flash | deepseek/deepseek-v4-flash | | kimi-k2.6, kimi2.6 | moonshotai/Kimi-K2.6 | | kimi-k2.5, kimi2.5 | moonshotai/Kimi-K2.5 | | glm-5.1 | zai-org/GLM-5.1 | | glm-5 | zai-org/GLM-5 | | minimax-m2.7, minimax2.7 | MiniMaxAI/MiniMax-M2.7 | | minimax-m2.5, minimax2.5 | MiniMaxAI/MiniMax-M2.5 | | qwen3.6-max, qwen-3.6-max | Qwen/Qwen3.6-Max-Preview | | qwen3.6-plus, qwen-3.6-plus | Qwen/Qwen3.6-Plus | | qwen3.7-max, qwen-3.7-max | Qwen/Qwen3.7-Max | | qwen3.7-plus, qwen-3.7-plus | Qwen/Qwen3.7-Plus | | step3.5, step-3.5-flash | stepfun/Step-3.5-Flash | | mimo-v2.5, mimo2.5 | xiaomi/mimo-v2.5 |

Any model ID is passed through as-is — the proxy does not validate against a fixed list.

License

MIT