by 余汉波
Chat with notes, rewrite selections, and schedule recurring workflows with OpenCode.
yuhanbo-opencode
Overview
Use OpenCode in the Obsidian desktop sidebar to chat with vault notes, search, rewrite selections, and save conversations as Markdown. The free edition includes these features. An optional activation code unlocks scheduled tasks, bulk note updates, and SMTP notifications.
Installation
- Install and configure OpenCode on your desktop.
- Download
main.js,manifest.json, andstyles.cssfrom the same GitHub Release. - Place those files in
.obsidian/plugins/yuhanbo-opencode/inside your vault. Reload Obsidian and enable yuhanbo-opencode under Settings → Community plugins.
Usage
Click the notebook assistant ribbon icon. Type @ alone, choose a note, and enter a question in the chat. Use Save to keep the conversation as Markdown. To edit a note, select text and choose the plugin's insert or replace command from the Command Palette. For automation, open the plugin settings, select a Markdown prompt and output folder, then use Run now to verify the result before scheduling it.
Privacy
The plugin connects to a local OpenCode service using HTTP and SSE. The selected model provider can receive the prompts, attachments, and note content you choose to use. The configured SMTP service receives task notices only when email is enabled. The plugin uses Obsidian’s Vault API for direct file reads. OpenCode handles explicitly requested external paths and Skills under its own permissions. The plugin can start the installed OpenCode program and query its model list. Activation is verified offline, and there is no telemetry.
在 Obsidian 桌面端使用 OpenCode 查找、引用和改写笔记,也可以把重复工作保存成定时任务。插件需要用户自行安装并配置 OpenCode。
安装
从 GitHub Releases 下载同一版本的 main.js、manifest.json 和 styles.css,放入笔记库的 .obsidian/plugins/yuhanbo-opencode/。重载 Obsidian 后在「设置 → 第三方插件」启用 yuhanbo-opencode。点击左侧「笔记助理」图标打开面板。
默认连接 http://localhost:8091。端口已占用且无法连接时,请核对服务或换用空闲端口。自动启动调用用户已安装的 OpenCode。模型和提供商使用 OpenCode 的配置,提供商可能另行收费。
从旧版手动安装迁移时,备份原安装目录,停用旧版,再安装新 ID。旧版设置可按需从原目录的 data.json 在本机复制,已有 Obsidian 快捷键需要按新插件 ID 重新绑定。
免费功能与自动化授权
| 免费使用 | 需要自动化激活码 |
|---|---|
| 聊天、模型切换、文件引用、图片、Markdown 聊天记录 | 创建、编辑并运行每日或一次性定时任务,也可立即执行 |
| Markdown 模板、本地 Skills、全文搜索、编辑器插入与替换 | 按 WikiLink、Dataview 或 DataviewJS 查询结果批量追加或覆盖笔记 |
| 查看已有任务及笔记产物 | SMTP 任务邮件及测试邮件 |
在「设置 → yuhanbo-opencode → 自动化授权」粘贴由维护者签发的激活码并点击「激活」。插件在本地用 Ed25519 公钥验签,无需账户或授权服务器。激活码保存在当前笔记库的插件设置中。移除激活会暂停定时器并保留任务和产物。当前签发格式没有到期时间、设备绑定或在线撤销。
定时任务要求 Obsidian 和插件保持运行。已错过的单次任务可手动重新执行。自动处理权限默认关闭。启用后,插件可以为后台任务选择 OpenCode 的允许权限。建议先用示例笔记核对目标文件和写入模式。
隐私、网络与文件访问
- 插件通过本机 HTTP 和 SSE 与 OpenCode 通信。聊天提示词、引用和任务内容会交给 OpenCode,OpenCode 可能将这些数据发给配置的模型提供商。
- 插件通过 Obsidian 文件接口读取库内模板、笔记与附件。聊天中明确指定的库外路径及外部 Skills 交给 OpenCode,根据其权限设置处理。自动启动和获取模型列表会调用本机已安装的 OpenCode。
- 启用邮件后,插件向配置的 SMTP 服务发送任务通知或测试邮件。插件将 SMTP 配置和激活码保存在
data.json中,请按凭据文件保护。 - 插件没有客户端遥测,也不会自行安装依赖或更新。社区目录收录后由 Obsidian 提供 GitHub Release 更新。
源码与许可证
公开仓库提供可读的运行产物和 Release。源码由独立私有仓库管理,可关联 Obsidian Community Directory GitHub App 供审核及复现构建。发行产物使用 MIT 许可证。
👨💻 作者信息
余汉波 - 编程爱好者-量化交易和效率工具开发
-
GitHub: @yuhanbo758
-
Email: yuhanbo@sanrenjz.com
-
Website: 三人聚智
🌐 相关链接
联系我们
证券开户(+V:yuhanbo758):证券开户免5万0.854,无门槛开量化QMT,送框架策略,支持VIP快速通道,也可开Ptrade | 余汉波 文档
三人聚智下载:sanrenjz - 三人聚智
codebot 下载:sanrenjz-codebot - 三人聚智-余汉波


🙏 致谢
感谢所有为本项目贡献代码和想法的开发者们!
⭐ 如果这个项目对您有帮助,请给它一个 Star!
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.