A custom provider for pi that connects to the Command Code Provider API.
Disclaimer: This is an unofficial, community-maintained integration. It is not affiliated with, endorsed by, or supported by Command Code. You need your own Command Code account and API key or subscription. Command Code's terms, availability, and pricing apply.
pi install npm:pi-commandcode-providerStart or reload pi, then authenticate:
/loginSelect Use a subscription, then Command Code. Complete the browser flow and choose a model with /model.
Install the same package in Oh My Pi:
omp plugin install pi-commandcode-providerRestart OMP or run /reload, then use /login and select Use a subscription followed by Command Code.
Run /login in pi or OMP. Select Use a subscription, then Command Code. The browser flow stores the returned credential in the host's auth file.
If automatic transfer from the browser fails, copy the API key shown by Command Code and paste it into the terminal prompt.
export COMMANDCODE_API_KEY="user_..."The provider also reads existing credentials from:
~/.commandcode/auth.json~/.pi/agent/auth.json~/.omp/agent/auth.json
Supported examples:
{
"apiKey": "user_..."
}{
"command-code": {
"type": "api",
"key": "user_..."
}
}{
"commandcode": "user_..."
}Open /model and select one of the models provided by Command Code. Model availability changes over time and is refreshed from the Provider API when the extension loads.
List Command Code models from the terminal:
pi --list-models commandcodeIn OMP, use:
omp modelsFor non-interactive OMP requests, use a provider-qualified model ID shown by omp models. For example:
omp -p "hello" --model commandcode/deepseek/deepseek-v4-flashThe provider fetches the current model catalog from:
https://api.commandcode.ai/provider/v1/modelsThe last successful catalog is cached at <agent-dir>/commandcode-models.json. For pi this is ~/.pi/agent/commandcode-models.json by default. Compatible hosts such as OMP use their own agent directory.
If the endpoint is temporarily unavailable, the provider uses the cached catalog. On a first offline start without a cache, pi still loads, but Command Code models remain unavailable until the connection is restored and /reload succeeds.
The following environment variables are intended for tests, local mocks, and compatible API endpoints:
COMMANDCODE_API_BASECOMMANDCODE_MODELS_URLCOMMANDCODE_MODELS_CACHE
The Command Code Provider API does not currently include prices in its model catalog. This extension therefore keeps a static table for models with known prices so pi can display estimated request costs.
Models missing from that table display zero cost in pi. This does not mean that Command Code will bill the request at zero. Check the current Command Code pricing before relying on the displayed value.
Update installed pi packages:
pi update --extensionsRemove the provider:
pi remove npm:pi-commandcode-providerFor OMP:
omp plugin upgrade pi-commandcode-provider
omp plugin uninstall pi-commandcode-providerSee CONTRIBUTING.md for local setup and tests. See RELEASE.md for the release process.
MIT