Skip to content

Commit b3dd4bb

Browse files
feat: rename package to @brainervirus/opencode-commandcode (#5)
Match OpenCode's opencode-<thing> plugin convention and drop the redundant go/provider suffix. GitHub repo is already opencode-commandcode. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 94be56e commit b3dd4bb

7 files changed

Lines changed: 29 additions & 30 deletions

File tree

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# @brainervirus/commandcode-go-opencode-provider
1+
# @brainervirus/opencode-commandcode
22

3-
[![npm version](https://img.shields.io/npm/v/@brainervirus/commandcode-go-opencode-provider)](https://www.npmjs.com/package/@brainervirus/commandcode-go-opencode-provider)
4-
[![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)
3+
[![npm version](https://img.shields.io/npm/v/@brainervirus/opencode-commandcode)](https://www.npmjs.com/package/@brainervirus/opencode-commandcode)
4+
[![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)
55
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
66

77
[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.
88

99
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`.
1010

11+
Previously published as `@brainervirus/commandcode-go-opencode-provider`. Use this name instead.
12+
1113
## Credits
1214

1315
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
2628

2729
```json
2830
{
29-
"plugin": ["@brainervirus/commandcode-go-opencode-provider@latest"]
31+
"plugin": ["@brainervirus/opencode-commandcode@latest"]
3032
}
3133
```
3234

@@ -40,7 +42,7 @@ This plugin supplies model metadata. Point OpenCode at Command Code's documented
4042

4143
```json
4244
{
43-
"plugin": ["@brainervirus/commandcode-go-opencode-provider@latest"],
45+
"plugin": ["@brainervirus/opencode-commandcode@latest"],
4446
"provider": {
4547
"commandcode": {
4648
"npm": "@ai-sdk/openai-compatible",
@@ -66,13 +68,13 @@ Run `/connect` in opencode, search for **Command Code**, and enter your API key,
6668

6769
## Optional local CLI override
6870

69-
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.
71+
Maintainers only. OpenCode will scrape a local `command-code` install when `COMMANDCODE_PACKAGE_PATH` or `commandCodePackagePath` in `~/.config/opencode/opencode-commandcode.json` is set.
7072

7173
## Development
7274

7375
```bash
74-
git clone https://github.com/BrainerVirus/opencode-commandcode-provider.git
75-
cd opencode-commandcode-provider
76+
git clone https://github.com/BrainerVirus/opencode-commandcode.git
77+
cd opencode-commandcode
7678
bun install
7779
bun run check # oxlint + oxfmt + bun test + tsc (same stack as workit)
7880
```

opencode.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://opencode.ai/config.json",
33
"model": "commandcode/deepseek-v4-flash",
44
"small_model": "commandcode/deepseek-v4-flash",
5-
"plugin": ["@brainervirus/commandcode-go-opencode-provider/server"],
5+
"plugin": ["@brainervirus/opencode-commandcode/server"],
66
"provider": {
77
"commandcode": {
88
"npm": "@ai-sdk/openai-compatible",

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@brainervirus/commandcode-go-opencode-provider",
2+
"name": "@brainervirus/opencode-commandcode",
33
"version": "0.5.0",
44
"description": "Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code",
55
"keywords": [
@@ -18,15 +18,15 @@
1818
"opencode-provider",
1919
"qwen"
2020
],
21-
"homepage": "https://github.com/BrainerVirus/opencode-commandcode-provider#readme",
21+
"homepage": "https://github.com/BrainerVirus/opencode-commandcode#readme",
2222
"bugs": {
23-
"url": "https://github.com/BrainerVirus/opencode-commandcode-provider/issues"
23+
"url": "https://github.com/BrainerVirus/opencode-commandcode/issues"
2424
},
2525
"license": "MIT",
2626
"author": "Brent Weatherall",
2727
"repository": {
2828
"type": "git",
29-
"url": "git+https://github.com/BrainerVirus/opencode-commandcode-provider.git"
29+
"url": "git+https://github.com/BrainerVirus/opencode-commandcode.git"
3030
},
3131
"files": [
3232
"index.ts",

plugin.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ interface PluginFileConfig {
2727
}
2828

2929
function loadPluginConfig(): PluginFileConfig {
30-
const configPath = join(
31-
homedir(),
32-
".config",
33-
"opencode",
34-
"commandcode-go-opencode-provider.json",
35-
);
36-
if (!existsSync(configPath)) return {};
30+
const dir = join(homedir(), ".config", "opencode");
31+
const configPath = [
32+
join(dir, "opencode-commandcode.json"),
33+
join(dir, "commandcode-go-opencode-provider.json"),
34+
].find((p) => existsSync(p));
35+
if (!configPath) return {};
3736
try {
3837
return JSON.parse(readFileSync(configPath, "utf-8"));
3938
} catch {

src/costs-models-dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export async function fetchModelsDevJson(): Promise<string> {
112112
headers: {
113113
// ponytail: models.dev returns 403 without a browser-like UA; upgrade if they add a real API token
114114
"User-Agent":
115-
"Mozilla/5.0 (compatible; commandcode-go-opencode-provider/0.5; +https://github.com/BrainerVirus/opencode-commandcode-provider)",
115+
"Mozilla/5.0 (compatible; opencode-commandcode/0.5; +https://github.com/BrainerVirus/opencode-commandcode)",
116116
Accept: "application/json",
117117
},
118118
});

tests/unit/catalog-break.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ describe("renderCatalogBreakBody", () => {
1818
const body = renderCatalogBreakBody({
1919
commandCodeVersion: "1.39.0",
2020
error: "Could not evaluate model catalog",
21-
workflowUrl: "https://github.com/BrainerVirus/opencode-commandcode-provider/actions/runs/1",
21+
workflowUrl: "https://github.com/BrainerVirus/opencode-commandcode/actions/runs/1",
2222
bundledCommandCodeVersion: "1.38.1",
2323
});
2424
expect(body).toContain("command-code@1.39.0");
2525
expect(body).toContain("Could not evaluate model catalog");
26-
expect(body).toContain(
27-
"https://github.com/BrainerVirus/opencode-commandcode-provider/actions/runs/1",
28-
);
26+
expect(body).toContain("https://github.com/BrainerVirus/opencode-commandcode/actions/runs/1");
2927
expect(body).toContain("1.38.1");
3028
expect(body).toContain("src/catalog.ts");
3129
});

tests/unit/release-workflow.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const json = <T>(rel: string) => JSON.parse(read(rel)) as T;
99
const NPMJS = "${{ secrets.NPMJS }}";
1010

1111
describe("package.json publish identity", () => {
12-
test("is the scoped public package on BrainerVirus/opencode-commandcode-provider", () => {
12+
test("is the scoped public package on BrainerVirus/opencode-commandcode", () => {
1313
const pkg = json<{
1414
name: string;
1515
publishConfig?: { access?: string };
@@ -19,11 +19,11 @@ describe("package.json publish identity", () => {
1919
files?: string[];
2020
scripts?: Record<string, string>;
2121
}>("package.json");
22-
expect(pkg.name).toBe("@brainervirus/commandcode-go-opencode-provider");
22+
expect(pkg.name).toBe("@brainervirus/opencode-commandcode");
2323
expect(pkg.publishConfig?.access).toBe("public");
24-
expect(pkg.repository?.url).toContain("BrainerVirus/opencode-commandcode-provider");
25-
expect(pkg.bugs?.url).toContain("BrainerVirus/opencode-commandcode-provider");
26-
expect(pkg.homepage).toContain("BrainerVirus/opencode-commandcode-provider");
24+
expect(pkg.repository?.url).toContain("BrainerVirus/opencode-commandcode");
25+
expect(pkg.bugs?.url).toContain("BrainerVirus/opencode-commandcode");
26+
expect(pkg.homepage).toContain("BrainerVirus/opencode-commandcode");
2727
expect(pkg.files).toContain("manifest.json");
2828
expect(pkg.scripts?.["verify:release-candidate"]).toContain("verify-release-candidate.ts");
2929
expect(pkg.scripts?.lint).toContain("oxlint --deny-warnings");

0 commit comments

Comments
 (0)