Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

omp-commandcode-provider

A dependency-free OMP extension for using Command Code subscription/API-key models from omp.

This project is an OMP adaptation of ninehills/pi-commandcode-provider. It preserves Command Code's authenticated CLI transport, streaming, tool calls, thinking blocks, abort handling, browser-assisted login, and model registry, while using OMP's native extension API and install layout.

This is an unofficial, community-maintained extension. It is not affiliated with or endorsed by Command Code.

Security And Dependencies

  • Runtime dependencies: none.
  • Install-time dependencies: none. Install by cloning source into OMP's native extension directory; do not run npm install.
  • Runtime imports are only tracked local source files, models.json, and Node built-ins. Its OMP ExtensionAPI import is type-only and erased at runtime.
  • It does not contain an API key. Prefer OMP's interactive /login flow, which stores the credential in OMP's permission-restricted agent.db auth store. COMMAND_CODE_API_KEY remains available for headless environments.
  • models.json is committed source data rather than fetched or executed during installation.

Go Plan Transport Boundary

The $1 Go plan includes Command Code CLI usage, but Command Code documents Provider API access as a separate Provider plan. This adapter therefore sends generation requests through the same authenticated internal CLI endpoint, /alpha/generate, using the user's existing Command Code token. It does not send inference requests to /provider/v1 and does not require a custom API.

The public /provider/v1/models endpoint is used only by the opt-in development drift check. The internal generation endpoint is unofficial and may change in a future Command Code release, so compatibility is pinned and tested against Command Code CLI 1.32.1.

Install

Clone the extension source locally:

mkdir -p ~/.omp/agent/extensions
git clone https://github.com/rabesss/omp-commandcode-provider.git \
~/.omp/agent/extensions/omp-commandcode-provider

Then add the verified explicit extension path to ~/.omp/agent/config.yml:

extensions:
- ~/.omp/agent/extensions/omp-commandcode-provider

OMP also documents native package-directory discovery through the included omp.extensions manifest, but the explicit entry is the reliable installation path tested against OMP 17.4.2.

No package-manager install or build step is required. Restart omp, then verify registration:

omp models commandcode

To update:

git -C ~/.omp/agent/extensions/omp-commandcode-provider pull --ff-only

Alternative Checkout Path

If you prefer to keep the checkout elsewhere, use that absolute directory in the same extensions setting:

extensions:
- /path/to/omp-commandcode-provider

Authentication

API Key

For headless environments, create or edit ~/.omp/agent/.env:

mkdir -p ~/.omp/agent
printf'%s\n''COMMAND_CODE_API_KEY=user_...'>>~/.omp/agent/.env
chmod 600 ~/.omp/agent/.env

Do not commit that file or paste real credentials into issues. COMMANDCODE_API_KEY remains accepted as a legacy alias; the canonical current Command Code variable takes precedence when both are set. A credential saved by OMP's /login flow takes precedence over either environment fallback.

Browser-Assisted Login

In interactive OMP, run:

/login

Select Command Code. The extension opens Command Code Studio and accepts a one-time localhost callback on a listener bound to 127.0.0.1, matching the current CLI contract and CSRF state. Current callback identity metadata is preserved when present; the prior {apiKey,state} shape remains accepted for compatibility. Wrong-state callbacks are rejected before any success response. If automatic callback transfer is unavailable, it prompts for the API key from the browser after the CLI-compatible two-minute window. OMP 17 accepts the returned API key directly and stores it in ~/.omp/agent/agent.db. Older OAuth-shaped saved credentials remain readable for compatibility. The provider uses OMP's saved credential even when a stale Command Code key remains in ~/.omp/agent/.env. When OMP still contains older OAuth-shaped Command Code rows, the most recently pasted login API key is pinned in memory for the request; the extension does not rewrite or delete the credential database.

When the browser cannot reach loopback callbacks in a known environment, set COMMANDCODE_AUTH_TIMEOUT_MS to a shorter positive millisecond value to reach the manual paste fallback sooner.

The provider also retains the original compatibility fallback for ~/.commandcode/auth.json and legacy ~/.pi/agent/auth.json credential files. Its manifest retains pi.extensions as a compatibility alias in addition to the OMP-native omp.extensions declaration.

Usage

Use a qualified OMP model selector:

omp --model commandcode/gpt-5.4
omp -p --model commandcode/deepseek/deepseek-v4-flash "Reply briefly."

Do not use --provider commandcode: OMP resolves extension-defined providers through qualified --model commandcode/<model-id> selectors.

Models

The committed registry matches the 58 models currently exposed by the Command Code Provider API and the reviewed Command Code CLI 1.32.1 catalog:

FamilyModel IDs
Anthropicclaude-sonnet-5, claude-sonnet-4-6, claude-fable-5, claude-opus-5, claude-opus-4-8, claude-opus-4-7, claude-haiku-4-5-20251001
OpenAIgpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.4, gpt-5.3-codex, gpt-5.4-mini
DeepSeekdeepseek/deepseek-v4-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-flash-vision-exp
Moonshotmoonshotai/Kimi-K3, moonshotai/Kimi-K2.7-Code, moonshotai/Kimi-K2.7-Code-Highspeed, moonshotai/Kimi-K2.6, moonshotai/Kimi-K2.5
Z.AIzai-org/GLM-5.3, zai-org/GLM-5.2, zai-org/GLM-5.2-Fast, zai-org/GLM-5.1, zai-org/GLM-5
MiniMaxMiniMaxAI/MiniMax-M3, MiniMaxAI/MiniMax-M2.7, MiniMaxAI/MiniMax-M2.5
QwenQwen/Qwen3.8-Max, Qwen/Qwen3.8-27B, Qwen/Qwen3.7-Max, Qwen/Qwen3.7-Plus, Qwen/Qwen3.7-Flash, Qwen/Qwen3.6-Max-Preview, Qwen/Qwen3.6-Plus
StepFunstepfun/Step-3.7-Flash, stepfun/Step-3.5-Flash
Xiaomixiaomi/mimo-v2.5-pro, xiaomi/mimo-v2.5
Tencenttencent/hy3-paid
Googlegoogle/gemini-3.7-flash, google/gemini-3.6-flash, google/gemini-3.5-flash, google/gemini-3.5-flash-lite, google/gemini-3.1-flash-lite
Sakanasakana/fugu-ultra
NVIDIAnvidia/nemotron-3-ultra-550b-a55b
Thinking Machinesthinkingmachines/inkling, thinkingmachines/inkling-small
Stealthstealth/ox-alpha
Poolsidepoolside/laguna-s-2.1-free
Metameta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
xAIxai/grok-4.5, xai/grok-4.6

The pricing/limits docs currently contain 61 rows: all 58 API models, one active docs-only model (claude-opus-4-6), and two deprecated models (ling-3.0-flash-free and claude-sonnet-4-5). The extension never registers docs-only or deprecated rows automatically. Exactly 36 of the 58 API models are currently listed for Individual Go.

The extension preserves all 58 API models instead of filtering by account plan, because plan access can change independently of a release. Models outside Go are marked in the committed descriptions, and a recognizable upstream plan-entitlement error gains an Individual Go hint. Command Code remains the authority on actual account access.

Catalog Sources And Automatic Fields

models.json is an offline reviewed snapshot with explicit source boundaries:

  • Provider API: exact live IDs, display names, context windows, and ordering.
  • Pricing/limits docs: plan availability, text/vision/reasoning flags, input and output rates, cache-read and five-minute cache-write rates, tier boundaries, deals, future price notes, and deprecation state.
  • Command Code CLI 1.32.1: maximum output, reasoning-effort choices, input modalities, descriptions, and vendor/provider labels. These fields remain manual because the CLI exposes no supported rich catalog endpoint.
  • Reviewed conflict records: source disagreements and their dated decision.

This means source-exposed fields can be checked and proposed automatically. New models are report-only until every CLI-only rich field has been reviewed; the maintenance command never invents them or mutates models.json.

OMP accepts one flat cost per token dimension. The extension therefore uses the first documented tier. Permanent/current deal rates are reflected, while a date-bounded deal uses its first-tier list rate so the committed estimate does not silently expire. Time-of-day prices use the documented peak rate so the single OMP estimate never understates a possible charge. A missing cache dimension is stored as unsupported rather than as a source price of zero. These are advisory estimates only; tiers, deals, and the final bill remain authoritative in Command Code Studio Usage.

The extension applies two runtime metadata corrections without altering the audited registry: gpt-5.3-codex is exposed with a 272K usable input context because its 128K output budget is separate in OMP, and the DeepSeek models are exposed with 200K maximum output because the Command Code gateway currently rejects larger max_tokens requests.

The provider also registers vision-capable models with ["text", "image"] modalities so OMP can route image-enabled tasks (for example inspect_image) to models that support vision in the Command Code CLI catalog. For those models, user image blocks are serialized to Command Code's current { type: "image", image: "data:<mime>;base64,...", mimeType: "<mime>" } wire format; text-only models keep a placeholder instead of silently dropping attachments.

Check both public sources without installing or executing npm package contents:

npm run models:check
npm run models:proposal
node --test tests/test-model-catalog.ts tests/test-model-registry.ts

models:check is read-only and distinguishes catalog drift, transient network failure, and structural extraction failure. It validates both the Provider API and the official pricing page against strict shape/count/mapping invariants. models:proposal emits a deterministic old/new report with writesPerformed: false; it does not update the runtime catalog. The weekly workflow uses the same read-only check.

Features

  • Streaming text responses and reasoning/thinking blocks.
  • Live reasoning deltas, explicit terminal-event validation, and truncated-stream detection.
  • OMP tool-call serialization and tool-result round trips.
  • OMP 17 JSON Schema forwarding, including callable schemas, $defs, $ref, unions, descriptions, and constraints.
  • OMP temperature, reasoning effort, session ID, first-event timeout, and idle timeout options.
  • Request cancellation and stream cleanup.
  • Bounded transient retries only before provider content is observed; API keys are redacted from surfaced HTTP and stream errors.
  • Command Code usage/cost reporting from the included model registry.
  • API-key environment authentication.
  • Browser-assisted /login with localhost callback, CSRF state validation, and manual key fallback.
  • Optional request/response payload hooks retained from the upstream provider.

Development And Verification

Installing the extension does not require these commands. Contributors can run the test suite with Node.js 22.18 or newer, which provides unflagged node:sqlite support and executes TypeScript by default without installing a transpiler:

node --version
node --test tests/test-pure-functions.ts tests/test-oauth.ts \
tests/test-abort.ts tests/test-stream.ts tests/test-retry.ts \
tests/test-model-catalog.ts tests/test-model-registry.ts
OMP_BIN="$(command -v omp)" node tests/test-omp-local.mjs

tests/test-omp-local.mjs starts a local mock Command Code endpoint and exercises the actual omp binary in both print and RPC modes without sending a credential to Command Code. With the existing Command Code credential, run the live smoke test explicitly. The direct adapter test reads the existing enabled OMP credential without printing it, pins the free Laguna model, caps output at eight tokens, and validates stream completion plus usage. The OMP-level test is also pinned to Laguna and will reject model overrides rather than risk a billed fallback. Command Code can still reject the free model for capacity or account state.

npm run test:live

Compatibility Sources

License

MIT. This adaptation retains the upstream MIT-licensed implementation and credits the original provider above.

About

Dependency-free OMP extension for Command Code subscription/API-key models

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages