内容
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/开源配置-0a0a0a?style=for-the-badge&logo=code&logoColor=white">
<img alt="开源配置" src="https://img.shields.io/badge/开源配置-ffffff?style=for-the-badge&logo=code&logoColor=black">
</picture>
</p>
<p align="center">
<a href="https://github.com/MrSaikatS/opencode-config/stargazers">
<img src="https://img.shields.io/github/stars/MrSaikatS/opencode-config?style=for-the-badge&logo=github&color=gold" alt="GitHub 星星">
</a>
<a href="https://github.com/MrSaikatS/opencode-config/issues">
<img src="https://img.shields.io/github/issues/MrSaikatS/opencode-config?style=for-the-badge&logo=github" alt="GitHub 问题">
</a>
<a href="https://github.com/MrSaikatS/opencode-config/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/MrSaikatS/opencode-config?style=for-the-badge&logo=github" alt="许可证">
</a>
</p>
<p align="center">
⭐ 如果您觉得这个项目有帮助,请考虑给它一个星星——这有助于其他人发现它!
</p>
<p align="center">个人 <a href="https://opencode.ai">OpenCode</a> 配置、插件和 MCP 服务器设置。</p>
---
## 🧰 内容列表
| 组件 | 描述 |
| --- | --- |
| **opencode.jsonc** | 代理参数、MCP 服务器、权限、shell |
| **插件** | 扩展 OpenCode 功能的自定义插件 |
| **MCP 服务器** | 本地和远程工具集成 |
## ✅ 前置条件
- [OpenCode](https://opencode.ai)(最新版本)
- PowerShell 7+(用于本地 shell 执行)
## 🚀 快速开始
```bash
git clone https://github.com/MrSaikatS/opencode-config.git ~/.config/opencode
cd ~/.config/opencode
```
## ⚙️ 配置
[`opencode.jsonc`](opencode.jsonc) 定义:
- **代理参数** — `temperature`、`top_p`、`presence_penalty`、`frequency_penalty`,适用于 `build` 和 `plan` 代理
- **权限** — `question`、`webfetch`、`websearch` 均设置为 `allow`
- **Shell** — 默认值为 `pwsh`(PowerShell 7+)
- **小型模型** — `opencode/big-pickle`,适用于轻量级任务
### 🤖 代理预设
| 代理 | 温度 | Top P | 存在惩罚 | 频率惩罚 |
| --- | --- | --- | --- | --- |
| `build` | 0.1 | 0.85 | 0.0 | 0.0 |
| `plan` | 0.2 | 0.95 | 0.0 | 0.0 |
### 🔌 MCP 服务器
| 服务器 | 类型 | 目的 | 已启用 |
| --- | --- | --- | --- |
| `shadcn` | 本地 | UI 组件管理 | 是 |
| `better-auth` | 远程 | 身份验证库文档 | 是 |
| `deepwiki` | 远程 | AI 驱动的存储库文档 | 是 |
| `bun` | 远程 | Bun 运行时文档 | 否 |
## 🔌 插件
### dcp
[动态上下文修剪](https://github.com/Opencode-DCP/opencode-dynamic-context-pruning) — 自动通过修剪过时的工具输出和对话历史来减少 token 使用量。使用模型在关闭任务时调用的 `compress` 工具,具有两种模式(`range` 和 `message`)。在 `opencode.jsonc` 中全局配置在 `"plugin"` 键下。
### 自动标题
在对话进行过程中自动生成和完善会话标题。
- 在 **3 条用户消息** 后生成第一个标题
- 每 **5 条额外消息** 重新完善一次
- 格式:`{Title} - 年月日 时分秒`
- 使用一次性临时会话进行生成 — 在您的真实会话中不会产生噪音
- 处理并发、错误恢复和重新完善时的日期剥离
## 📐 关键约定
- **代理配置** — `build` 代理使用较低的温度(0.1)以获得确定性的输出;`plan` 代理使用稍高的温度(0.2)以进行创造性探索
- **插件** — 每个插件都是 `plugins/` 中的一个单独文件,导出一个 `Plugin` 函数
- **权限** — 所有自主工具(`question`、`webfetch`、`websearch`)都预先允许以加快工作流程
- **MCP** — 本地服务器使用 `command` 二进制文件;远程服务器使用 `url` 端点
## 🤝 贡献
我们欢迎贡献!以下是您可以帮助的方式:
1. 🍴 分叉仓库
2. 🌿 创建一个功能分支:`git checkout -b feat/amazing-feature`
3. 💻 进行更改
4. 📝 使用[约定提交](https://www.conventionalcommits.org/)进行提交
5. 🚀 打开拉取请求
查看 [问题页面](https://github.com/MrSaikatS/opencode-config/issues) 以获取错误或功能请求。
## 📄 许可证
MIT — 请参阅 [LICENSE](LICENSE)。
---
<p align="center">
由 <a href="https://github.com/MrSaikatS">Saikat Sardar</a> 用 ❤️ 制作
<br>
🐛 报告错误 · 💡 建议功能
</p>