From 3a40952dba293530eb3b117323895bac81395520 Mon Sep 17 00:00:00 2001 From: Cristhofer Pincetti Date: Fri, 28 Aug 2026 16:11:10 -0400 Subject: [PATCH] feat: rename package to @brainervirus/opencode-commandcode Match OpenCode's opencode- plugin convention and drop the redundant go/provider suffix. GitHub repo is already opencode-commandcode. Co-authored-by: Cursor --- README.md | 18 ++++++++++-------- opencode.json | 2 +- package.json | 8 ++++---- plugin.ts | 13 ++++++------- src/costs-models-dev.ts | 2 +- tests/unit/catalog-break.test.ts | 6 ++---- tests/unit/release-workflow.test.ts | 10 +++++----- 7 files changed, 29 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 0fd11c7..04af56c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ -# @brainervirus/commandcode-go-opencode-provider +# @brainervirus/opencode-commandcode -[![npm version](https://img.shields.io/npm/v/@brainervirus/commandcode-go-opencode-provider)](https://www.npmjs.com/package/@brainervirus/commandcode-go-opencode-provider) -[![CI](https://img.shields.io/github/actions/workflow/status/BrainerVirus/opencode-commandcode-provider/ci.yml?branch=main&label=CI)](https://github.com/BrainerVirus/opencode-commandcode-provider/actions) +[![npm version](https://img.shields.io/npm/v/@brainervirus/opencode-commandcode)](https://www.npmjs.com/package/@brainervirus/opencode-commandcode) +[![CI](https://img.shields.io/github/actions/workflow/status/BrainerVirus/opencode-commandcode/ci.yml?branch=main&label=CI)](https://github.com/BrainerVirus/opencode-commandcode/actions) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [Command Code](https://commandcode.ai) API provider for [opencode](https://opencode.ai). Use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, Step, and other models through a single API key. This package keeps a **bundled** model catalog current via CI. You do **not** need a local `command-code` CLI. Catalog patches publish automatically after a green PR merges to `main`. +Previously published as `@brainervirus/commandcode-go-opencode-provider`. Use this name instead. + ## Credits This package is based on **[FanFan4204/opencode-commandcode-provider](https://github.com/FanFan4204/opencode-commandcode-provider)**. That work started from **[brent-weatherall/opencode-commandcode-provider](https://github.com/brent-weatherall/opencode-commandcode-provider)** by **[Brent Weatherall](https://github.com/brent-weatherall)**. Thank you both — FanFan for the OpenCode provider this repo continues, and Brent for the original plugin, catalog extraction, and Command Code wiring. The license remains MIT; copyright stays with Brent Weatherall. @@ -26,7 +28,7 @@ This package is based on **[FanFan4204/opencode-commandcode-provider](https://gi ```json { - "plugin": ["@brainervirus/commandcode-go-opencode-provider@latest"] + "plugin": ["@brainervirus/opencode-commandcode@latest"] } ``` @@ -40,7 +42,7 @@ This plugin supplies model metadata. Point OpenCode at Command Code's documented ```json { - "plugin": ["@brainervirus/commandcode-go-opencode-provider@latest"], + "plugin": ["@brainervirus/opencode-commandcode@latest"], "provider": { "commandcode": { "npm": "@ai-sdk/openai-compatible", @@ -66,13 +68,13 @@ Run `/connect` in opencode, search for **Command Code**, and enter your API key, ## Optional local CLI override -Maintainers only. OpenCode will scrape a local `command-code` install when `COMMANDCODE_PACKAGE_PATH` or `commandCodePackagePath` in `~/.config/opencode/commandcode-go-opencode-provider.json` is set. +Maintainers only. OpenCode will scrape a local `command-code` install when `COMMANDCODE_PACKAGE_PATH` or `commandCodePackagePath` in `~/.config/opencode/opencode-commandcode.json` is set. ## Development ```bash -git clone https://github.com/BrainerVirus/opencode-commandcode-provider.git -cd opencode-commandcode-provider +git clone https://github.com/BrainerVirus/opencode-commandcode.git +cd opencode-commandcode bun install bun run check # oxlint + oxfmt + bun test + tsc (same stack as workit) ``` diff --git a/opencode.json b/opencode.json index c2fcee1..0d850e9 100644 --- a/opencode.json +++ b/opencode.json @@ -2,7 +2,7 @@ "$schema": "https://opencode.ai/config.json", "model": "commandcode/deepseek-v4-flash", "small_model": "commandcode/deepseek-v4-flash", - "plugin": ["@brainervirus/commandcode-go-opencode-provider/server"], + "plugin": ["@brainervirus/opencode-commandcode/server"], "provider": { "commandcode": { "npm": "@ai-sdk/openai-compatible", diff --git a/package.json b/package.json index 49e99cd..dfdcce0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@brainervirus/commandcode-go-opencode-provider", + "name": "@brainervirus/opencode-commandcode", "version": "0.5.0", "description": "Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code", "keywords": [ @@ -18,15 +18,15 @@ "opencode-provider", "qwen" ], - "homepage": "https://github.com/BrainerVirus/opencode-commandcode-provider#readme", + "homepage": "https://github.com/BrainerVirus/opencode-commandcode#readme", "bugs": { - "url": "https://github.com/BrainerVirus/opencode-commandcode-provider/issues" + "url": "https://github.com/BrainerVirus/opencode-commandcode/issues" }, "license": "MIT", "author": "Brent Weatherall", "repository": { "type": "git", - "url": "git+https://github.com/BrainerVirus/opencode-commandcode-provider.git" + "url": "git+https://github.com/BrainerVirus/opencode-commandcode.git" }, "files": [ "index.ts", diff --git a/plugin.ts b/plugin.ts index bb8b346..5f67818 100644 --- a/plugin.ts +++ b/plugin.ts @@ -27,13 +27,12 @@ interface PluginFileConfig { } function loadPluginConfig(): PluginFileConfig { - const configPath = join( - homedir(), - ".config", - "opencode", - "commandcode-go-opencode-provider.json", - ); - if (!existsSync(configPath)) return {}; + const dir = join(homedir(), ".config", "opencode"); + const configPath = [ + join(dir, "opencode-commandcode.json"), + join(dir, "commandcode-go-opencode-provider.json"), + ].find((p) => existsSync(p)); + if (!configPath) return {}; try { return JSON.parse(readFileSync(configPath, "utf-8")); } catch { diff --git a/src/costs-models-dev.ts b/src/costs-models-dev.ts index d216956..1eb0bac 100644 --- a/src/costs-models-dev.ts +++ b/src/costs-models-dev.ts @@ -112,7 +112,7 @@ export async function fetchModelsDevJson(): Promise { headers: { // ponytail: models.dev returns 403 without a browser-like UA; upgrade if they add a real API token "User-Agent": - "Mozilla/5.0 (compatible; commandcode-go-opencode-provider/0.5; +https://github.com/BrainerVirus/opencode-commandcode-provider)", + "Mozilla/5.0 (compatible; opencode-commandcode/0.5; +https://github.com/BrainerVirus/opencode-commandcode)", Accept: "application/json", }, }); diff --git a/tests/unit/catalog-break.test.ts b/tests/unit/catalog-break.test.ts index 2f9f1ef..7093ad6 100644 --- a/tests/unit/catalog-break.test.ts +++ b/tests/unit/catalog-break.test.ts @@ -18,14 +18,12 @@ describe("renderCatalogBreakBody", () => { const body = renderCatalogBreakBody({ commandCodeVersion: "1.39.0", error: "Could not evaluate model catalog", - workflowUrl: "https://github.com/BrainerVirus/opencode-commandcode-provider/actions/runs/1", + workflowUrl: "https://github.com/BrainerVirus/opencode-commandcode/actions/runs/1", bundledCommandCodeVersion: "1.38.1", }); expect(body).toContain("command-code@1.39.0"); expect(body).toContain("Could not evaluate model catalog"); - expect(body).toContain( - "https://github.com/BrainerVirus/opencode-commandcode-provider/actions/runs/1", - ); + expect(body).toContain("https://github.com/BrainerVirus/opencode-commandcode/actions/runs/1"); expect(body).toContain("1.38.1"); expect(body).toContain("src/catalog.ts"); }); diff --git a/tests/unit/release-workflow.test.ts b/tests/unit/release-workflow.test.ts index ebad1c8..fb52428 100644 --- a/tests/unit/release-workflow.test.ts +++ b/tests/unit/release-workflow.test.ts @@ -9,7 +9,7 @@ const json = (rel: string) => JSON.parse(read(rel)) as T; const NPMJS = "${{ secrets.NPMJS }}"; describe("package.json publish identity", () => { - test("is the scoped public package on BrainerVirus/opencode-commandcode-provider", () => { + test("is the scoped public package on BrainerVirus/opencode-commandcode", () => { const pkg = json<{ name: string; publishConfig?: { access?: string }; @@ -19,11 +19,11 @@ describe("package.json publish identity", () => { files?: string[]; scripts?: Record; }>("package.json"); - expect(pkg.name).toBe("@brainervirus/commandcode-go-opencode-provider"); + expect(pkg.name).toBe("@brainervirus/opencode-commandcode"); expect(pkg.publishConfig?.access).toBe("public"); - expect(pkg.repository?.url).toContain("BrainerVirus/opencode-commandcode-provider"); - expect(pkg.bugs?.url).toContain("BrainerVirus/opencode-commandcode-provider"); - expect(pkg.homepage).toContain("BrainerVirus/opencode-commandcode-provider"); + expect(pkg.repository?.url).toContain("BrainerVirus/opencode-commandcode"); + expect(pkg.bugs?.url).toContain("BrainerVirus/opencode-commandcode"); + expect(pkg.homepage).toContain("BrainerVirus/opencode-commandcode"); expect(pkg.files).toContain("manifest.json"); expect(pkg.scripts?.["verify:release-candidate"]).toContain("verify-release-candidate.ts"); expect(pkg.scripts?.lint).toContain("oxlint --deny-warnings");