@monotykamary/pi-opencode-provider 1.0.3 → 1.0.4

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.
Files changed (3) hide show
  1. package/README.md +7 -5
  2. package/index.ts +2 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -136,17 +136,19 @@ After loading the extension, use the `/model` command in pi to select your prefe
136
136
 
137
137
  Then select "opencode" as the provider and choose from the available models.
138
138
 
139
+ The default model for this provider is `kimi-k2.6` (matching pi core's built-in default); use `/model` to pick another.
140
+
139
141
  ## Authentication
140
142
 
141
- The opencode API key can be configured in multiple ways (resolved in this order):
143
+ The opencode API key can be configured in multiple ways. Credentials are resolved in this order:
142
144
 
143
- 1. **`auth.json`** (recommended)Add to `~/.pi/agent/auth.json`:
145
+ 1. **CLI flag**`--api-key` (highest priority, runtime override)
146
+ 2. **`auth.json`** (recommended) — Add to `~/.pi/agent/auth.json`:
144
147
  ```json
145
148
  { "opencode": { "type": "api_key", "key": "your-api-key" } }
146
149
  ```
147
- The `key` field supports literal values, env var names, and shell commands (prefix with `!`). See [pi's auth file docs](https://github.com/badlogic/pi-mono) for details.
148
- 2. **Runtime override** — Use the `--api-key` CLI flag
149
- 3. **Environment variable** — Set `OPENCODE_API_KEY`
150
+ The `key` field supports literals, `$ENV_VAR`/`${ENV_VAR}` interpolation, and `!command` execution. See [pi's providers docs](https://github.com/earendil-works/pi-coding-agent/blob/main/docs/providers.md) for details.
151
+ 3. **Environment variable** — `OPENCODE_API_KEY`
150
152
 
151
153
  ## Environment Variables
152
154
 
package/index.ts CHANGED
@@ -302,6 +302,7 @@ export default function (pi: ExtensionAPI) {
302
302
  const staleModels = buildModels(staleBase, customModels, patches);
303
303
 
304
304
  pi.registerProvider("opencode", {
305
+ name: "OpenCode Zen",
305
306
  baseUrl: BASE_URL,
306
307
  apiKey: "$OPENCODE_API_KEY",
307
308
  api: "openai-completions",
@@ -328,6 +329,7 @@ export default function (pi: ExtensionAPI) {
328
329
  revalidateModels(cachedApiKey, embeddedModels, signal).then((freshBase) => {
329
330
  if (freshBase && !signal.aborted) {
330
331
  pi.registerProvider("opencode", {
332
+ name: "OpenCode Zen",
331
333
  baseUrl: BASE_URL,
332
334
  apiKey: "$OPENCODE_API_KEY",
333
335
  api: "openai-completions",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monotykamary/pi-opencode-provider",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Opencode provider extension for pi - Access GPT, Claude, Gemini, GLM, MiniMax, Kimi and more through the opencode.ai API",
5
5
  "type": "module",
6
6
  "main": "index.ts",