Files
opencode/README.md

73 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# opencode-config
我的 [OpenCode](https://opencode.ai) 配置,对应 `~/.config/opencode` 目录。
## 特性
- 通过 [LiteLLM](https://docs.litellm.ai/) 代理统一接入多家模型
- 使用 [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) 插件,支持多 Agent 模型分配
- 默认主模型 `anthropic/claude-opus-4-6`,小模型 `anthropic/claude-haiku-4-5`
- 配置了 Anthropic / OpenAI / Google / LiteLLM 四个 Provider
## 快速开始
### 安装 OpenCode
```bash
curl -fsSL https://opencode.ai/install | bash
```
### 克隆配置
```bash
# 如果已有该目录,请先备份
git clone <repo-url> ~/.config/opencode
```
### 配置环境变量
参考 `.env.example`,设置以下环境变量:
```bash
export LITELLM_BASE_URL="https://your-litellm-endpoint"
export LITELLM_API_KEY="your-api-key"
```
> 可选:如果使用了 Exa 或 Context7 的 MCP 工具,还需设置 `EXA_API_KEY` 和 `CONTEXT7_API_KEY`。
### 启动
```bash
opencode
```
## 文件说明
| 文件 | 说明 |
|------|------|
| `opencode.jsonc` | 主配置Provider、模型定义、插件 |
| `oh-my-opencode.jsonc` | oh-my-opencode 插件配置Agent 模型分配、任务分类 |
| `tui.jsonc` | TUI 主题配置 |
| `AGENTS.md` | 运行时行为指令(如默认使用简体中文回复) |
| `.env.example` | 环境变量模板 |
## 模型配置概览
| Provider | 模型 | 用途 |
|----------|------|------|
| Anthropic | Claude Opus 4.6 | 主模型 / Sisyphus / Prometheus / Metis |
| Anthropic | Claude Sonnet 4.6 | Atlas / Sisyphus-Junior |
| Anthropic | Claude Haiku 4.5 | 小模型(快速任务) |
| OpenAI | GPT-5.4 | Oracle / Multimodal / Momus |
| OpenAI | GPT-5.3-Codex | Hephaestus / Deep 任务 |
| OpenAI | GPT-5.4 mini | Quick 任务 |
| Google | Gemini 3.1 Pro | Visual Engineering / Artistry |
| Google | Gemini 3 Flash | Writing 任务 |
| LiteLLM | Grok Code Fast 1 | Explore |
| LiteLLM | MiniMax M2.5 | Librarian |
| LiteLLM | Kimi K2.5 / GLM-5 | 备用 |
## License
个人配置,仅供参考。