You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-3Lines changed: 17 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -348,6 +348,20 @@ Zero-config by default (uses `auto` mode). Customize in `.opencode/codebase-inde
348
348
}
349
349
```
350
350
351
+
String values in `codebase-index.json` can reference environment variables with `{env:VAR_NAME}` when the placeholder is the entire string value. Variable names must match `[A-Z_][A-Z0-9_]*`. This is useful for secrets such as custom provider API keys so they do not need to be committed to the config file.
352
+
353
+
```json
354
+
{
355
+
"embeddingProvider": "custom",
356
+
"customProvider": {
357
+
"baseUrl": "{env:EMBED_BASE_URL}",
358
+
"model": "nomic-embed-text",
359
+
"dimensions": 768,
360
+
"apiKey": "{env:EMBED_API_KEY}"
361
+
}
362
+
}
363
+
```
364
+
351
365
### Options Reference
352
366
353
367
| Option | Default | Description |
@@ -604,16 +618,16 @@ Works with any server that implements the OpenAI `/v1/embeddings` API format (ll
Required fields: `baseUrl`, `model`, `dimensions` (positive integer). Optional: `apiKey`, `maxTokens`, `timeoutMs` (default: 30000).`{env:VAR_NAME}` placeholders are resolved before config validation for fields that are actually used and throw if the referenced environment variable is missing or malformed.
0 commit comments