前言¶
在 DeepSeek Harness(DSH)里跑 agent 时,笔记往往还在有道云笔记里:搜索、读正文、新建或改 Markdown、管待办、做网页剪藏,如果每次都让人手工复制粘贴,上下文很容易断。自己写 HTTP 对接则要维护 API Key、协议变更和格式细节,成本不低。
dsh-youdaonote 由维护者 xmzd-S 发布,分类为联网工具,把官方 youdaonote CLI 封装成 8 个 dsh 工具,供 agent 直接调用。插件不直连云笔记 HTTP API,鉴权与协议升级由 CLI 承担;首次使用时可自动安装 CLI,并在缺 API Key 时通过 dsh 提问服务弹卡片索要。
这是什么¶
一句话:DSH 的有道云笔记工具插件,覆盖笔记 CRUD、待办管理和网页剪藏。
底层是官方 youdaonote CLI(API Key 鉴权)。CLI 二进制在 Linux/macOS 上可自动装进 ~/.dsh/integrations/dsh-youdaonote/bin,不修改系统 PATH;API Key 由 CLI 写入 ~/.youdaonote.json,插件不落盘、不进日志。
当前 package 版本为 0.2.0,许可证 MIT,要求 Node.js >=22。兼容 dsh 0.1.2-alpha.4 至 0.1.5-rc.2,profile 支持 web、headless、tui。
核心功能:八个工具¶
| 工具 | 用途 | 只读(可并发) |
|---|---|---|
youdaonote_search |
关键词搜索笔记 | ✅ |
youdaonote_read |
读取笔记全文(含 rawFormat 元数据) | ✅ |
youdaonote_list |
浏览目录(根目录或指定文件夹) | ✅ |
youdaonote_save |
新建 Markdown 笔记(内部走 save,不走纯文本的 create) |
❌ |
youdaonote_update |
覆盖更新正文(经临时文件传递) | ❌ |
youdaonote_manage |
delete / rename / move | ❌ |
youdaonote_todo |
待办 list / groups / create / update / delete | 仅 list、groups 只读 |
youdaonote_clip |
网页剪藏(服务端抓取) | ❌ |
设计要点(来自 README):保存一律走 save(contentFormat: "md")以保留格式;正文经 stdin 或临时文件传递,避免转义与长度问题;输出超过 maxOutputChars 会截断;CLI 部分子命令不支持 --json(如 todo update、list)时,插件回退到纯文本输出再交给模型。
首次使用流程¶
下面介绍 agent 第一次调用任意 youdaonote 工具时插件的行为,无需事先手工装 CLI 或填 Key(在支持的环境下)。
- 检查 CLI:若 PATH 或数据目录里已有
youdaonote则直接使用;若不存在且平台为 Linux/macOS,插件执行官方安装脚本,目标目录为~/.dsh/integrations/dsh-youdaonote/bin(需要curl和bash)。Windows 不支持自动安装,会报错并附手动安装指引。 - 检查 API Key:运行
youdaonote check;若未配置且环境支持提问(Web UI / TUI),通过 dsh 用户提问服务弹卡片,请从 https://mopen.163.com(手机号登录)获取 Key 并粘贴,插件自动执行config set apiKey。headless 等不支持提问的环境,报错信息里带手动配置命令。 - 进程内记忆:配置结果按进程记忆,之后不重复检查;Key 失效时下一次调用会重新检查并再次询问。
安装与启用¶
插件以当前 dsh 进程权限运行,安装前建议阅读仓库源码与 MIT 许可证。DSH 社区目录 SkillHub 与 DeepSeek / 幻方无官方从属关系,属社区生态站点。
本地目录或 tgz 均可安装(--profile 换成你实际运行的 profile):
# 本地目录或 tgz 均可(--profile 填实际运行的 profile)
dsh plugin --profile web add --save-exact /path/to/dsh-youdaonote
# 验证 + 重启
dsh --profile web --dump-config | grep youdaonote # 应看到 "- id: youdaonote"
sudo systemctl restart dsh
升级或卸载:
dsh plugin --profile web update dsh-youdaonote
dsh plugin --profile web remove dsh-youdaonote
若 dump-config 里没有 youdaonote,说明插件装进了别的 profile,dsh plugin 是按 profile 安装的。
配置(可选)¶
默认值内建,可不写 config。需要覆盖时在 profile 的 cordis.patch.yml 中 patch,例如:
- insert:
- id: youdaonote
name: dsh-youdaonote
config:
bin: youdaonote # CLI 路径覆盖;设为非默认值后插件只认这一处
statSource: ydn # CLI -s 统计来源参数
timeoutMs: 120000 # 单次 CLI 调用超时(clip 较慢,别低于 60s)
maxOutputChars: 100000 # 工具输出字符上限
autoInstall: true # CLI 缺失时自动安装(Linux/macOS)
autoAskKey: true # 缺 Key 时通过提问服务索要
dataDir: ~/.dsh/integrations/dsh-youdaonote
binDir: ~/.dsh/integrations/dsh-youdaonote/bin
installUrl: https://artifact.lx.netease.com/download/youdaonote-cli/install.sh
典型用法(从 agent 视角)¶
README 未给出固定对话示例,用法即 agent 在任务中按需调用上表工具,例如:
- 用
youdaonote_search按关键词定位笔记,再用youdaonote_read拉全文; - 用
youdaonote_list浏览文件夹结构; - 用
youdaonote_save/youdaonote_update写入或更新 Markdown; - 用
youdaonote_todo查待办或分组,或创建、更新、删除待办; - 用
youdaonote_clip把 URL 剪藏进笔记; - 用
youdaonote_manage删除、重命名或移动笔记。
写操作不可与同类写操作并发;只读工具标注为可并发。
排错与注意¶
| 现象 | 处理 |
|---|---|
| 自动安装失败 | 检查能否访问 artifact.lx.netease.com(可用 curl -I);失败信息含手动安装命令 |
| 想重新触发 Key 提问 | 重启 dsh 进程;或手动 youdaonote config set apiKey <KEY> |
| 提示不支持交互提问 | profile 未挂载提问服务(如 headless),按报错里的手动命令配置 |
| 输出是纯文本不是 JSON | 正常:部分 CLI 子命令不支持 --json,插件已回退 |
| dump-config 无 youdaonote | 插件装在别的 profile |
实测基于 youdaonote CLI 1.3.4(Windows)验证,Linux 走同一官方安装脚本。升 dsh 后建议跑一次 --dump-config 验证;developer preview 阶段上游接口可能变动。
结尾¶
dsh-youdaonote 把有道云笔记能力收敛为 8 个 dsh 工具,依赖官方 CLI,并尽量自动化 CLI 安装与 API Key 配置,适合已在用有道云笔记、又希望 agent 直接读写笔记与待办的 DSH 部署。