baobao700508/unofficial-remnote-bridge-cli/remnote-bridge
Claude Code and agent skill by baobao700508/unofficial-remnote-bridge-cli
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
RemNote 知识库操作指南。通过 remnote-bridge 命令行工具读取、编辑、搜索 RemNote 知识库中的内容。当用户需要操作 RemNote 知识库时使用此 skill——包括读取笔记、编辑内容、搜索、浏览知识库结构、创建闪卡、修改文档属性等。触发关键词包括:RemNote、知识库、笔记、Rem、闪卡、文档、read-rem、edit-rem、read-tree、edit-tree、search、read-globe、read-context。即使用户没有明确提到 CLI 命令,只要意图是操作 RemNote 中的数据,都应触发此 skill。
Install
npx vskill@latest install baobao700508/unofficial-remnote-bridge-cli/remnote-bridgeSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
RemNote CLI 操作指南
本 skill 指导 AI Agent 通过 remnote-bridge 操作 RemNote 知识库。
详细命令文档位于 instructions/ 目录下,执行具体命令前务必先读取对应文件:
| 命令 | 文档路径 | |
|---|---|---|
| setup | instructions/setup.md | |
| connect | instructions/connect.md | |
| disconnect | instructions/disconnect.md | |
| health | instructions/health.md | |
| read-rem | instructions/read-rem.md | |
| edit-rem | instructions/edit-rem.md | |
| read-tree | instructions/read-tree.md | |
| read-rem-in-tree | instructions/read-rem-in-tree.md | |
| edit-tree | instructions/edit-tree.md | |
| read-globe | instructions/read-globe.md | |
| read-context | instructions/read-context.md | |
| search | instructions/search.md | |
| addon | instructions/addon.md | |
| clean | instructions/clean.md | |
| install-skill | instructions/install-skill.md | |
| 全局概览 | instructions/overall.md |
1. 核心概念
一切皆 Rem
RemNote 中所有内容的基本单元都是 Rem。文档、文件夹、闪卡、标签——本质上都是 Rem 的不同形态。
| 用户说的 | 实际上是 | |
|---|---|---|
| 笔记 / 条目 | Rem | |
| 文档 / 页面 | Rem(isDocument=true) | |
| 文件夹 | Rem(Document 且子节点全是 Document) | |
| 闪卡 / 卡片 | Card——由 RemNote 根据 Rem 属性自动生成,不可直接操控 |
Rem 类型系统
两个独立维度:
- type(闪卡语义):
concept(加粗)、descriptor(正常字重)、default(普通)、portal(嵌入引用容器) - isDocument(页面语义):与 type 完全独立
CDF 框架(Concept-Descriptor Framework)
RemNote 推荐的知识结构化方法:
闪卡的 CLI 操作方式
闪卡由 type、backText、practiceDirection 三个字段控制。通过 CLI 操作闪卡,修改的是这些字段。
禁止:在文本中插入分隔符(::、;;、>>、<< 等)来创建闪卡。分隔符是 RemNote 编辑器的输入语法,CLI 无法识别。
| 闪卡操作 | CLI 方法 | |
|---|---|---|
| 创建概念定义 | edit-tree 新增行 概念 ↔ 定义,再 edit-rem 设 type: "concept" | |
| 创建正向问答 | edit-tree 新增行 问题 → 答案 | |
| 创建多行答案 | edit-tree 新增行 问题 ↓(子行自动成为答案) | |
| 改变闪卡类型 | edit-rem 修改 type、backText、practiceDirection |
理解用户意图:分隔符映射
用户在 RemNote 编辑器中通过分隔符创建闪卡。当用户提到这些分隔符时,理解其意图并映射到上述 CLI 操作:
| 用户说 / 编辑器分隔符 | 对应 type | 对应 practiceDirection | |
|---|---|---|---|
:: | concept | both | |
;; | descriptor | forward | |
>> / << / <> | default | forward / backward / both | |
>>> / ::> / ;;> | default / concept / descriptor | 多行(子 Rem 为答案) | |
{{}} | default | forward(完形填空) |
三种链接机制
| 机制 | 用户操作 | 本质 | CLI 可见性 | |
|---|---|---|---|---|
| Reference | [[ | RichText 中的 {"i":"q","_id":"remId"} | read-rem 的 text 数组 | |
| Tag | ## | Rem 的 tags 数组 | read-rem 的 tags 字段 | |
| Portal | (( | 嵌入实时视图(编辑同步) | read-tree 标记 type:portal refs:id1,id2 |
Portal 的编辑同步意味着修改一处会影响另一处。Portal 引用的 Rem 不会被 read-tree 自动展开,需要对 refs 中的 ID 单独 read-tree。Portal 引用列表可通过 edit-rem 修改(直接修改 changes 中的 portalDirectlyIncludedRem 数组)。
Portal 操作速查
| 操作 | 命令 | 方式 | |
|---|---|---|---|
| 创建 Portal | edit-tree | 新增行 <!--portal refs:id1,id2--> | |
| 删除 Portal | edit-tree | 从大纲中移除 Portal 行(与删除普通行相同) | |
| 修改引用列表(增删引用的 Rem) | edit-rem | 直接修改 changes 中的 portalDirectlyIncludedRem 数组 | |
| 移动 Portal(换父节点/位置) | edit-tree | 与移动普通行相同 | |
| 读取 Portal | read-rem | 自动输出 8 字段简化 JSON |
RichText 格式
text 和 backText 字段是 JSON 数组,元素为纯字符串或格式化对象:
元素类型
i 值 | 类型 | 必填字段 | 可选字段 | |
|---|---|---|---|---|
| 纯 string | 纯文本 | — | — | |
"m" | 带格式文本 | text | 格式标记(见下表) | |
"q" | Rem 引用 | _id | content, showFullName, aliasId | |
"i" | 图片 | url | width, height, percent(25/50/100) | |
"x" | LaTeX | text | block(true=块级公式) | |
"a" | 音频/视频 | url, onlyAudio | width, height | |
"s" | 卡片分隔符 | — | delimiterCharacterForSerialization |
注意:i:"a" 的 onlyAudio 是必填字段(true=音频,false=视频),缺少会导致 SDK 拒绝写入。
格式标记(主要用于 i:"m",但 i:"q" 等也支持)
| 字段 | 类型 | 含义 | |
|---|---|---|---|
b | true | 加粗 | |
l | true | 斜体(小写字母 L,不是 I) | |
u | true | 下划线 | |
h | number | 高亮颜色(见 RemColor 枚举) | |
tc | number | 文字颜色(见 RemColor 枚举) | |
q | true | 行内代码(红色等宽样式) | |
code | true | 代码块(带语言标签和复制按钮) | |
language | string | 代码块语言(如 "javascript"、"python") | |
cId | string | 完形填空 ID | |
hiddenCloze | true | 完形填空隐藏状态 | |
revealedCloze | true | 完形填空已揭示状态 | |
iUrl | string | 外部超链接 URL | |
qId | string | 行内引用链接的 Rem ID |
注意:url 字段已废弃无效,超链接必须用 iUrl。
RemColor 颜色枚举(h 和 tc 共用)
| 值 | 颜色 | 值 | 颜色 | 值 | 颜色 | |
|---|---|---|---|---|---|---|
| 0 | 无颜色/默认 | 4 | Green | 7 | Gray | |
| 1 | Red | 5 | Purple | 8 | Brown | |
| 2 | Orange | 6 | Blue | 9 | Pink | |
| 3 | Yellow | — | — | — | — |
常用构造示例
以下为 JSON.stringify(null, 2) 格式化后的实际样式(key 按字母序):
注意:在 RemObject 的格式化 JSON 中,数组内的对象会展开为多行(每个 key 一行,缩进 4+2 空格)。以上为简写——构造 edit-rem 的 changes 中 RichText 值时,直接传入数组即可。
highlightColor(Rem 级别)vs h(RichText 行内)
highlightColor:RemObject 顶层字段,值为字符串("Red","Blue"等)或null,作用于整行背景h:RichText 元素内格式标记,值为数字 0-9(RemColor 枚举),作用于行内文字片段
两者完全独立,互不影响。
序列化确定性
RichText 对象内部按 key 字母序排列(sortRichTextKeys()),确保 JSON 始终一致。_id 中的 _(U+005F)排在所有小写字母(a=U+0061)之前。防线 2(语义并发检测)依赖此确定性序列化来逐字段比较缓存与最新数据。
Powerup 机制与噪音过滤
RemNote 格式设置(fontSize、highlightColor 等)底层通过 Powerup 机制实现,会注入隐藏 Tag 和子 Rem。默认自动过滤(includePowerup=false)。read-tree 支持 --includePowerup 恢复完整数据,read-globe 和 read-context 硬编码过滤无选项。
2. 命令决策
⚠️ 用户正在看的页面对你不可见
用户在跟你沟通时,往往默认你也能看到他正在浏览的 RemNote 页面,但实际上你们的信息是不对等的。当你发现以下情况时,必须主动执行 `read-context` 来对齐信息:
- 用户提到了你没有上下文的内容(如"这个"、"当前页面"、"这里")
- 用户的描述与你已知的信息对不上
- 你搜索不到用户提到的某些内容
- 用户似乎在引用他正在查看的界面
先用 read-context 看到用户所看到的,再做决策,沟通才能顺畅。
读取:用户想了解什么?
read-globe vs read-context vs read-tree
| 场景 | 命令 | 特点 | |
|---|---|---|---|
| 知识库有什么 | read-globe | 仅 Document 层级,无缓存,最小序列化(无 backText/箭头) | |
| 当前页面内容 | read-context | 均匀展开(默认,推荐——只需有打开页面即可),无缓存 | |
| 我光标在哪 / 正在编辑的 Rem | read-context --mode focus | 鱼眼视图(需光标在某 Rem 上,否则报错),无缓存 | |
| 展开某主题细节 | read-tree <id> | 完整子树,有缓存供 edit-tree | |
| 展开子树 + 每个节点属性 | read-rem-in-tree <id> | 大纲 + RemObject,双重缓存供 edit-tree 和 edit-rem |
重要:read-globe、read-context、search 都不写入缓存,不能替代 read-tree/read-rem/read-rem-in-tree 作为 edit 的前置条件。read-context 需要用户在 RemNote 中有打开页面(page 模式,默认)或有焦点(focus 模式)。
修改:用户想改什么?
关键区分:edit-rem 修改 Rem 的属性,edit-tree 修改 Rem 之间的结构关系。edit-tree 禁止修改行内容。
read-rem-in-tree:何时用、怎么用
read-rem-in-tree = read-tree + 批量 read-rem 的合体。一次调用同时获取子树大纲和每个节点的 RemObject(含完整 RichText),同时建立 tree: 和 rem: 双重缓存。
何时用:当你需要对一棵子树中的多个节点做属性修改(edit-rem)时。典型场景:
- 批量标注重点(给多个节点加高亮/粗体)
- 批量修改类型(把多个普通 Rem 改为 concept)
- 读取子树后需要检查多个节点的 RichText 再决定怎么改
何时不用:只需要看大纲结构(用 read-tree),或只改 1-2 个节点属性(用 read-tree + read-rem)。
用法示例(课本划重点场景):
对比效率:修改 10 个节点时,read-rem-in-tree = 1 次调用;read-tree + 10×read-rem = 11 次调用。
3. 标准工作流
⚠️ 标准模式(推荐):connect 后需要用户配合
标准模式是推荐的日常使用方式。用户在自己的浏览器中操作 RemNote,Agent 可以通过 read-context 感知用户正在浏览的页面和焦点位置,实现真正的协作。
connect 成功只意味着 daemon 和 Plugin 服务已启动,Plugin 并未自动连接。用户必须在 RemNote 中完成操作,Plugin 才能连接到 daemon:
首次使用(RemNote 从未加载过此插件):
- 打开 RemNote 桌面端或网页端
- 点击左侧边栏底部的插件图标(拼图形状)
- 点击「开发你的插件」(Develop Your Plugin)
- 在输入框中填入 connect 输出的 Plugin 服务地址(如
http://localhost:29101) - 等待插件加载完成
非首次使用(之前已加载过此插件):
- 只需刷新 RemNote 页面即可(浏览器 F5 或 Cmd+R),插件会自动重新连接
你必须:执行 connect 后,立即告知用户需要完成上述操作,不要直接调用业务命令。引导用户完成后,用 health 确认三层就绪再继续。
Headless 模式(特殊场景,不推荐日常使用)
通过 setup(一次性)+ headless Chrome 实现自动连接,后续 connect 无需用户介入。
⚠️ 不推荐日常使用。Headless Chrome 是后台独立实例,会丢失用户上下文——read-context 返回的是 headless Chrome 的上下文,不是用户浏览器的。Agent 无法感知用户正在浏览和操作的页面,协作体验大打折扣。
仅在以下场景使用 headless:
- 用户明确要求在服务器/无 GUI 环境中运行
- 用户明确表示不想参与操作,希望全自动化(CI/CD、定时任务、批量处理等)
- 用户自己不在 RemNote 前面,不需要与 Agent 协作浏览
默认始终使用标准模式,除非用户主动要求 headless。
首次使用(setup)
setup 会弹出 Chrome 窗口,用户只需 登录 RemNote,然后彻底退出 Chrome(macOS 必须 Cmd+Q,仅关窗口不够)。
setup 只负责保存登录凭证——配置 dev plugin 是 connect 之后的事(见标准模式说明)。
Agent 交互方式:
setup 只需执行一次。之后每次连接直接用 connect --headless。
后续使用(connect --headless)
无需任何用户操作——headless Chrome 在后台自动完成登录和 Plugin 加载。
排查
health --diagnose:截图 + Chrome 状态 + console 错误(确认页面是否正常加载)health --reload:重载 headless Chrome 页面(Plugin 未连接时尝试)- 如果 Plugin 始终不连接,可能是 RemNote 登录 session 过期,需重新 setup
完整流程(标准模式)
超时:daemon 默认 30 分钟无 CLI 交互自动关闭,每次请求重置计时器。长时间操作间可用 health 保活。
4. 双模式 I/O(--json)
Agent 应始终使用 JSON 模式调用命令。
中文搜索限制(重要)
search 调用 RemNote SDK 官方搜索方法,其分词基于空格分割。中文、日文、韩文等无空格分词的语言搜索效果差——SDK 将多字词拆为单字符 token 匹配,导致返回 0 结果或不相关结果。RemNote 本地桌面版已优化此问题,Web 版未优化。
应对策略:
- 先用完整关键词搜索
- 若返回 0 结果且关键词为中文等非空格语言:用单个最具区分度的字重试(如搜 "键" 而非 "共价键")
- 若仍无结果:改用
read-globe→read-tree浏览定位 - 搜索持续不佳时,询问用户:"您使用的是 RemNote Web 版还是本地桌面版?Web 版中文搜索存在已知限制。"
JSON 输出结构
5. 安全机制
防线 1:缓存存在性
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/remnote-bridge/SKILL.md
Popularity
- Repository stars
- 1
- Repository npm downloads, 7 days
- 447
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 17 Mar 2026, 8 months ago.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/baobao700508/unofficial-remnote-bridge-cli/remnote-bridge)