vibe-notion
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVibe Notion
Vibe Notion
A TypeScript CLI tool that enables AI agents and humans to interact with Notion workspaces through the unofficial private API. Supports full CRUD operations on pages, databases, blocks, search, and user management.
Note: This skill uses Notion's internal/private API (), which is separate from the official public API. For official API access, use/api/v3/.vibe-notionbot
一款TypeScript CLI工具,支持AI Agent和人类通过非官方私有API与Notion工作区交互。支持对页面、数据库、块、搜索和用户管理的完整CRUD操作。
注意:本工具使用Notion的内部/私有API(),与官方公开API相互独立。如需使用官方API,请使用/api/v3/。vibe-notionbot
Quick Start
快速开始
bash
undefinedbash
undefined1. Extract token_v2 from Notion desktop app
1. 从Notion桌面应用中提取token_v2
vibe-notion auth extract
vibe-notion auth extract
2. Find your workspace ID
2. 查找你的工作区ID
vibe-notion workspace list --pretty
vibe-notion workspace list --pretty
3. Search for a page
3. 搜索页面
vibe-notion search "Roadmap" --workspace-id <workspace-id> --pretty
vibe-notion search "Roadmap" --workspace-id <workspace-id> --pretty
4. Get page content
4. 获取页面内容
vibe-notion page get <page-id> --workspace-id <workspace-id> --pretty
vibe-notion page get <page-id> --workspace-id <workspace-id> --pretty
5. Query a database
5. 查询数据库
vibe-notion database query <collection-id> --workspace-id <workspace-id> --pretty
> **Important**: `--workspace-id` is required for ALL commands that operate within a specific workspace. Use `vibe-notion workspace list` to find your workspace ID.vibe-notion database query <collection-id> --workspace-id <workspace-id> --pretty
> **重要提示**:所有在特定工作区内操作的命令都需要`--workspace-id`参数。使用`vibe-notion workspace list`命令查找你的工作区ID。Authentication
身份验证
Token Extraction (Desktop App)
从桌面应用提取Token
Extract from the Notion desktop app automatically. No API keys or OAuth needed.
token_v2bash
undefined自动从Notion桌面应用中提取,无需API密钥或OAuth授权。
token_v2bash
undefinedExtract token_v2 from Notion desktop app
从Notion桌面应用提取token_v2
vibe-notion auth extract
vibe-notion auth extract
Check auth status (shows extracted token_v2)
检查身份验证状态(显示已提取的token_v2)
vibe-notion auth status
vibe-notion auth status
Remove stored token_v2
删除已存储的token_v2
vibe-notion auth logout
On macOS, your system may prompt for Keychain access — this is normal and required to decrypt the cookie.
The extracted `token_v2` is stored at `~/.config/vibe-notion/credentials.json` with `0600` permissions.vibe-notion auth logout
在macOS系统中,你的电脑可能会提示访问钥匙串——这是正常现象,是解密Cookie所必需的。
提取的`token_v2`会存储在`~/.config/vibe-notion/credentials.json`文件中,权限设置为`0600`。Memory
持久化内存
The agent maintains a file as persistent memory across sessions. This is agent-managed — the CLI does not read or write this file. Use the and tools to manage your memory file.
~/.config/vibe-notion/MEMORY.mdReadWriteAgent会维护一个文件作为跨会话的持久化内存。该文件由Agent管理——CLI不会读取或写入此文件。请使用和工具管理你的内存文件。
~/.config/vibe-notion/MEMORY.mdReadWriteReading Memory
读取内存
At the start of every task, read using the tool to load any previously discovered workspace IDs, page IDs, database IDs, and user preferences.
~/.config/vibe-notion/MEMORY.mdRead- If the file doesn't exist yet, that's fine — proceed without it and create it when you first have useful information to store.
- If the file can't be read (permissions, missing directory), proceed without memory — don't error out.
在每个任务开始时,使用工具读取文件,加载之前发现的工作区ID、页面ID、数据库ID和用户偏好设置。
Read~/.config/vibe-notion/MEMORY.md- 如果文件尚未存在,无需担心——可以继续操作,当有有用信息需要存储时再创建该文件。
- 如果无法读取文件(权限问题、目录缺失),无需报错,直接继续操作即可。
Writing Memory
写入内存
After discovering useful information, update using the tool. Write triggers include:
~/.config/vibe-notion/MEMORY.mdWrite- After discovering workspace IDs (from )
workspace list - After discovering useful page IDs, database IDs, collection IDs (from ,
search,page list,page get, etc.)database list - After the user gives you an alias or preference ("call this the Tasks DB", "my main workspace is X")
- After discovering page/database structure (parent-child relationships, what databases live under which pages)
When writing, include the complete file content — the tool overwrites the entire file.
Write发现有用信息后,使用工具更新文件。触发写入操作的场景包括:
Write~/.config/vibe-notion/MEMORY.md- 发现工作区ID后(来自命令)
workspace list - 发现有用的页面ID、数据库ID、集合ID后(来自、
search、page list、page get等命令)database list - 用户提供别名或偏好设置后(例如:“将这个称为任务数据库”、“我的主工作区是X”)
- 发现页面/数据库的结构后(父子关系、哪些数据库属于哪些页面)
写入时,请包含完整的文件内容——工具会覆盖整个文件。
WriteWhat to Store
存储内容
- Workspace IDs with names
- Page IDs with titles and parent context
- Database/collection IDs with titles and parent context
- User-given aliases ("Tasks DB", "Main workspace")
- Commonly used view IDs
- Parent-child relationships (which databases are under which pages)
- Any user preference expressed during interaction
- 带名称的工作区ID
- 带标题和父级上下文的页面ID
- 带标题和父级上下文的数据库/集合ID
- 用户指定的别名(例如:“任务数据库”、“主工作区”)
- 常用的视图ID
- 父子关系(哪些数据库属于哪些页面)
- 交互过程中用户表达的任何偏好设置
What NOT to Store
禁止存储内容
Never store , credentials, API keys, or any sensitive data. Never store full page content (just IDs and titles). Never store block-level IDs unless they're persistent references (like database blocks).
token_v2切勿存储、凭证、API密钥或任何敏感数据。切勿存储完整的页面内容(仅存储ID和标题)。除非是持久引用(如数据库块),否则切勿存储块级ID。
token_v2Handling Stale Data
处理过期数据
If a memorized ID returns an error (page not found, access denied), remove it from . Don't blindly trust memorized data — verify when something seems off. Prefer re-searching over using a memorized ID that might be stale.
MEMORY.md如果记忆中的ID返回错误(页面未找到、访问被拒绝),请将其从中删除。不要盲目信任记忆中的数据——当出现异常时请进行验证。相比使用可能过期的记忆ID,重新搜索更可靠。
MEMORY.mdFormat / Example
格式 / 示例
Here's a concrete example of how to structure your :
MEMORY.mdmarkdown
undefined以下是文件的具体结构示例:
MEMORY.mdmarkdown
undefinedVibe Notion Memory
Vibe Notion Memory
Workspaces
Workspaces
- — Acme Corp (default)
abc123-...
- — Acme Corp (default)
abc123-...
Pages (Acme Corp)
Pages (Acme Corp)
- — Product Roadmap (top-level)
page-id-1 - — Q1 Planning (under Product Roadmap)
page-id-2
- — Product Roadmap (top-level)
page-id-1 - — Q1 Planning (under Product Roadmap)
page-id-2
Databases (Acme Corp)
Databases (Acme Corp)
- — Tasks (under Product Roadmap, views:
coll-id-1)view-1 - — Contacts (top-level)
coll-id-2
- — Tasks (under Product Roadmap, views:
coll-id-1)view-1 - — Contacts (top-level)
coll-id-2
Aliases
Aliases
- "roadmap" → (Product Roadmap)
page-id-1 - "tasks" → (Tasks database)
coll-id-1
- "roadmap" → (Product Roadmap)
page-id-1 - "tasks" → (Tasks database)
coll-id-1
Notes
Notes
- User prefers --pretty output for search results
- Main workspace is "Acme Corp"
> Memory lets you skip repeated `search` and `workspace list` calls. When you already know an ID from a previous session, use it directly.- User prefers --pretty output for search results
- Main workspace is "Acme Corp"
> 内存功能可让你跳过重复的`search`和`workspace list`命令。如果在之前的会话中已经知道某个ID,可以直接使用它。Commands
命令
Auth Commands
身份验证命令
bash
vibe-notion auth extract # Extract token_v2 from Notion desktop app
vibe-notion auth status # Check authentication status
vibe-notion auth logout # Remove stored token_v2bash
vibe-notion auth extract # 从Notion桌面应用提取token_v2
vibe-notion auth status # 检查身份验证状态
vibe-notion auth logout # 删除已存储的token_v2Page Commands
页面命令
bash
undefinedbash
undefinedList pages in a space (top-level only)
列出空间中的页面(仅顶级页面)
vibe-notion page list --workspace-id <workspace_id> --pretty
vibe-notion page list --workspace-id <workspace_id> --depth 2 --pretty
vibe-notion page list --workspace-id <workspace_id> --pretty
vibe-notion page list --workspace-id <workspace_id> --depth 2 --pretty
Get a page and all its content blocks
获取页面及其所有内容块
vibe-notion page get <page_id> --workspace-id <workspace_id> --pretty
vibe-notion page get <page_id> --workspace-id <workspace_id> --limit 50
vibe-notion page get <page_id> --workspace-id <workspace_id> --backlinks --pretty
vibe-notion page get <page_id> --workspace-id <workspace_id> --pretty
vibe-notion page get <page_id> --workspace-id <workspace_id> --limit 50
vibe-notion page get <page_id> --workspace-id <workspace_id> --backlinks --pretty
Create a new page under a parent
在父页面下创建新页面
vibe-notion page create --workspace-id <workspace_id> --parent <parent_id> --title "My Page" --pretty
vibe-notion page create --workspace-id <workspace_id> --parent <parent_id> --title "My Page" --pretty
Create a page with markdown content
使用Markdown内容创建页面
vibe-notion page create --workspace-id <workspace_id> --parent <parent_id> --title "My Doc" --markdown '# Hello\n\nThis is bold text.'
vibe-notion page create --workspace-id <workspace_id> --parent <parent_id> --title "My Doc" --markdown '# Hello\n\nThis is bold text.'
Create a page with markdown from a file
使用文件中的Markdown内容创建页面
vibe-notion page create --workspace-id <workspace_id> --parent <parent_id> --title "My Doc" --markdown-file ./content.md
vibe-notion page create --workspace-id <workspace_id> --parent <parent_id> --title "My Doc" --markdown-file ./content.md
Replace all content on a page with new markdown
使用新的Markdown内容替换页面的所有内容
vibe-notion page update <page_id> --workspace-id <workspace_id> --replace-content --markdown '# New Content'
vibe-notion page update <page_id> --workspace-id <workspace_id> --replace-content --markdown-file ./updated.md
vibe-notion page update <page_id> --workspace-id <workspace_id> --replace-content --markdown '# New Content'
vibe-notion page update <page_id> --workspace-id <workspace_id> --replace-content --markdown-file ./updated.md
Update page title or icon
更新页面标题或图标
vibe-notion page update <page_id> --workspace-id <workspace_id> --title "New Title" --pretty
vibe-notion page update <page_id> --workspace-id <workspace_id> --icon "🚀" --pretty
vibe-notion page update <page_id> --workspace-id <workspace_id> --title "New Title" --pretty
vibe-notion page update <page_id> --workspace-id <workspace_id> --icon "🚀" --pretty
Archive a page
归档页面
vibe-notion page archive <page_id> --workspace-id <workspace_id> --pretty
undefinedvibe-notion page archive <page_id> --workspace-id <workspace_id> --pretty
undefinedDatabase Commands
数据库命令
bash
undefinedbash
undefinedGet database schema
获取数据库架构
vibe-notion database get <collection_id> --workspace-id <workspace_id> --pretty
vibe-notion database get <collection_id> --workspace-id <workspace_id> --pretty
Query a database (auto-resolves default view)
查询数据库(自动解析默认视图)
vibe-notion database query <collection_id> --workspace-id <workspace_id> --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --limit 10 --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --view-id <view_id> --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --search-query "keyword" --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --timezone "America/New_York" --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --limit 10 --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --view-id <view_id> --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --search-query "keyword" --pretty
vibe-notion database query <collection_id> --workspace-id <workspace_id> --timezone "America/New_York" --pretty
List all databases in workspace
列出工作区中的所有数据库
vibe-notion database list --workspace-id <workspace_id> --pretty
vibe-notion database list --workspace-id <workspace_id> --pretty
Create a database
创建数据库
vibe-notion database create --workspace-id <workspace_id> --parent <page_id> --title "Tasks" --pretty
vibe-notion database create --workspace-id <workspace_id> --parent <page_id> --title "Tasks" --properties '{"status":{"name":"Status","type":"select"}}' --pretty
vibe-notion database create --workspace-id <workspace_id> --parent <page_id> --title "Tasks" --pretty
vibe-notion database create --workspace-id <workspace_id> --parent <page_id> --title "Tasks" --properties '{"status":{"name":"Status","type":"select"}}' --pretty
Update database title or schema
更新数据库标题或架构
vibe-notion database update <collection_id> --workspace-id <workspace_id> --title "New Name" --pretty
vibe-notion database update <collection_id> --workspace-id <workspace_id> --title "New Name" --pretty
Add a row to a database
向数据库添加行
vibe-notion database add-row <collection_id> --workspace-id <workspace_id> --title "Row title" --pretty
vibe-notion database add-row <collection_id> --workspace-id <workspace_id> --title "Row title" --properties '{"Status":"In Progress","Due":{"start":"2025-03-01"}}' --pretty
vibe-notion database add-row <collection_id> --workspace-id <workspace_id> --title "Row title" --pretty
vibe-notion database add-row <collection_id> --workspace-id <workspace_id> --title "Row title" --properties '{"Status":"In Progress","Due":{"start":"2025-03-01"}}' --pretty
Get view configuration and property visibility
获取视图配置和属性可见性
vibe-notion database view-get <view_id> --workspace-id <workspace_id> --pretty
vibe-notion database view-get <view_id> --workspace-id <workspace_id> --pretty
Show or hide properties on a view (comma-separated names)
在视图中显示或隐藏属性(逗号分隔的名称)
vibe-notion database view-update <view_id> --workspace-id <workspace_id> --show "ID,Due" --pretty
vibe-notion database view-update <view_id> --workspace-id <workspace_id> --hide "Assignee" --pretty
vibe-notion database view-update <view_id> --workspace-id <workspace_id> --show "Status" --hide "Due" --pretty
undefinedvibe-notion database view-update <view_id> --workspace-id <workspace_id> --show "ID,Due" --pretty
vibe-notion database view-update <view_id> --workspace-id <workspace_id> --hide "Assignee" --pretty
vibe-notion database view-update <view_id> --workspace-id <workspace_id> --show "Status" --hide "Due" --pretty
undefinedBlock Commands
块命令
bash
undefinedbash
undefinedGet a specific block
获取特定块
vibe-notion block get <block_id> --workspace-id <workspace_id> --pretty
vibe-notion block get <block_id> --workspace-id <workspace_id> --backlinks --pretty
vibe-notion block get <block_id> --workspace-id <workspace_id> --pretty
vibe-notion block get <block_id> --workspace-id <workspace_id> --backlinks --pretty
List child blocks
列出子块
vibe-notion block children <block_id> --workspace-id <workspace_id> --pretty
vibe-notion block children <block_id> --workspace-id <workspace_id> --limit 50 --pretty
vibe-notion block children <block_id> --workspace-id <workspace_id> --start-cursor '<next_cursor_json>' --pretty
vibe-notion block children <block_id> --workspace-id <workspace_id> --pretty
vibe-notion block children <block_id> --workspace-id <workspace_id> --limit 50 --pretty
vibe-notion block children <block_id> --workspace-id <workspace_id> --start-cursor '<next_cursor_json>' --pretty
Append child blocks
添加子块
vibe-notion block append <parent_id> --workspace-id <workspace_id> --content '[{"type":"text","properties":{"title":[["Hello world"]]}}]' --pretty
vibe-notion block append <parent_id> --workspace-id <workspace_id> --content '[{"type":"text","properties":{"title":[["Hello world"]]}}]' --pretty
Append markdown content as blocks
将Markdown内容作为块添加
vibe-notion block append <parent_id> --workspace-id <workspace_id> --markdown '# Hello\n\nThis is bold text.'
vibe-notion block append <parent_id> --workspace-id <workspace_id> --markdown '# Hello\n\nThis is bold text.'
Append markdown from a file
将文件中的Markdown内容作为块添加
vibe-notion block append <parent_id> --workspace-id <workspace_id> --markdown-file ./content.md
vibe-notion block append <parent_id> --workspace-id <workspace_id> --markdown-file ./content.md
Update a block
更新块
vibe-notion block update <block_id> --workspace-id <workspace_id> --content '{"properties":{"title":[["Updated text"]]}}' --pretty
vibe-notion block update <block_id> --workspace-id <workspace_id> --content '{"properties":{"title":[["Updated text"]]}}' --pretty
Delete a block
删除块
vibe-notion block delete <block_id> --workspace-id <workspace_id> --pretty
undefinedvibe-notion block delete <block_id> --workspace-id <workspace_id> --pretty
undefinedBlock Types Reference
块类型参考
The internal API uses a specific block format. Here are all supported types:
内部API使用特定的块格式。以下是所有支持的类型:
Headings
标题
json
{"type": "header", "properties": {"title": [["Heading 1"]]}}
{"type": "sub_header", "properties": {"title": [["Heading 2"]]}}
{"type": "sub_sub_header", "properties": {"title": [["Heading 3"]]}}json
{"type": "header", "properties": {"title": [["Heading 1"]]}}
{"type": "sub_header", "properties": {"title": [["Heading 2"]]}}
{"type": "sub_sub_header", "properties": {"title": [["Heading 3"]]}}Text
文本
json
{"type": "text", "properties": {"title": [["Plain text paragraph"]]}}json
{"type": "text", "properties": {"title": [["Plain text paragraph"]]}}Lists
列表
json
{"type": "bulleted_list", "properties": {"title": [["Bullet item"]]}}
{"type": "numbered_list", "properties": {"title": [["Numbered item"]]}}json
{"type": "bulleted_list", "properties": {"title": [["Bullet item"]]}}
{"type": "numbered_list", "properties": {"title": [["Numbered item"]]}}To-Do / Checkbox
待办事项 / 复选框
json
{"type": "to_do", "properties": {"title": [["Task item"]], "checked": [["Yes"]]}}
{"type": "to_do", "properties": {"title": [["Unchecked task"]], "checked": [["No"]]}}json
{"type": "to_do", "properties": {"title": [["Task item"]], "checked": [["Yes"]]}}
{"type": "to_do", "properties": {"title": [["Unchecked task"]], "checked": [["No"]]}}Code Block
代码块
json
{"type": "code", "properties": {"title": [["console.log('hello')"]], "language": [["javascript"]]}}json
{"type": "code", "properties": {"title": [["console.log('hello')"]], "language": [["javascript"]]}}Quote
引用
json
{"type": "quote", "properties": {"title": [["Quoted text"]]}}json
{"type": "quote", "properties": {"title": [["Quoted text"]]}}Divider
分隔线
json
{"type": "divider"}json
{"type": "divider"}Rich Text Formatting
富文本格式
Rich text uses nested arrays with formatting codes:
| Format | Syntax | Example |
|---|---|---|
| Plain | | |
| Bold | | |
| Italic | | |
| Strikethrough | | |
| Inline code | | |
| Link | | |
| Bold + Italic | | |
Multiple segments:
[["plain "], ["bold", [["b"]]], [" more plain"]]富文本使用带有格式代码的嵌套数组:
| Format | Syntax | Example |
|---|---|---|
| Plain | | |
| Bold | | |
| Italic | | |
| Strikethrough | | |
| Inline code | | |
| Link | | |
| Bold + Italic | | |
多段内容:
[["plain "], ["bold", [["b"]]], [" more plain"]]Comment Commands
评论命令
bash
undefinedbash
undefinedList comments on a page
列出页面上的评论
vibe-notion comment list --page <page_id> --workspace-id <workspace_id> --pretty
vibe-notion comment list --page <page_id> --workspace-id <workspace_id> --pretty
Create a comment on a page (starts a new discussion)
在页面上创建评论(启动新的讨论线程)
vibe-notion comment create "This is a comment" --page <page_id> --workspace-id <workspace_id> --pretty
vibe-notion comment create "This is a comment" --page <page_id> --workspace-id <workspace_id> --pretty
Reply to an existing discussion thread
回复现有的讨论线程
vibe-notion comment create "Replying to thread" --discussion <discussion_id> --workspace-id <workspace_id> --pretty
vibe-notion comment create "Replying to thread" --discussion <discussion_id> --workspace-id <workspace_id> --pretty
Get a specific comment by ID
通过ID获取特定评论
vibe-notion comment get <comment_id> --workspace-id <workspace_id> --pretty
undefinedvibe-notion comment get <comment_id> --workspace-id <workspace_id> --pretty
undefinedSearch Command
搜索命令
bash
undefinedbash
undefinedSearch across workspace (--workspace-id is required)
在工作区内搜索(必须提供--workspace-id)
vibe-notion search "query" --workspace-id <workspace_id> --pretty
vibe-notion search "query" --workspace-id <workspace_id> --limit 10 --pretty
vibe-notion search "query" --workspace-id <workspace_id> --start-cursor <offset> --pretty
undefinedvibe-notion search "query" --workspace-id <workspace_id> --pretty
vibe-notion search "query" --workspace-id <workspace_id> --limit 10 --pretty
vibe-notion search "query" --workspace-id <workspace_id> --start-cursor <offset> --pretty
undefinedUser Commands
用户命令
bash
undefinedbash
undefinedGet current user info
获取当前用户信息
vibe-notion user me --pretty
vibe-notion user me --pretty
Get a specific user
获取特定用户信息
vibe-notion user get <user_id> --workspace-id <workspace_id> --pretty
undefinedvibe-notion user get <user_id> --workspace-id <workspace_id> --pretty
undefinedOutput Format
输出格式
JSON (Default)
JSON(默认)
All commands output JSON by default for AI consumption:
bash
undefined所有命令默认输出JSON格式,供AI使用:
bash
undefinedSearch results
搜索结果
vibe-notion search "Roadmap" --workspace-id <workspace_id>
```json
{
"results": [
{
"id": "305c0fcf-90b3-807a-bc1a-dc7cc18e0022",
"title": "Getting Started",
"score": 76.58
}
],
"has_more": true,
"next_cursor": "20",
"total": 100
}bash
undefinedvibe-notion search "Roadmap" --workspace-id <workspace_id>
```json
{
"results": [
{
"id": "305c0fcf-90b3-807a-bc1a-dc7cc18e0022",
"title": "Getting Started",
"score": 76.58
}
],
"has_more": true,
"next_cursor": "20",
"total": 100
}bash
undefinedDatabase query — properties use human-readable field names from the collection schema
数据库查询——属性使用集合架构中的可读字段名称
vibe-notion database query <collection_id> --workspace-id <workspace_id>
```json
{
"results": [
{
"id": "row-uuid",
"properties": {
"Name": "Acme Corp",
"Status": "Active",
"Type": "Enterprise"
}
}
],
"has_more": false,
"next_cursor": null
}bash
undefinedvibe-notion database query <collection_id> --workspace-id <workspace_id>
```json
{
"results": [
{
"id": "row-uuid",
"properties": {
"Name": "Acme Corp",
"Status": "Active",
"Type": "Enterprise"
}
}
],
"has_more": false,
"next_cursor": null
}bash
undefinedPage get — returns page metadata with content blocks
获取页面——返回包含内容块的页面元数据
vibe-notion page get <page_id> --workspace-id <workspace_id>
```json
{
"id": "page-uuid",
"title": "My Page",
"blocks": [
{ "id": "block-1", "type": "text", "text": "Hello world" },
{ "id": "block-2", "type": "to_do", "text": "Task item" }
]
}bash
undefinedvibe-notion page get <page_id> --workspace-id <workspace_id>
```json
{
"id": "page-uuid",
"title": "My Page",
"blocks": [
{ "id": "block-1", "type": "text", "text": "Hello world" },
{ "id": "block-2", "type": "to_do", "text": "Task item" }
]
}bash
undefinedWith --backlinks: includes pages that link to this page/block
使用--backlinks:包含链接到此页面/块的页面
vibe-notion page get <page_id> --workspace-id <workspace_id> --backlinks
vibe-notion block get <block_id> --workspace-id <workspace_id> --backlinks
```json
{
"id": "page-uuid",
"title": "My Page",
"blocks": [...],
"backlinks": [
{ "id": "linking-page-uuid", "title": "Page That Links Here" }
]
}bash
undefinedvibe-notion page get <page_id> --workspace-id <workspace_id> --backlinks
vibe-notion block get <block_id> --workspace-id <workspace_id> --backlinks
```json
{
"id": "page-uuid",
"title": "My Page",
"blocks": [...],
"backlinks": [
{ "id": "linking-page-uuid", "title": "Page That Links Here" }
]
}bash
undefinedBlock get — collection_view blocks include collection_id and view_ids
获取块——collection_view块包含collection_id和view_ids
vibe-notion block get <block_id> --workspace-id <workspace_id>
```json
{
"id": "block-uuid",
"type": "collection_view",
"text": "",
"parent_id": "parent-uuid",
"collection_id": "collection-uuid",
"view_ids": ["view-uuid"]
}vibe-notion block get <block_id> --workspace-id <workspace_id>
```json
{
"id": "block-uuid",
"type": "collection_view",
"text": "",
"parent_id": "parent-uuid",
"collection_id": "collection-uuid",
"view_ids": ["view-uuid"]
}Pretty (Human-Readable)
美化格式(人类可读)
Use flag for formatted output on any command:
--prettybash
vibe-notion search "Roadmap" --workspace-id <workspace_id> --pretty在任何命令中使用标志获取格式化输出:
--prettybash
vibe-notion search "Roadmap" --workspace-id <workspace_id> --prettyWhen to Use --backlinks
--backlinks何时使用--backlinks
--backlinksBacklinks reveal which pages/databases link to a given page. This is critical for efficient navigation.
Use when:
--backlinks- Tracing relations: A search result looks like a select option, enum value, or relation target (e.g., a plan name or category). Backlinks instantly reveal all rows/pages that reference it via relation properties — no need to hunt for the parent database.
- Finding references: You found a page and want to know what other pages mention or link to it.
- Reverse lookups: Instead of querying every database to find rows pointing to a page, use backlinks on the target page to get them directly.
Example — finding who uses a specific plan:
bash
undefined反向链接显示哪些页面/数据库链接到给定页面。这对于高效导航至关重要。
使用的场景:
--backlinks- 追踪关系:搜索结果看起来像是选项、枚举值或关系目标(例如计划名称或类别)。反向链接可立即显示所有通过关系属性引用它的行/页面——无需查找父数据库。
- 查找引用:你找到了一个页面,想知道哪些其他页面提到或链接到它。
- 反向查找:无需查询每个数据库来查找指向某个页面的行,直接在目标页面上使用反向链接即可获取这些行。
示例——查找使用特定计划的对象:
bash
undefinedBAD: 15 API calls — search, open empty pages, trace parents, find database, query
糟糕:15次API调用——搜索、打开空页面、追踪父级、查找数据库、查询
vibe-notion search "Enterprise Plan" ...
vibe-notion page get <plan-page-id> ... # empty
vibe-notion block get <plan-page-id> ... # find parent
vibe-notion search "Enterprise Plan" ...
vibe-notion page get <plan-page-id> ... # empty
vibe-notion block get <plan-page-id> ... # find parent
... many more calls to discover the database
... 更多调用以发现数据库
GOOD: 2-3 API calls — search, then backlinks on the target
良好:2-3次API调用——搜索,然后在目标页面上使用反向链接
vibe-notion search "Enterprise Plan" ...
vibe-notion page get <plan-page-id> --backlinks --pretty
vibe-notion search "Enterprise Plan" ...
vibe-notion page get <plan-page-id> --backlinks --pretty
→ backlinks immediately show all people/rows linked to this plan
→ 反向链接立即显示所有链接到此计划的人员/行
undefinedundefinedPagination
分页
Commands that return lists support pagination via , fields:
has_morenext_cursor- : Cursor-based. Pass
block childrenvalue from previous response asnext_cursor.--start-cursor - : Offset-based. Pass
searchvalue (a number) asnext_cursor.--start-cursor - : Use
database queryto control page size.--limitindicates more results exist, but the private API does not support cursor-based pagination — increasehas_moreto fetch more rows.--limit
返回列表的命令通过和字段支持分页:
has_morenext_cursor- :基于游标。将上一次响应中的
block children值作为next_cursor传递。--start-cursor - :基于偏移量。将
search值(数字)作为next_cursor传递。--start-cursor - :使用
database query控制页面大小。--limit表示存在更多结果,但私有API不支持基于游标的分页——增加has_more以获取更多行。--limit
Troubleshooting
故障排除
If a command fails with "command not found", the CLI is not installed. Ask the user which package manager they prefer and offer these options:
vibe-notionnpm install -g vibe-notionyarn global add vibe-notionpnpm add -g vibe-notionbun add -g vibe-notion
如果命令返回“command not found”,说明CLI未安装。请询问用户偏好的包管理器,并提供以下选项:
vibe-notionnpm install -g vibe-notionyarn global add vibe-notionpnpm add -g vibe-notionbun add -g vibe-notion
Limitations
限制
- supports macOS and Linux. Windows DPAPI decryption is not yet supported.
auth extract - uses the unofficial internal API and may break if Notion changes it.
token_v2 - This is a private/unofficial API and is not supported by Notion.
- 支持macOS和Linux。暂不支持Windows DPAPI解密。
auth extract - 使用非官方内部API,如果Notion更改该API,可能会失效。
token_v2 - 这是一个私有/非官方API,Notion不提供支持。