← Catalog

@tduyng/pi-commandcode

Command Code models in Pi through the documented Provider API, with Pi's own prompt and tools.

Extension

Install

Install with PiG

pig install npm:@tduyng/pi-commandcode

Install with Pi

pi install npm:@tduyng/pi-commandcode
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.0.6 (README.md). PiG does not review it.

@tduyng/pi-commandcode

Command Code models as a pi provider, through the documented Provider API, with pi's own prompt, tools and approvals. Unofficial: not made or endorsed by Command Code.

No tools, no prompt block, no schema, and the adapters add no round trip of their own.

No transport of its own

Streaming, tool calls and message conversion are pi's built-in adapters. The extension supplies a provider id, a base URL, a key reference, a catalog and a per-model wire choice, so there is no request code to drift from pi's own.

The wire follows the model. Claude models use Anthropic Messages, which is what they speak, and everything else uses OpenAI Chat Completions. That choice is the difference between a working model and a 400.

Model idWireBase URL
claude-*Anthropic Messages, /provider/v1/messageshttps://api.commandcode.ai/provider
everything elseOpenAI Chat Completions, /provider/v1/chat/completionshttps://api.commandcode.ai/provider/v1

The key goes as a Bearer token for Chat Completions and as x-api-key for Messages, as the Provider API documents. typesafe/* decision models are left out because they run on a separate endpoint and never stream.

The catalog is a cache

The extension reads the model list from https://api.commandcode.ai/provider/v1/models and writes it to <agent-dir>/pi-commandcode-models.json. A session starts from that file and fetches when it is missing or more than a day old, so a new model shows up without a manual refresh, and a cold start still does not wait on the network. When the fetch fails, the older file is used rather than an empty list, because a catalog only grows.

Use

export COMMAND_CODE_API_KEY="user_..."
pi --provider commandcode --model claude-opus-5

Inside pi, /model lists every commandcode model. The list refreshes each time the selector opens, with the cache as the offline answer.

Install

  • An API key from a plan with API access: GOAT, Pro, Max, Team or Provider. The Go and $1 plans have no API access.
  • Pi 1.4 or newer.
  • Network access to api.commandcode.ai with a 10 second fetch timeout.
pi install npm:@tduyng/pi-commandcode
export COMMAND_CODE_API_KEY="user_..."
VariableMeaning
COMMAND_CODE_API_KEYProvider API key, required for requests
CMD_ZDR=1Sends x-cmd-zdr: 1, so requests go only to zero-data-retention upstreams. A model without one fails with HTTP 422

Limits

  • The catalog carries no image or price metadata, so every model is text-only and shows zero cost in pi.

  • Thinking is on for every model, and pi levels map to reasoning_effort with minimal sending low.

  • off is offered only for the DeepSeek ids that accept it, because a model that cannot stop thinking rejects off with HTTP 400.

  • Claude 4.6 and newer use adaptive thinking, and the 4.5 models take a thinking budget.

  • Every model gets a 32768 output limit, the smallest in the Command Code CLI catalog, because per-model limits are not in the Provider API.

  • Chat Completions is used for every non-Claude model, as the docs say. A model that rejects that wire returns its own error.

  • Messages requests carry pi's ?beta=true query string, added by the Anthropic SDK.

  • If no models appear, check the network and the key, then open /model again.