@gururea/opencode-commandcode-provider 0.3.0 → 0.4.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/README.md +1 -9
- package/dist/index.js +54 -629
- package/package.json +2 -8
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -763
package/README.md
CHANGED
|
@@ -25,17 +25,13 @@ Restart opencode, then:
|
|
|
25
25
|
|
|
26
26
|
## What the plugin does
|
|
27
27
|
|
|
28
|
-
- **Registers the provider.** The plugin injects a `commandcode` custom provider into the opencode config (`@ai-sdk/openai-compatible`, base URL `https://api.commandcode.ai/provider/v1`).
|
|
28
|
+
- **Registers the provider.** The plugin injects a `commandcode` custom provider into the opencode config (`@ai-sdk/openai-compatible`, base URL `https://api.commandcode.ai/provider/v1`). Claude models are routed to Command Code's Anthropic-compatible endpoint via the native `@ai-sdk/anthropic` SDK.
|
|
29
29
|
- **Live model discovery with caching.** The catalog is fetched from the Provider API at every startup. A successful fetch is cached to disk (`~/.cache/opencode/commandcode-models.json`) so the next start is fast and works offline; if both the endpoint and the cache are unavailable, a built-in fallback catalog keeps the provider visible.
|
|
30
30
|
- **Adds authentication.** The `/connect` dialog gets two methods via the plugin `auth` hook:
|
|
31
31
|
- **Browser login:** opens `commandcode.ai/studio/auth/cli` and receives the API key through a local callback server (fall back to pasting the key if the transfer fails).
|
|
32
32
|
- **API key:** the standard key-paste dialog.
|
|
33
|
-
- **`commandcode_quota` tool / `/commandcode-quota`.** Reports your account usage and quota: remaining and used credits, plan, billing-period usage (cost, requests, tokens), and the 5-hour and weekly usage windows.
|
|
34
|
-
- **`commandcode_status` tool / `/commandcode-status`.** Shows plugin diagnostics: catalog source (live/cache/fallback), model count, last fetch time, endpoint, zero-data-retention setting, and version.
|
|
35
33
|
- Command Code API keys (`user_...`) do not expire, so they are stored once and reused.
|
|
36
34
|
|
|
37
|
-
> On startup the plugin installs `commandcode-quota.md` and `commandcode-status.md` into your project's `.opencode/command/` directory, so the commands appear in the TUI autocomplete. Each command uses a shell block that runs a bundled CLI (`node <package>/dist/cli.js …`), so the output is produced deterministically — it does not rely on the model to call a tool.
|
|
38
|
-
|
|
39
35
|
## Environment variables
|
|
40
36
|
|
|
41
37
|
| Variable | Purpose |
|
|
@@ -47,10 +43,6 @@ Restart opencode, then:
|
|
|
47
43
|
| `COMMANDCODE_MODELS_TIMEOUT_MS` | Model catalog fetch timeout (default `10000` ms) |
|
|
48
44
|
| `CMD_ZDR=1` / `COMMANDCODE_ZDR=1` | Send the `x-cmd-zdr: 1` zero-data-retention header |
|
|
49
45
|
|
|
50
|
-
## Scope
|
|
51
|
-
|
|
52
|
-
Claude models (`claude-*`) are excluded: they are served through Command Code's Anthropic-compatible endpoint, which is outside the OpenAI-compatible scope of this MVP.
|
|
53
|
-
|
|
54
46
|
## Development
|
|
55
47
|
|
|
56
48
|
```sh
|