@telsoncc/opencode-commandcode 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,212 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.0.0] - 2026-09-21
11
+
12
+ ## [0.7.73] - 2026-09-21
13
+
14
+ ## [0.7.72] - 2026-09-20
15
+
16
+ ## [0.7.71] - 2026-09-19
17
+
18
+ ## [0.7.70] - 2026-09-19
19
+
20
+ ## [0.7.69] - 2026-09-18
21
+
22
+ ## [0.7.68] - 2026-09-18
23
+
24
+ ## [0.7.67] - 2026-09-18
25
+
26
+ ## [0.7.66] - 2026-09-17
27
+
28
+ ## [0.7.65] - 2026-09-16
29
+
30
+ ## [0.7.64] - 2026-09-16
31
+
32
+ ## [0.7.63] - 2026-09-14
33
+
34
+ ## [0.7.62] - 2026-09-12
35
+
36
+ ## [0.7.61] - 2026-09-10
37
+
38
+ ## [0.7.60] - 2026-09-09
39
+
40
+ ## [0.7.59] - 2026-09-09
41
+
42
+ ## [0.7.58] - 2026-09-09
43
+
44
+ ## [0.7.57] - 2026-09-08
45
+
46
+ ## [0.7.56] - 2026-09-08
47
+
48
+ ## [0.7.55] - 2026-09-06
49
+
50
+ ## [0.7.54] - 2026-09-05
51
+
52
+ ## [0.7.53] - 2026-09-05
53
+
54
+ ## [0.7.52] - 2026-09-04
55
+
56
+ ## [0.7.51] - 2026-09-04
57
+
58
+ ## [0.7.50] - 2026-09-03
59
+
60
+ ## [0.7.49] - 2026-09-03
61
+
62
+ ## [0.7.48] - 2026-09-02
63
+
64
+ ## [0.7.47] - 2026-09-02
65
+
66
+ ## [0.7.46] - 2026-09-02
67
+
68
+ ## [0.7.45] - 2026-09-02
69
+
70
+ ## [0.7.44] - 2026-09-02
71
+
72
+ ## [0.7.43] - 2026-09-02
73
+
74
+ ## [0.7.42] - 2026-09-02
75
+
76
+ ## [0.7.41] - 2026-09-02
77
+
78
+ ## [0.7.40] - 2026-09-02
79
+
80
+ ## [0.7.39] - 2026-09-02
81
+
82
+ ## [0.7.38] - 2026-09-02
83
+
84
+ ## [0.7.37] - 2026-09-02
85
+
86
+ ## [0.7.36] - 2026-09-02
87
+
88
+ ## [0.7.35] - 2026-09-02
89
+
90
+ ## [0.7.34] - 2026-09-02
91
+
92
+ ## [0.7.33] - 2026-09-02
93
+
94
+ ## [0.7.32] - 2026-09-02
95
+
96
+ ## [0.7.31] - 2026-09-02
97
+
98
+ ## [0.7.30] - 2026-09-02
99
+
100
+ ## [0.7.29] - 2026-09-02
101
+
102
+ ## [0.7.28] - 2026-09-02
103
+
104
+ ## [0.7.27] - 2026-09-02
105
+
106
+ ## [0.7.26] - 2026-09-02
107
+
108
+ ## [0.7.25] - 2026-09-02
109
+
110
+ ## [0.7.24] - 2026-09-02
111
+
112
+ ## [0.7.23] - 2026-09-02
113
+
114
+ ## [0.7.21] - 2026-09-02
115
+
116
+ ## [0.7.20] - 2026-09-02
117
+
118
+ ## [0.7.19] - 2026-09-02
119
+
120
+ ## [0.7.18] - 2026-09-02
121
+
122
+ ## [0.7.17] - 2026-09-02
123
+
124
+ ## [0.7.16] - 2026-09-02
125
+
126
+ ## [0.7.15] - 2026-09-02
127
+
128
+ ## [0.7.14] - 2026-09-02
129
+
130
+ ## [0.7.13] - 2026-09-02
131
+
132
+ ## [0.7.12] - 2026-09-02
133
+
134
+ ## [0.7.11] - 2026-09-02
135
+
136
+ ## [0.7.10] - 2026-09-02
137
+
138
+ ## [0.7.9] - 2026-09-02
139
+
140
+ ## [0.7.8] - 2026-09-02
141
+
142
+ ## [0.7.7] - 2026-09-02
143
+
144
+ ## [0.7.6] - 2026-09-02
145
+
146
+ ## [0.7.5] - 2026-09-02
147
+
148
+ ## [0.7.4] - 2026-09-01
149
+
150
+ ## [0.7.3] - 2026-09-01
151
+
152
+ ## [0.7.2] - 2026-08-31
153
+
154
+ ## [0.7.1] - 2026-08-29
155
+
156
+ ### Changed
157
+
158
+ - Catalog refresh and post-release manifest PRs auto-merge when required CI is green.
159
+
160
+ ### Fixed
161
+
162
+ - Startup summary test reads the bundled command-code version from the manifest instead of pinning one release.
163
+
164
+ ## [0.7.0] - 2026-08-28
165
+
166
+ ### Changed
167
+
168
+ - npm publishes only when plugin or catalog files change since the last tag — CI, tests, and scripts-only merges skip a release.
169
+
170
+ ### Added
171
+
172
+ - Catalog models include vision vs text-only from the Command Code CLI `inputModalities` field on every SKU. models.dev only adds extra inputs (video/audio/pdf) on matches.
173
+
174
+ ## [0.6.1] - 2026-08-28
175
+
176
+ ### Added
177
+
178
+ - semantic-release now cuts Keep a Changelog `[Unreleased]` into `## [version]` on publish and includes `CHANGELOG.md` in the post-release sync PR.
179
+
180
+ ### Fixed
181
+
182
+ - Catalog GitHub release notes table no longer renders a blank header row above Plugin.
183
+ - Credits sentence no longer mentions Command Code wiring or restates MIT copyright.
184
+
185
+ ## [0.6.0] - 2026-08-28
186
+
187
+ ### Changed
188
+
189
+ - Renamed the published package and GitHub repository to `@brainervirus/opencode-commandcode`.
190
+
191
+ ## [0.5.1] - 2026-08-28
192
+
193
+ ### Fixed
194
+
195
+ - Price Command Code free SKUs at `$0` before models.dev, and fill remaining paid gaps from models.dev.
196
+
197
+ ## [0.5.0] - 2026-08-28
198
+
199
+ ### Added
200
+
201
+ - GitHub flow: PR-gated `main`, CI matrix (`check (test|typecheck|pack)`), semantic-release on merge, catalog updates as PRs.
202
+ - Release notes open with a catalog summary table and collapsed lists of fallback / unpriced models.
203
+ - `manifest.json` describing the bundled catalog (status, cost sources, command-code version).
204
+ - First publish of `@brainervirus/commandcode-go-opencode-provider`.
205
+ - Last-good catalog cache and silent `startup.json` diagnostics under the plugin state dir.
206
+
207
+ ### Fixed
208
+
209
+ - Load the Command Code model catalog when CLI cost extraction fails (`command-code@1.38.x`).
210
+ - Stop plugin `console.log` / `console.warn` from leaking into the OpenCode loading UI.
211
+ - Default to bundled `models.json` (no local `command-code` install). Opt-in local scrape via `commandCodePackagePath` or `COMMANDCODE_PACKAGE_PATH`.
212
+ - Refresh bundled catalog from `command-code@1.38.1` and fill missing costs from official docs.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Brent Weatherall
4
+ Copyright (c) 2026 telsoncc
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # @telsoncc/opencode-commandcode
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@telsoncc/opencode-commandcode)](https://www.npmjs.com/package/@telsoncc/opencode-commandcode)
4
+ [![CI](https://img.shields.io/github/actions/workflow/status/telsoncc/opencode-commandcode/ci.yml?branch=main&label=CI)](https://github.com/telsoncc/opencode-commandcode/actions)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+
7
+ [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.
8
+
9
+ 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`.
10
+
11
+ Previously published as `@brainervirus/opencode-commandcode` (and before that `@brainervirus/commandcode-go-opencode-provider`). This fork publishes as `@telsoncc/opencode-commandcode` — use this name instead.
12
+
13
+ ## Credits
14
+
15
+ 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.
16
+
17
+ Forked and currently maintained by **[telsoncc](https://github.com/telsoncc)** (OpenCode 2.x support and ongoing catalog updates).
18
+
19
+ ### What this package adds
20
+
21
+ - Bundled `models.json` is the default runtime catalog (no local CLI scrape).
22
+ - CLI cost extraction can fail (as on `command-code@1.38.x`) without dropping models.
23
+ - Official docs fill missing costs; remaining paid gaps use [models.dev](https://models.dev) as a reference. Command Code free SKUs stay `$0`.
24
+ - Vision vs text-only comes from the Command Code CLI catalog (`inputModalities` on every SKU). [models.dev](https://models.dev) only adds extra inputs (video/audio/pdf) when it matches.
25
+ - Reasoning effort **variants** on models that declare `reasoningEfforts`.
26
+ - Quiet OpenCode startup (diagnostics go to `startup.json`, not stdout).
27
+ - Native **OpenCode 2.x** entrypoint (`plugin/opencode2`, also served as `server`):
28
+ in-memory provider inventory via `ctx.provider.transform` (no config writes)
29
+ plus a `commandcode` integration for `/connect`. See `docs/opencode-2.md`.
30
+
31
+ ## Quick Start
32
+
33
+ Use one entrypoint per host. OpenCode 1.x loads the classic plugin;
34
+ OpenCode 2.x loads the 2.0 entrypoint from the same package.
35
+
36
+ ### OpenCode 1.x — install the plugin
37
+
38
+ ```json
39
+ {
40
+ "plugin": ["@telsoncc/opencode-commandcode@latest"]
41
+ }
42
+ ```
43
+
44
+ Pin a version instead of `@latest` if you do not want automatic catalog patches.
45
+
46
+ `file://` checkouts are **not** updated by npm; `git pull` after CI commits, or switch to the npm plugin line.
47
+
48
+ ### OpenCode 1.x — provider transport (Command Code Provider API)
49
+
50
+ This plugin supplies model metadata. Point OpenCode at Command Code's documented Provider API:
51
+
52
+ ```json
53
+ {
54
+ "plugin": ["@telsoncc/opencode-commandcode@latest"],
55
+ "provider": {
56
+ "commandcode": {
57
+ "npm": "@ai-sdk/openai-compatible",
58
+ "name": "Command Code GOAT",
59
+ "env": ["COMMANDCODE_API_KEY"],
60
+ "options": {
61
+ "baseURL": "https://api.commandcode.ai/provider/v1"
62
+ }
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### OpenCode 2.x — install the plugin (no provider block needed)
69
+
70
+ ```jsonc
71
+ {
72
+ "plugins": ["@telsoncc/opencode-commandcode/plugin/opencode2"],
73
+ }
74
+ ```
75
+
76
+ The 2.0 entrypoint registers the `commandcode` provider (native
77
+ `openai-compatible` runtime, Provider API base URL) and its 71-model catalog
78
+ in memory — do **not** keep a hand-written `provider`/`providers.commandcode`
79
+ block (including models dumped by `bun run sync -- --update-global`): it
80
+ fights the plugin-owned inventory. `sync --update-global` is 1.x-only.
81
+ Full guide plus local-clone loading: `docs/opencode-2.md`.
82
+
83
+ Pin a version instead (insert `@<version>` before `/plugin/opencode2`) if you do not
84
+ want automatic catalog patches.
85
+
86
+ ### Connect
87
+
88
+ Run `/connect` in opencode, search for **Command Code**, and enter your API key, or set `COMMANDCODE_API_KEY`.
89
+
90
+ ### Select a model
91
+
92
+ ```
93
+ /models
94
+ ```
95
+
96
+ On 2.x the catalog carries no release dates, so filter the picker by provider
97
+ **Command Code** if the global list looks empty.
98
+
99
+ ## Optional local CLI override
100
+
101
+ Maintainers only. OpenCode will scrape a local `command-code` install when `COMMANDCODE_PACKAGE_PATH` or `commandCodePackagePath` in `~/.config/opencode/opencode-commandcode.json` is set.
102
+
103
+ ## Development
104
+
105
+ ```bash
106
+ git clone https://github.com/telsoncc/opencode-commandcode.git
107
+ cd opencode-commandcode
108
+ bun install
109
+ bun run check # oxlint + oxfmt + bun test + tsc (same stack as workit)
110
+ ```
111
+
112
+ ```bash
113
+ bun run sync -- --remote # refresh models.json + manifest.json from command-code@latest
114
+ ```
115
+
116
+ CI (`.github/workflows/catalog-sync.yml`) opens a PR every 6 hours when Command Code ships a new catalog. That PR, and the post-release `chore/manifest-sync-v*` PR, auto-merge after **check (test)**, **check (typecheck)**, **check (lint)**, **check (format)**, and **check (pack)** are green. `.github/workflows/release.yml` then runs **semantic-release** (npm publish + GitHub Release + tag). Do not push to `main`.
117
+
118
+ The GitHub Actions secret name is `NPMJS` (same as workit). It is mapped to both `NPM_TOKEN` and `NODE_AUTH_TOKEN`. Use an npm **Automation** token (bypasses 2FA). A login token from `~/.npmrc` fails CI with `EOTP`. Catalog PRs get a real CI run when `RELEASE_SYNC_TOKEN` (or `CATALOG_PUSH_TOKEN`) is a PAT; `GITHUB_TOKEN` can open the PR but GitHub will not start workflows from that event.
119
+
120
+ ## License
121
+
122
+ MIT — see [LICENSE](LICENSE). Original copyright [Brent Weatherall](https://github.com/brent-weatherall); modifications copyright [telsoncc](https://github.com/telsoncc).
package/_version.txt ADDED
@@ -0,0 +1 @@
1
+ 1.58.1
package/index.ts ADDED
@@ -0,0 +1,32 @@
1
+ import { resolveApiKey } from "./src/auth.js";
2
+ import { CommandCodeLanguageModel } from "./src/model.js";
3
+
4
+ export interface CommandCodeProviderOptions {
5
+ name?: string;
6
+ apiKey?: string;
7
+ baseURL?: string;
8
+ headers?: Record<string, string>;
9
+ authPaths?: string[];
10
+ }
11
+
12
+ export function createCommandCode(options: CommandCodeProviderOptions = {}) {
13
+ const apiKey = resolveApiKey({ apiKey: options.apiKey, authPaths: options.authPaths });
14
+ if (!apiKey) {
15
+ throw new Error(
16
+ "Command Code API key not found. Set COMMANDCODE_API_KEY env var, create ~/.commandcode/auth.json, or pass apiKey option.",
17
+ );
18
+ }
19
+
20
+ return {
21
+ languageModel(modelId: string): CommandCodeLanguageModel {
22
+ return new CommandCodeLanguageModel(modelId, {
23
+ apiKey,
24
+ baseURL: typeof options.baseURL === "string" ? options.baseURL : undefined,
25
+ headers:
26
+ typeof options.headers === "object" && options.headers !== null
27
+ ? (options.headers as Record<string, string>)
28
+ : undefined,
29
+ });
30
+ },
31
+ };
32
+ }
package/manifest.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "generatedAt": "2026-09-20T16:38:04.091Z",
4
+ "pluginVersion": "1.0.0",
5
+ "commandCodeVersion": "1.58.1",
6
+ "commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.58.1.tgz",
7
+ "modelCount": 71,
8
+ "reasoningModelCount": 61,
9
+ "extraction": {
10
+ "modelCatalog": "ok",
11
+ "costCatalog": "cli",
12
+ "costCatalogError": null
13
+ },
14
+ "costSources": {
15
+ "cli": 21,
16
+ "officialDocs": 50,
17
+ "thirdParty": 0,
18
+ "free": 0,
19
+ "fallback": 0,
20
+ "unmatched": 0
21
+ },
22
+ "review": {
23
+ "thirdParty": [],
24
+ "free": [],
25
+ "unmatched": [],
26
+ "unavailable": [
27
+ {
28
+ "id": "MiniMaxAI/MiniMax-M3-Free",
29
+ "reason": "not-listed-by-provider-api"
30
+ },
31
+ {
32
+ "id": "gpt-6-astra",
33
+ "reason": "not-listed-by-provider-api"
34
+ },
35
+ {
36
+ "id": "inclusionai/ling-3.0-flash-free",
37
+ "reason": "not-listed-by-provider-api"
38
+ },
39
+ {
40
+ "id": "meituan/LongCat-2.0:free",
41
+ "reason": "not-listed-by-provider-api"
42
+ },
43
+ {
44
+ "id": "minimax/minimax-m2.7-free",
45
+ "reason": "not-listed-by-provider-api"
46
+ },
47
+ {
48
+ "id": "minimax/minimax-m3-free",
49
+ "reason": "not-listed-by-provider-api"
50
+ },
51
+ {
52
+ "id": "tencent/Hy3",
53
+ "reason": "not-listed-by-provider-api"
54
+ }
55
+ ]
56
+ },
57
+ "status": "healthy"
58
+ }