用途:让内容应用中的文档与 Notion 页面建立双向同步,可链接既有页面、从 Notion 拉取内容或推送到 Notion,并同步评论。
主要能力:connect-notion-status 检查连接状态与所属工作区;link-notion-page 将本地文档链接到 Notion 页面;create-and-link-notion-page 由文档内容新建并同时链接 Notion 页面;unlink-notion-page 解除链接不删内容;list-notion-links 列出已链接文档;pull-notion-page 用 Notion 页面内容(转 markdown)覆盖本地;push-notion-page 用本地 markdown(转 Notion 块)覆盖页面;refresh-notion-sync-status 检查并可选自动同步;resolve-notion-sync-conflict 以 pull 或 push 方向解决冲突;sync-notion-comments 双向同步评论;search-notion-pages 搜索可链接页面;list-notion-database-sources 列出 OAuth 可见的数据源(只读试点);disconnect-notion 断开连接。
使用方式:命令形如 pnpm action <动作> --documentId abc123 等。link-notion-page 接受 --pageId 及别名 --pageIdOrUrl/--url,无 --notionPageId 参数。同步操作前应先检查连接状态。
限制:Notion 访问仅限每用户 OAuth,不可读取环境变量中的 NOTION_API_KEY 或使用用户粘贴的令牌,拉取/推送需编辑器权限。拉取和推送均为整体覆盖,冲突时只能选择 pull-wins 或 push-wins,没有行级合并。数据库数据源试点为只读,不做写回。