用途:通过命令行自动化 Notion,支持搜索、读取、创建、更新页面,查询数据库行,管理块与评论,并调用 Notion AI。
主要能力:search 搜索(仅标题);database list/get/schema/query 查询数据库;page get/create/update/trash/restore 及 archive/unarchive;block list/append/update/delete/move/replace;comment list/page/inline;v3 后端支持 export、backlinks、history、activity log 与 ai 系列命令;user list/me 查看用户。
使用方式:先认证。OAuth 用 agent-notion auth setup-oauth 与 auth login;集成令牌通过 stdin 导入,如 printf '%s' "$NOTION_TOKEN" | agent-notion auth import;v3 功能用 auth import-desktop 或 auth import-browser chrome。命令直接调用,如 agent-notion search query "Project Plan"。默认 --format jsonl 输出 NDJSON,可用 --format json|yaml 折叠为 data 信封;分页用 --limit 与 --cursor;--expand/--full 解除字段截断;破坏性命令需 --yes。
适用场景:在智能体或脚本中批量读写 Notion 内容、按属性过滤数据库行、导出页面或整个工作空间、查看页面历史与活动、调用 Notion AI 对话并可选只读模式。
限制:search 不检索正文、评论或属性值;Archive 与 AI、export 等 v3 命令必须使用桌面会话;字段默认截断 200 字符;评论不支持讨论串且无法编辑删除;令牌不可经 --token 传入以防泄入上下文。