editing docs
This commit is contained in:
parent
6f894950a6
commit
da9b2a18b9
9 changed files with 195 additions and 204 deletions
|
|
@ -2,32 +2,18 @@
|
|||
title: Config
|
||||
---
|
||||
|
||||
OpenCode looks for configuration in the following locations:
|
||||
You can configure OpenCode using the OpenCode config. It can be places in:
|
||||
|
||||
- `$HOME/.opencode.json`
|
||||
- `$XDG_CONFIG_HOME/opencode/.opencode.json`
|
||||
- `./.opencode.json` (local directory)
|
||||
|
||||
## Environment variables
|
||||
|
||||
You can configure OpenCode using environment variables:
|
||||
|
||||
| Environment Variable | Purpose |
|
||||
| -------------------------- | ------------------------------------------------------ |
|
||||
| `ANTHROPIC_API_KEY` | For Claude models |
|
||||
| `OPENAI_API_KEY` | For OpenAI models |
|
||||
| `GEMINI_API_KEY` | For Google Gemini models |
|
||||
| `GROQ_API_KEY` | For Groq models |
|
||||
| `AWS_ACCESS_KEY_ID` | For AWS Bedrock (Claude) |
|
||||
| `AWS_SECRET_ACCESS_KEY` | For AWS Bedrock (Claude) |
|
||||
| `AWS_REGION` | For AWS Bedrock (Claude) |
|
||||
| `AZURE_OPENAI_ENDPOINT` | For Azure OpenAI models |
|
||||
| `AZURE_OPENAI_API_KEY` | For Azure OpenAI models (optional when using Entra ID) |
|
||||
| `AZURE_OPENAI_API_VERSION` | For Azure OpenAI models |
|
||||
Or in the current directory, `./.opencode.json`.
|
||||
|
||||
## OpenCode config
|
||||
|
||||
```json
|
||||
The config file has the following structure.
|
||||
|
||||
```json title=".opencode.json"
|
||||
{
|
||||
"data": {
|
||||
"directory": ".opencode"
|
||||
|
|
@ -82,3 +68,21 @@ You can configure OpenCode using environment variables:
|
|||
"debugLSP": false
|
||||
}
|
||||
```
|
||||
|
||||
## Environment variables
|
||||
|
||||
For the providers, you can also specify the keys using environment variables.
|
||||
|
||||
| Environment Variable | Models |
|
||||
| -------------------------- | ----------- |
|
||||
| `ANTHROPIC_API_KEY` | Claude |
|
||||
| `OPENAI_API_KEY` | OpenAI |
|
||||
| `GEMINI_API_KEY` | Google Gemini |
|
||||
| `GROQ_API_KEY` | Groq |
|
||||
| `AWS_ACCESS_KEY_ID` | Amazon Bedrock |
|
||||
| `AWS_SECRET_ACCESS_KEY` | Amazon Bedrock |
|
||||
| `AWS_REGION` | Amazon Bedrock |
|
||||
| `AZURE_OPENAI_ENDPOINT` | Azure OpenAI |
|
||||
| `AZURE_OPENAI_API_KEY` | Azure OpenAI, optional when using Entra ID |
|
||||
| `AZURE_OPENAI_API_VERSION` | Azure OpenAI |
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue