pi-opencode-go-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.
- package/README.md +7 -5
- package/index.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,17 +93,19 @@ After loading the extension, use the `/model` command in pi to select your prefe
|
|
|
93
93
|
|
|
94
94
|
Then select "opencode-go" as the provider and choose from the available models.
|
|
95
95
|
|
|
96
|
+
The default model for this provider is `kimi-k2.6` (matching pi core's built-in default); use `/model` to pick another.
|
|
97
|
+
|
|
96
98
|
## Authentication
|
|
97
99
|
|
|
98
|
-
The opencode-go API key can be configured in multiple ways
|
|
100
|
+
The opencode-go API key can be configured in multiple ways. Credentials are resolved in this order:
|
|
99
101
|
|
|
100
|
-
1.
|
|
102
|
+
1. **CLI flag** — `--api-key` (highest priority, runtime override)
|
|
103
|
+
2. **`auth.json`** (recommended) — Add to `~/.pi/agent/auth.json`:
|
|
101
104
|
```json
|
|
102
105
|
{ "opencode-go": { "type": "api_key", "key": "your-api-key" } }
|
|
103
106
|
```
|
|
104
|
-
The `key` field supports
|
|
105
|
-
|
|
106
|
-
3. **Environment variable** — Set `OPENCODE_API_KEY`
|
|
107
|
+
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.
|
|
108
|
+
3. **Environment variable** — `OPENCODE_API_KEY`
|
|
107
109
|
|
|
108
110
|
## Environment Variables
|
|
109
111
|
|
package/index.ts
CHANGED
|
@@ -300,6 +300,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
300
300
|
const staleModels = buildModels(staleBase, customModels, patches);
|
|
301
301
|
|
|
302
302
|
pi.registerProvider("opencode-go", {
|
|
303
|
+
name: "OpenCode Go",
|
|
303
304
|
baseUrl: BASE_URL,
|
|
304
305
|
apiKey: "$OPENCODE_API_KEY",
|
|
305
306
|
api: "openai-completions",
|
|
@@ -326,6 +327,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
326
327
|
revalidateModels(cachedApiKey, embeddedModels, signal).then((freshBase) => {
|
|
327
328
|
if (freshBase && !signal.aborted) {
|
|
328
329
|
pi.registerProvider("opencode-go", {
|
|
330
|
+
name: "OpenCode Go",
|
|
329
331
|
baseUrl: BASE_URL,
|
|
330
332
|
apiKey: "$OPENCODE_API_KEY",
|
|
331
333
|
api: "openai-completions",
|
package/package.json
CHANGED