重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
vibe-notionbot by devxoul/vibe-notion
npx skills add https://github.com/devxoul/vibe-notion --skill vibe-notionbot一个 TypeScript CLI 工具,使 AI 代理和人类能够通过官方 Notion API 与 Notion 工作区交互。支持页面、数据库、块、用户、评论和搜索。
此包提供两个 CLI。根据您的情况选择正确的 CLI:
| vibe-notion | vibe-notionbot (此 CLI)
---|---|---
API | 非官方私有 API | 官方 Notion API
认证 | 从 Notion 桌面应用自动提取的 token_v2 | NOTION_TOKEN 环境变量(集成令牌)
身份 | 以用户身份操作 | 以机器人身份操作
设置 | 零设置 — 凭据自动提取 | 手动 — 在 notion.so/my-integrations 创建集成
数据库行 | add-row, update-row | 通过 page create --database 创建
视图管理 | view-get, , , , | 不支持
工作区列表 | 支持 | 不支持
稳定性 | 私有 API — Notion 变更时可能失效 | 官方版本化 API — 稳定
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
view-updateview-listview-addview-delete决策流程:
vibe-notionNOTION_TOKEN 但没有桌面应用 → 使用 vibe-notionbot (此 CLI)vibe-notion (功能更广,零设置)切勿直接调用 Notion API。 请始终使用本技能中描述的 vibe-notionbot CLI 命令。不要向 Notion API 发送原始 HTTP 请求或直接使用 @notionhq/client。直接调用 API 有暴露凭据的风险,并可能触发 Notion 的滥用检测,导致用户账户被封锁。
如果您需要的功能 vibe-notionbot 不支持,请告知用户并主动提出代表他们在 devxoul/vibe-notion 提交功能请求。提交前,请删除任何真实的用户数据 — ID、姓名、电子邮件、令牌、页面内容或任何可能识别用户或其工作区的信息。请改用通用占位符,并将问题重点放在描述缺失的功能上。
切勿编写脚本(Python、TypeScript、Bash 等)来自动化 Notion 操作。 batch 命令已经可以处理任意规模的批量操作。编写脚本来循环调用 API 总是错误的 — 请改用带 --file 参数的 batch 命令。
即使在以下情况下也适用:
如果您发现自己想“我应该为此写个脚本”,请停止并改用 batch。
# 检查认证状态
vibe-notionbot auth status
# 搜索页面或数据库
vibe-notionbot search "Project Roadmap"
# 列出所有数据库
vibe-notionbot database list
# 创建新页面
vibe-notionbot page create --parent <parent_id> --title "My New Page"
从 Notion 开发者门户 获取集成令牌,并设置 NOTION_TOKEN 环境变量。
export NOTION_TOKEN=secret_xxx
vibe-notionbot auth status
集成令牌提供对官方 Notion API (@notionhq/client) 的访问权限。
# 检索页面
vibe-notionbot page get <page_id>
# 在父页面或数据库下创建新页面
vibe-notionbot page create --parent <parent_id> --title "New Page Title"
vibe-notionbot page create --parent <database_id> --title "New Database Item" --database
# 使用 Markdown 内容创建页面
vibe-notionbot page create --parent <parent_id> --title "My Doc" --markdown '# Hello\n\nThis is **bold** text.'
# 使用文件中的 Markdown 创建页面
vibe-notionbot page create --parent <parent_id> --title "My Doc" --markdown-file ./content.md
# 使用包含本地图片的 Markdown 创建页面(自动上传到 Notion)
vibe-notionbot page create --parent <parent_id> --title "My Doc" --markdown-file ./doc-with-images.md
# 更新页面属性
vibe-notionbot page update <page_id> --set "Status=In Progress" --set "Priority=High"
# 用新的 Markdown 替换页面上的所有内容
vibe-notionbot page update <page_id> --replace-content --markdown '# New Content'
vibe-notionbot page update <page_id> --replace-content --markdown-file ./updated.md
# 归档(删除)页面
vibe-notionbot page archive <page_id>
# 检索特定页面属性
vibe-notionbot page property <page_id> <property_id>
# 检索数据库架构
vibe-notionbot database get <database_id>
# 查询数据库,可选过滤器和排序
vibe-notionbot database query <database_id> --filter '{"property": "Status", "select": {"equals": "In Progress"}}'
vibe-notionbot database query <database_id> --sort '[{"property": "Created time", "direction": "descending"}]'
vibe-notionbot database query <database_id> --page-size 10 --start-cursor <cursor>
# 在父页面下创建数据库
vibe-notionbot database create --parent <page_id> --title "My Database" --properties '{"Name": {"title": {}}}'
# 更新数据库架构或标题
vibe-notionbot database update <database_id> --title "Updated Title"
vibe-notionbot database update <database_id> --properties '{"Status": {"select": {"options": [{"name": "Active"}, {"name": "Archived"}]}}}'
vibe-notionbot database update <database_id> --title "Updated Title" --properties '{"Status": {"select": {}}}'
# 从数据库中删除属性
vibe-notionbot database delete-property <database_id> --property "Status"
# 列出集成可访问的所有数据库
vibe-notionbot database list
vibe-notionbot database list --page-size 10 --start-cursor <cursor>
# 检索块
vibe-notionbot block get <block_id>
# 列出块的直接子块(分页)
vibe-notionbot block children <block_id>
vibe-notionbot block children <block_id> --page-size 50 --start-cursor <cursor>
# 向父块追加子块
vibe-notionbot block append <parent_id> --content '[{"type": "paragraph", "paragraph": {"rich_text": [{"type": "text", "text": {"content": "Hello World"}}]}}]'
# 将 Markdown 内容作为块追加
vibe-notionbot block append <parent_id> --markdown '# Hello\n\nThis is **bold** text.'
# 从文件追加 Markdown
vibe-notionbot block append <parent_id> --markdown-file ./content.md
# 追加包含本地图片的 Markdown(自动上传到 Notion)
vibe-notionbot block append <parent_id> --markdown-file ./doc-with-images.md
# 追加嵌套 Markdown(缩进列表变为嵌套子块)
vibe-notionbot block append <parent_id> --markdown '- Parent item\n - Child item\n - Grandchild item'
# 在特定块之后追加块(位置插入)
vibe-notionbot block append <parent_id> --after <block_id> --markdown '# Inserted after specific block'
vibe-notionbot block append <parent_id> --after <block_id> --content '[{"type": "paragraph", "paragraph": {"rich_text": [{"type": "text", "text": {"content": "Inserted after"}}]}}]'
# 在特定块之前追加块
vibe-notionbot block append <parent_id> --before <block_id> --markdown '# Inserted before specific block'
# 更新块的内容
vibe-notionbot block update <block_id> --content '{"paragraph": {"rich_text": [{"type": "text", "text": {"content": "Updated content"}}]}}'
# 删除(归档)块
vibe-notionbot block delete <block_id>
# 将文件作为块上传(图片或文件块)
vibe-notionbot block upload <parent_id> --file ./image.png --pretty
vibe-notionbot block upload <parent_id> --file ./document.pdf --pretty
vibe-notionbot block upload <parent_id> --file ./image.png --after <block_id> --pretty
vibe-notionbot block upload <parent_id> --file ./image.png --before <block_id> --pretty
# 列出工作区中的所有用户
vibe-notionbot user list
vibe-notionbot user list --page-size 10 --start-cursor <cursor>
# 获取特定用户的信息
vibe-notionbot user get <user_id>
# 获取当前机器人/集成的信息
vibe-notionbot user me
# 在整个工作区中搜索
vibe-notionbot search "query text"
# 按对象类型过滤搜索结果
vibe-notionbot search "Project" --filter page
vibe-notionbot search "Tasks" --filter database
# 对搜索结果排序
vibe-notionbot search "Meeting" --sort desc
# 对搜索结果分页
vibe-notionbot search "Notes" --page-size 10 --start-cursor <cursor>
# 列出页面上的评论
vibe-notionbot comment list --page <page_id>
vibe-notionbot comment list --page <page_id> --page-size 10 --start-cursor <cursor>
# 列出特定块上的内联评论
vibe-notionbot comment list --block <block_id>
# 在页面上创建评论
vibe-notionbot comment create "This is a comment" --page <page_id>
# 回复评论线程(讨论)
vibe-notionbot comment create "Replying to thread" --discussion <discussion_id>
# 检索特定评论
vibe-notionbot comment get <comment_id>
在单个 CLI 调用中运行多个写入操作。当您需要同时创建、更新或删除多个项目时,请使用此功能,而不是重复调用 CLI。可以节省令牌并减少往返次数。
# 内联 JSON(无需 --workspace-id,使用 NOTION_TOKEN)
vibe-notionbot batch '<operations_json>'
# 从文件读取(用于大型负载)
vibe-notionbot batch --file ./operations.json '[]'
支持的操作(共 11 种):
| 操作 | 描述 |
|---|---|
page.create | 创建页面 |
page.update | 更新页面属性 |
page.archive | 归档页面 |
block.append | 向父块追加块 |
block.update | 更新块 |
block.delete | 删除块 |
comment.create | 创建评论 |
database.create | 创建数据库 |
database.update | 更新数据库标题或架构 |
database.delete-property | 删除数据库属性 |
block.upload | 将文件作为图片或文件块上传 |
操作格式:每个操作都是一个对象,包含 action 以及您传递给单个命令处理程序的相同字段。混合操作的示例:
[
{"action": "page.create", "parent": "<parent_id>", "title": "Meeting Notes"},
{"action": "block.append", "parent_id": "<page_id>", "markdown": "# Agenda\n\n- Item 1\n- Item 2"},
{"action": "comment.create", "content": "Page created via batch", "page": "<page_id>"}
]
输出格式:
{
"results": [
{"index": 0, "action": "page.create", "success": true, "data": {"id": "page-uuid", "...": "..."}},
{"index": 1, "action": "block.append", "success": true, "data": {"...": "..."}},
{"index": 2, "action": "comment.create", "success": true, "data": {"id": "comment-uuid", "...": "..."}}
],
"total": 3,
"succeeded": 3,
"failed": 0
}
快速失败行为:操作按顺序运行。如果任何操作失败,执行将立即停止。输出将包含所有已完成操作以及失败操作的结果。失败时进程以代码 1 退出,成功时以代码 0 退出。
{
"results": [
{"index": 0, "action": "page.create", "success": true, "data": {"...": "..."}},
{"index": 1, "action": "block.append", "success": false, "error": "Block not found"}
],
"total": 3,
"succeeded": 1,
"failed": 1
}
对于大型操作(数十或数百个项目),请使用 --file 以避免 shell 参数限制并保持可管理性。
步骤 1:将操作 JSON 写入文件,然后使用 --file 运行批量操作:
# 将操作写入文件(使用您的 Write 工具),然后:
vibe-notionbot batch --file ./operations.json '[]'
多轮模式 — 当新项目需要相互引用时(例如,页面属性链接到另一个新创建的页面):
第 1 轮:创建项目 A, B, C(无交叉引用) → 获取 A, B, C 的 ID
第 2 轮:更新 A.related=B, C.parent_ref=A(使用第 1 轮中的真实 ID)
这与脚本的结果相同,但无需编写任何代码。只需两次批量调用。
Notion 对其 API 强制执行速率限制。批量操作按顺序运行,因此大型批量操作(30 个以上)可能触发 429 Too Many Requests 错误。为避免这种情况:
将大型批量操作拆分为每批约 25-30 个操作 如果批量操作中途因 429 失败,请仅使用剩余(未处理的)操作重新运行 batch 输出显示在失败之前哪些操作成功 — 使用 index 字段确定从何处恢复
所有命令默认输出 JSON 供 AI 使用:
{
"id": "...",
"object": "page",
"properties": { ... }
}
使用 --pretty 标志获得格式化输出:
vibe-notionbot search "Project" --pretty
来自 Notion API 的常见错误:
object_not_found:ID 不正确或集成没有访问权限。unauthorized:NOTION_TOKEN 无效。rate_limited:请求过多。vibe-notionbot: command not foundvibe-notion 包未安装。使用包运行器直接运行它。询问用户使用哪一个:
npx -y -p vibe-notion vibe-notionbot ...
bunx -p vibe-notion vibe-notionbot ...
pnpm dlx --package vibe-notion vibe-notionbot ...
如果您已经知道用户首选的包运行器,请直接使用它,而不是询问。
block upload 支持。--set 的简单键=值对。每周安装次数
54
代码仓库
GitHub 星标数
16
首次出现
2026 年 2 月 17 日
安全审计
安装于
opencode47
gemini-cli47
antigravity46
claude-code46
codex45
github-copilot44
A TypeScript CLI tool that enables AI agents and humans to interact with Notion workspaces through the official Notion API. Supports pages, databases, blocks, users, comments, and search.
This package ships two CLIs. Pick the right one based on your situation:
| vibe-notion | vibe-notionbot (this CLI)
---|---|---
API | Unofficial private API | Official Notion API
Auth | token_v2 auto-extracted from Notion desktop app | NOTION_TOKEN env var (Integration token)
Identity | Acts as the user | Acts as a bot
Setup | Zero — credentials extracted automatically | Manual — create Integration at notion.so/my-integrations
Database rows | add-row, update-row | Create via page create --database
View management | view-get, view-update, view-list, view-add, view-delete | Not supported
Workspace listing | Supported | Not supported
Stability | Private API — may break on Notion changes | Official versioned API — stable
Decision flow:
vibe-notionNOTION_TOKEN is set but no desktop app → use vibe-notionbot (this CLI)vibe-notion (broader capabilities, zero setup)Never call the Notion API directly. Always use the vibe-notionbot CLI commands described in this skill. Do not make raw HTTP requests to the Notion API or use @notionhq/client directly. Direct API calls risk exposing credentials and may trigger Notion's abuse detection, getting the user's account blocked.
If a feature you need is not supported by vibe-notionbot, let the user know and offer to file a feature request at devxoul/vibe-notion on their behalf. Before submitting, strip out any real user data — IDs, names, emails, tokens, page content, or anything else that could identify the user or their workspace. Use generic placeholders instead and keep the issue focused on describing the missing capability.
Never write scripts (Python, TypeScript, Bash, etc.) to automate Notion operations. The batch command already handles bulk operations of any size. Writing a script to loop through API calls is always wrong — use batch with --file instead.
This applies even when:
If you catch yourself thinking "I should write a script for this," stop and use batch.
# Check authentication status
vibe-notionbot auth status
# Search for a page or database
vibe-notionbot search "Project Roadmap"
# List all databases
vibe-notionbot database list
# Create a new page
vibe-notionbot page create --parent <parent_id> --title "My New Page"
Set the NOTION_TOKEN environment variable with your integration token from the Notion Developer Portal.
export NOTION_TOKEN=secret_xxx
vibe-notionbot auth status
The integration token provides access to the official Notion API (@notionhq/client).
# Retrieve a page
vibe-notionbot page get <page_id>
# Create a new page under a parent page or database
vibe-notionbot page create --parent <parent_id> --title "New Page Title"
vibe-notionbot page create --parent <database_id> --title "New Database Item" --database
# Create a page with markdown content
vibe-notionbot page create --parent <parent_id> --title "My Doc" --markdown '# Hello\n\nThis is **bold** text.'
# Create a page with markdown from a file
vibe-notionbot page create --parent <parent_id> --title "My Doc" --markdown-file ./content.md
# Create a page with markdown containing local images (auto-uploaded to Notion)
vibe-notionbot page create --parent <parent_id> --title "My Doc" --markdown-file ./doc-with-images.md
# Update page properties
vibe-notionbot page update <page_id> --set "Status=In Progress" --set "Priority=High"
# Replace all content on a page with new markdown
vibe-notionbot page update <page_id> --replace-content --markdown '# New Content'
vibe-notionbot page update <page_id> --replace-content --markdown-file ./updated.md
# Archive (delete) a page
vibe-notionbot page archive <page_id>
# Retrieve a specific page property
vibe-notionbot page property <page_id> <property_id>
# Retrieve a database schema
vibe-notionbot database get <database_id>
# Query a database with optional filters and sorts
vibe-notionbot database query <database_id> --filter '{"property": "Status", "select": {"equals": "In Progress"}}'
vibe-notionbot database query <database_id> --sort '[{"property": "Created time", "direction": "descending"}]'
vibe-notionbot database query <database_id> --page-size 10 --start-cursor <cursor>
# Create a database under a parent page
vibe-notionbot database create --parent <page_id> --title "My Database" --properties '{"Name": {"title": {}}}'
# Update a database schema or title
vibe-notionbot database update <database_id> --title "Updated Title"
vibe-notionbot database update <database_id> --properties '{"Status": {"select": {"options": [{"name": "Active"}, {"name": "Archived"}]}}}'
vibe-notionbot database update <database_id> --title "Updated Title" --properties '{"Status": {"select": {}}}'
# Delete a property from a database
vibe-notionbot database delete-property <database_id> --property "Status"
# List all databases accessible by the integration
vibe-notionbot database list
vibe-notionbot database list --page-size 10 --start-cursor <cursor>
# Retrieve a block
vibe-notionbot block get <block_id>
# List direct children of a block (paginated)
vibe-notionbot block children <block_id>
vibe-notionbot block children <block_id> --page-size 50 --start-cursor <cursor>
# Append child blocks to a parent
vibe-notionbot block append <parent_id> --content '[{"type": "paragraph", "paragraph": {"rich_text": [{"type": "text", "text": {"content": "Hello World"}}]}}]'
# Append markdown content as blocks
vibe-notionbot block append <parent_id> --markdown '# Hello\n\nThis is **bold** text.'
# Append markdown from a file
vibe-notionbot block append <parent_id> --markdown-file ./content.md
# Append markdown with local images (auto-uploaded to Notion)
vibe-notionbot block append <parent_id> --markdown-file ./doc-with-images.md
# Append nested markdown (indented lists become nested children blocks)
vibe-notionbot block append <parent_id> --markdown '- Parent item\n - Child item\n - Grandchild item'
# Append blocks after a specific block (positional insertion)
vibe-notionbot block append <parent_id> --after <block_id> --markdown '# Inserted after specific block'
vibe-notionbot block append <parent_id> --after <block_id> --content '[{"type": "paragraph", "paragraph": {"rich_text": [{"type": "text", "text": {"content": "Inserted after"}}]}}]'
# Append blocks before a specific block
vibe-notionbot block append <parent_id> --before <block_id> --markdown '# Inserted before specific block'
# Update a block's content
vibe-notionbot block update <block_id> --content '{"paragraph": {"rich_text": [{"type": "text", "text": {"content": "Updated content"}}]}}'
# Delete (archive) a block
vibe-notionbot block delete <block_id>
# Upload a file as a block (image or file block)
vibe-notionbot block upload <parent_id> --file ./image.png --pretty
vibe-notionbot block upload <parent_id> --file ./document.pdf --pretty
vibe-notionbot block upload <parent_id> --file ./image.png --after <block_id> --pretty
vibe-notionbot block upload <parent_id> --file ./image.png --before <block_id> --pretty
# List all users in the workspace
vibe-notionbot user list
vibe-notionbot user list --page-size 10 --start-cursor <cursor>
# Get info for a specific user
vibe-notionbot user get <user_id>
# Get info for the current bot/integration
vibe-notionbot user me
# Search across the entire workspace
vibe-notionbot search "query text"
# Filter search by object type
vibe-notionbot search "Project" --filter page
vibe-notionbot search "Tasks" --filter database
# Sort search results
vibe-notionbot search "Meeting" --sort desc
# Paginate search results
vibe-notionbot search "Notes" --page-size 10 --start-cursor <cursor>
# List comments on a page
vibe-notionbot comment list --page <page_id>
vibe-notionbot comment list --page <page_id> --page-size 10 --start-cursor <cursor>
# List inline comments on a specific block
vibe-notionbot comment list --block <block_id>
# Create a comment on a page
vibe-notionbot comment create "This is a comment" --page <page_id>
# Reply to a comment thread (discussion)
vibe-notionbot comment create "Replying to thread" --discussion <discussion_id>
# Retrieve a specific comment
vibe-notionbot comment get <comment_id>
Run multiple write operations in a single CLI call. Use this instead of calling the CLI repeatedly when you need to create, update, or delete multiple things at once. Saves tokens and reduces round-trips.
# Inline JSON (no --workspace-id needed, uses NOTION_TOKEN)
vibe-notionbot batch '<operations_json>'
# From file (for large payloads)
vibe-notionbot batch --file ./operations.json '[]'
Supported actions (11 total):
| Action | Description |
|---|---|
page.create | Create a page |
page.update | Update page properties |
page.archive | Archive a page |
block.append | Append blocks to a parent |
block.update | Update a block |
block.delete | Delete a block |
Operation format : Each operation is an object with action plus the same fields you'd pass to the individual command handler. Example with mixed actions:
[
{"action": "page.create", "parent": "<parent_id>", "title": "Meeting Notes"},
{"action": "block.append", "parent_id": "<page_id>", "markdown": "# Agenda\n\n- Item 1\n- Item 2"},
{"action": "comment.create", "content": "Page created via batch", "page": "<page_id>"}
]
Output format :
{
"results": [
{"index": 0, "action": "page.create", "success": true, "data": {"id": "page-uuid", "...": "..."}},
{"index": 1, "action": "block.append", "success": true, "data": {"...": "..."}},
{"index": 2, "action": "comment.create", "success": true, "data": {"id": "comment-uuid", "...": "..."}}
],
"total": 3,
"succeeded": 3,
"failed": 0
}
Fail-fast behavior : Operations run sequentially. If any operation fails, execution stops immediately. The output will contain results for all completed operations plus the failed one. The process exits with code 1 on failure, 0 on success.
{
"results": [
{"index": 0, "action": "page.create", "success": true, "data": {"...": "..."}},
{"index": 1, "action": "block.append", "success": false, "error": "Block not found"}
],
"total": 3,
"succeeded": 1,
"failed": 1
}
For large operations (tens or hundreds of items), use --file to avoid shell argument limits and keep things manageable.
Step 1 : Write the operations JSON to a file, then run batch with --file:
# Write operations to a file (using your Write tool), then:
vibe-notionbot batch --file ./operations.json '[]'
Multi-pass pattern — when new items need to reference each other (e.g., a page property linking to another newly created page):
Pass 1: Create items A, B, C (no cross-refs) → get IDs for A, B, C
Pass 2: Update A.related=B, C.parent_ref=A (using real IDs from Pass 1)
This is the same result as a script, but without writing any code. Just two batch calls.
Notion enforces rate limits on its API. Batch operations run sequentially, so a large batch (30+ operations) can trigger 429 Too Many Requests errors. To avoid this:
Split large batches into chunks of ~25-30 operations per batch call If a batch fails mid-way with a 429, re-run with only the remaining (unprocessed) operations The batch output shows which operations succeeded before the failure — use the index field to determine where to resume
All commands output JSON by default for AI consumption:
{
"id": "...",
"object": "page",
"properties": { ... }
}
Use --pretty flag for formatted output:
vibe-notionbot search "Project" --pretty
Common errors from the Notion API:
object_not_found: The ID is incorrect or the integration doesn't have access.unauthorized: The NOTION_TOKEN is invalid.rate_limited: Too many requests.vibe-notionbot: command not foundThe vibe-notion package is not installed. Run it directly using a package runner. Ask the user which one to use:
npx -y -p vibe-notion vibe-notionbot ...
bunx -p vibe-notion vibe-notionbot ...
pnpm dlx --package vibe-notion vibe-notionbot ...
If you already know the user's preferred package runner, use it directly instead of asking.
block upload.--set.Weekly Installs
54
Repository
GitHub Stars
16
First Seen
Feb 17, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode47
gemini-cli47
antigravity46
claude-code46
codex45
github-copilot44
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
50,200 周安装
comment.create |
| Create a comment |
database.create | Create a database |
database.update | Update database title or schema |
database.delete-property | Delete a database property |
block.upload | Upload a file as an image or file block |