forked from agents/opencode
Compare commits
15 Commits
de299e0261
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e3f9b17753 | |||
| 1ab05fac87 | |||
| b5717759ba | |||
| cc38835300 | |||
| f3a9562301 | |||
| 6450117296 | |||
| 1440291655 | |||
| ec0aff2728 | |||
| 838e615af6 | |||
| 61374e11a9 | |||
| 94c7118b71 | |||
| 752b56ab33 | |||
| 6477587931 | |||
| fa7a9e1fe7 | |||
| 2c645726fe |
5
AGENTS.md
Normal file
5
AGENTS.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# AGENTS.md
|
||||||
|
|
||||||
|
- Always reply in Simplified Chinese by default.
|
||||||
|
- Use English only if the user explicitly asks for it.
|
||||||
|
- Keep code, commands, file paths, logs, and identifiers unchanged.
|
||||||
31
README.md
Normal file
31
README.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# opencode-config
|
||||||
|
|
||||||
|
个人 [OpenCode](https://opencode.ai) 配置文件。
|
||||||
|
|
||||||
|
## 使用
|
||||||
|
|
||||||
|
1. 安装 OpenCode
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm i -g opencode-ai
|
||||||
|
# 或
|
||||||
|
bun add -g opencode-ai
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 克隆配置到 `~/.config/opencode`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone <repo-url> ~/.config/opencode
|
||||||
|
```
|
||||||
|
|
||||||
|
3. 参考 `.env.example` 将以下环境变量配置到系统中
|
||||||
|
|
||||||
|
| 变量 | 必填 | 说明 |
|
||||||
|
|------|------|------|
|
||||||
|
| `LITELLM_BASE_URL` | 是 | 模型服务端点 |
|
||||||
|
| `LITELLM_API_KEY` | 是 | 模型服务密钥 |
|
||||||
|
| `EXA_API_KEY` | 否 | [Exa](https://exa.ai) 搜索,提供联网能力,不配则使用默认额度 |
|
||||||
|
| `CONTEXT7_API_KEY` | 否 | [Context7](https://context7.com) 文档查询,提供库文档检索,不配则使用默认额度 |
|
||||||
|
| `OPENCODE_GIT_BASH_PATH` | 否 | Windows 用户需指定 Git Bash 路径,否则工具调用可能异常 |
|
||||||
|
|
||||||
|
4. 运行 `opencode`
|
||||||
@@ -18,11 +18,16 @@
|
|||||||
"ultrabrain": { "model": "openai/gpt-5.4", "variant": "xhigh" },
|
"ultrabrain": { "model": "openai/gpt-5.4", "variant": "xhigh" },
|
||||||
"deep": { "model": "openai/gpt-5.3-codex", "variant": "medium" },
|
"deep": { "model": "openai/gpt-5.3-codex", "variant": "medium" },
|
||||||
"artistry": { "model": "google/gemini-3.1-pro-preview", "variant": "high" },
|
"artistry": { "model": "google/gemini-3.1-pro-preview", "variant": "high" },
|
||||||
"quick": { "model": "anthropic/claude-haiku-4-5" },
|
"quick": { "model": "openai/gpt-5.4-mini" },
|
||||||
"unspecified-low": { "model": "anthropic/claude-sonnet-4-6" },
|
"unspecified-low": { "model": "anthropic/claude-sonnet-4-6" },
|
||||||
"unspecified-high": { "model": "anthropic/claude-opus-4-6", "variant": "high" },
|
"unspecified-high": { "model": "anthropic/claude-opus-4-6", "variant": "high" },
|
||||||
"writing": { "model": "google/gemini-3-flash-preview" }
|
"writing": { "model": "google/gemini-3-flash-preview" }
|
||||||
},
|
},
|
||||||
|
"experimental": {
|
||||||
|
"dynamic_context_pruning": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"git_master": {
|
"git_master": {
|
||||||
"commit_footer": false,
|
"commit_footer": false,
|
||||||
"include_co_authored_by": false
|
"include_co_authored_by": false
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://opencode.ai/config.json",
|
"$schema": "https://opencode.ai/config.json",
|
||||||
|
"plugin": ["oh-my-opencode@latest"],
|
||||||
"autoupdate": false,
|
"autoupdate": false,
|
||||||
"model": "anthropic/claude-opus-4-6",
|
"model": "anthropic/claude-opus-4-6",
|
||||||
"small_model": "anthropic/claude-haiku-4-5",
|
"small_model": "anthropic/claude-haiku-4-5",
|
||||||
"experimental": {
|
|
||||||
"disable_paste_summary": true
|
|
||||||
},
|
|
||||||
"plugin": ["oh-my-opencode@latest"],
|
|
||||||
"provider": {
|
"provider": {
|
||||||
"anthropic": {
|
"anthropic": {
|
||||||
"npm": "@ai-sdk/anthropic",
|
"npm": "@ai-sdk/anthropic",
|
||||||
@@ -53,6 +50,12 @@
|
|||||||
"reasoning": true,
|
"reasoning": true,
|
||||||
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
||||||
"limit": { "context": 400000, "input": 272000, "output": 128000 }
|
"limit": { "context": 400000, "input": 272000, "output": 128000 }
|
||||||
|
},
|
||||||
|
"gpt-5.4-mini": {
|
||||||
|
"name": "GPT-5.4 mini",
|
||||||
|
"reasoning": true,
|
||||||
|
"modalities": { "input": ["text", "image"], "output": ["text"] },
|
||||||
|
"limit": { "context": 400000, "input": 272000, "output": 128000 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -85,70 +88,34 @@
|
|||||||
"apiKey": "{env:LITELLM_API_KEY}"
|
"apiKey": "{env:LITELLM_API_KEY}"
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
// Grok
|
|
||||||
"grok-code-fast-1": {
|
"grok-code-fast-1": {
|
||||||
"name": "Grok Code Fast 1",
|
"name": "Grok Code Fast 1",
|
||||||
"reasoning": true,
|
"reasoning": true,
|
||||||
"modalities": { "input": ["text"], "output": ["text"] },
|
"modalities": { "input": ["text"], "output": ["text"] },
|
||||||
"limit": { "context": 256000, "output": 10000 }
|
"limit": { "context": 256000, "output": 10000 }
|
||||||
},
|
},
|
||||||
|
|
||||||
// GLM
|
|
||||||
"glm-5": {
|
"glm-5": {
|
||||||
"name": "GLM-5",
|
"name": "GLM-5",
|
||||||
"reasoning": true,
|
"reasoning": true,
|
||||||
"modalities": { "input": ["text"], "output": ["text"] },
|
"modalities": { "input": ["text"], "output": ["text"] },
|
||||||
"limit": { "context": 204800, "output": 131072 }
|
"limit": { "context": 204800, "output": 131072 }
|
||||||
},
|
},
|
||||||
"glm-4.7": {
|
|
||||||
"name": "GLM-4.7",
|
|
||||||
"reasoning": true,
|
|
||||||
"modalities": { "input": ["text"], "output": ["text"] },
|
|
||||||
"limit": { "context": 204800, "output": 131072 }
|
|
||||||
},
|
|
||||||
|
|
||||||
// Kimi
|
|
||||||
"kimi-k2.5": {
|
"kimi-k2.5": {
|
||||||
"name": "Kimi K2.5",
|
"name": "Kimi K2.5",
|
||||||
"reasoning": true,
|
"reasoning": true,
|
||||||
"modalities": { "input": ["text", "image", "video"], "output": ["text"] },
|
"modalities": { "input": ["text", "image", "video"], "output": ["text"] },
|
||||||
"limit": { "context": 262144, "output": 262144 }
|
"limit": { "context": 262144, "output": 262144 }
|
||||||
},
|
},
|
||||||
|
|
||||||
// MiniMax
|
|
||||||
"minimax-m2.5": {
|
"minimax-m2.5": {
|
||||||
"name": "MiniMax-M2.5",
|
"name": "MiniMax M2.5",
|
||||||
"reasoning": true,
|
"reasoning": true,
|
||||||
"modalities": { "input": ["text"], "output": ["text"] },
|
"modalities": { "input": ["text"], "output": ["text"] },
|
||||||
"limit": { "context": 204800, "output": 131072 }
|
"limit": { "context": 204800, "output": 131072 }
|
||||||
},
|
|
||||||
|
|
||||||
// Qwen
|
|
||||||
"qwen3.5-plus": {
|
|
||||||
"name": "Qwen3.5 Plus",
|
|
||||||
"reasoning": true,
|
|
||||||
"modalities": { "input": ["text", "image", "video"], "output": ["text"] },
|
|
||||||
"limit": { "context": 1000000, "output": 65536 }
|
|
||||||
},
|
|
||||||
"qwen3-max": {
|
|
||||||
"name": "Qwen3 Max",
|
|
||||||
"reasoning": false,
|
|
||||||
"modalities": { "input": ["text"], "output": ["text"] },
|
|
||||||
"limit": { "context": 262144, "output": 65536 }
|
|
||||||
},
|
|
||||||
"qwen3-coder-next": {
|
|
||||||
"name": "Qwen3 Coder Next",
|
|
||||||
"reasoning": false,
|
|
||||||
"modalities": { "input": ["text"], "output": ["text"] },
|
|
||||||
"limit": { "context": 262144, "output": 65536 }
|
|
||||||
},
|
|
||||||
"qwen3-coder-plus": {
|
|
||||||
"name": "Qwen3 Coder Plus",
|
|
||||||
"reasoning": false,
|
|
||||||
"modalities": { "input": ["text"], "output": ["text"] },
|
|
||||||
"limit": { "context": 1000000, "output": 65536 }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"experimental": {
|
||||||
|
"disable_paste_summary": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user