omp packages

@tduyng/pi-commandcode0.0.4

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

tienduy-nguyen Published 4 hours ago Apache-2.0 ~392 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

@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 id Wire Base URL
claude-* Anthropic Messages, /provider/v1/messages https://api.commandcode.ai/provider
everything else OpenAI Chat Completions, /provider/v1/chat/completions https://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>/commandcode-models.json. A session starts from that file and fetches only when it is missing or when /model refreshes, so a cold start does not wait on the network and an offline session still lists the models it had.

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

Local checkout: pi install /path/to/dotfiles/pi/agent/extensions/pi-commandcode

export COMMAND_CODE_API_KEY="user_..."
Variable Meaning
COMMAND_CODE_API_KEY Provider API key, required for requests
CMD_ZDR=1 Sends 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.