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
.
一款TypeScript CLI工具,支持AI Agent和人类通过非官方私有API与Notion工作区交互。支持对页面、数据库、块、搜索和用户管理的完整CRUD操作。
注意:本工具使用Notion的内部/私有API(
),与官方公开API相互独立。如需使用官方API,请使用
。
1. Extract token_v2 from Notion desktop app
1. 从Notion桌面应用中提取token_v2
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。
Token Extraction (Desktop App)
从桌面应用提取Token
Extract
from the Notion desktop app automatically. No API keys or OAuth needed.
自动从Notion桌面应用中提取
,无需API密钥或OAuth授权。
Extract token_v2 from Notion desktop app
从Notion桌面应用提取token_v2
Check auth status (shows extracted token_v2)
检查身份验证状态(显示已提取的token_v2)
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`。
The agent maintains a
~/.config/vibe-notion/MEMORY.md
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.
Agent会维护一个
~/.config/vibe-notion/MEMORY.md
文件作为跨会话的持久化内存。该文件由Agent管理——CLI不会读取或写入此文件。请使用
和
工具管理你的内存文件。
At the
start of every task, read
~/.config/vibe-notion/MEMORY.md
using the
tool to load any previously discovered workspace IDs, page IDs, database IDs, and user preferences.
- 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.
在
每个任务开始时,使用
工具读取
~/.config/vibe-notion/MEMORY.md
文件,加载之前发现的工作区ID、页面ID、数据库ID和用户偏好设置。
- 如果文件尚未存在,无需担心——可以继续操作,当有有用信息需要存储时再创建该文件。
- 如果无法读取文件(权限问题、目录缺失),无需报错,直接继续操作即可。
After discovering useful information, update
~/.config/vibe-notion/MEMORY.md
using the
tool. Write triggers include:
- After discovering workspace IDs (from )
- After discovering useful page IDs, database IDs, collection IDs (from , , , , etc.)
- 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.
发现有用信息后,使用
工具更新
~/.config/vibe-notion/MEMORY.md
文件。触发写入操作的场景包括:
- 发现工作区ID后(来自命令)
- 发现有用的页面ID、数据库ID、集合ID后(来自、、、等命令)
- 用户提供别名或偏好设置后(例如:“将这个称为任务数据库”、“我的主工作区是X”)
- 发现页面/数据库的结构后(父子关系、哪些数据库属于哪些页面)
写入时,请包含
完整的文件内容——
工具会覆盖整个文件。
- 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
- 父子关系(哪些数据库属于哪些页面)
- 交互过程中用户表达的任何偏好设置
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).
切勿存储
、凭证、API密钥或任何敏感数据。切勿存储完整的页面内容(仅存储ID和标题)。除非是持久引用(如数据库块),否则切勿存储块级ID。
Handling 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.
如果记忆中的ID返回错误(页面未找到、访问被拒绝),请将其从
中删除。不要盲目信任记忆中的数据——当出现异常时请进行验证。相比使用可能过期的记忆ID,重新搜索更可靠。
Here's a concrete example of how to structure your
:
Vibe Notion Memory
Vibe Notion Memory
Pages (Acme Corp)
Pages (Acme Corp)
- — Product Roadmap (top-level)
- — Q1 Planning (under Product Roadmap)
- — Product Roadmap (top-level)
- — Q1 Planning (under Product Roadmap)
Databases (Acme Corp)
Databases (Acme Corp)
- — Tasks (under Product Roadmap, views: )
- — Contacts (top-level)
- — Tasks (under Product Roadmap, views: )
- — Contacts (top-level)
- "roadmap" → (Product Roadmap)
- "tasks" → (Tasks database)
- "roadmap" → (Product Roadmap)
- "tasks" → (Tasks database)
- 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,可以直接使用它。
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_v2
bash
vibe-notion auth extract # 从Notion桌面应用提取token_v2
vibe-notion auth status # 检查身份验证状态
vibe-notion auth logout # 删除已存储的token_v2
List 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
vibe-notion page archive <page_id> --workspace-id <workspace_id> --pretty
vibe-notion page archive <page_id> --workspace-id <workspace_id> --pretty
Get 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
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
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
Get 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
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
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
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
vibe-notion block delete <block_id> --workspace-id <workspace_id> --pretty
vibe-notion block delete <block_id> --workspace-id <workspace_id> --pretty
Block Types Reference
块类型参考
The internal API uses a specific block format. Here are all supported types:
内部API使用特定的块格式。以下是所有支持的类型:
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"]]}}
json
{"type": "text", "properties": {"title": [["Plain text paragraph"]]}}
json
{"type": "text", "properties": {"title": [["Plain text paragraph"]]}}
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"]]}}
json
{"type": "code", "properties": {"title": [["console.log('hello')"]], "language": [["javascript"]]}}
json
{"type": "code", "properties": {"title": [["console.log('hello')"]], "language": [["javascript"]]}}
json
{"type": "quote", "properties": {"title": [["Quoted text"]]}}
json
{"type": "quote", "properties": {"title": [["Quoted text"]]}}
Rich Text Formatting
富文本格式
Rich text uses nested arrays with formatting codes:
| Format | Syntax | Example |
|---|
| Plain | | |
| Bold | | |
| Italic | | |
| Strikethrough | | |
| Inline code | | |
| Link | | ["Click", [["a", "https://example.com"]]]
|
| Bold + Italic | | ["Hello", [["b"], ["i"]]]
|
Multiple segments:
[["plain "], ["bold", [["b"]]], [" more plain"]]
富文本使用带有格式代码的嵌套数组:
| Format | Syntax | Example |
|---|
| Plain | | |
| Bold | | |
| Italic | | |
| Strikethrough | | |
| Inline code | | |
| Link | | ["Click", [["a", "https://example.com"]]]
|
| Bold + Italic | | ["Hello", [["b"], ["i"]]]
|
多段内容:
[["plain "], ["bold", [["b"]]], [" more plain"]]
List 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
vibe-notion comment get <comment_id> --workspace-id <workspace_id> --pretty
Search 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
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
Get 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
vibe-notion user get <user_id> --workspace-id <workspace_id> --pretty
All commands output JSON by default for AI consumption:
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
}
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
}
Database 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
}
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
}
Page 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" }
]
}
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" }
]
}
With --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" }
]
}
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" }
]
}
Block 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:
bash
vibe-notion search "Roadmap" --workspace-id <workspace_id> --pretty
bash
vibe-notion search "Roadmap" --workspace-id <workspace_id> --pretty
Backlinks reveal which pages/databases link to a given page. This is critical for efficient navigation.
- 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:
反向链接显示哪些页面/数据库链接到给定页面。这对于高效导航至关重要。
- 追踪关系:搜索结果看起来像是选项、枚举值或关系目标(例如计划名称或类别)。反向链接可立即显示所有通过关系属性引用它的行/页面——无需查找父数据库。
- 查找引用:你找到了一个页面,想知道哪些其他页面提到或链接到它。
- 反向查找:无需查询每个数据库来查找指向某个页面的行,直接在目标页面上使用反向链接即可获取这些行。
示例——查找使用特定计划的对象:
BAD: 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
→ 反向链接立即显示所有链接到此计划的人员/行
Commands that return lists support pagination via
,
fields:
- : Cursor-based. Pass value from previous response as .
- : Offset-based. Pass value (a number) as .
- : Use to control page size. indicates more results exist, but the private API does not support cursor-based pagination — increase to fetch more rows.
- :基于游标。将上一次响应中的值作为传递。
- :基于偏移量。将值(数字)作为传递。
- :使用控制页面大小。表示存在更多结果,但私有API不支持基于游标的分页——增加以获取更多行。
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:
npm install -g vibe-notion
yarn global add vibe-notion
如果
命令返回“command not found”,说明CLI未安装。请询问用户偏好的包管理器,并提供以下选项:
npm install -g vibe-notion
yarn global add vibe-notion
- supports macOS and Linux. Windows DPAPI decryption is not yet supported.
- uses the unofficial internal API and may break if Notion changes it.
- This is a private/unofficial API and is not supported by Notion.
- 支持macOS和Linux。暂不支持Windows DPAPI解密。
- 使用非官方内部API,如果Notion更改该API,可能会失效。
- 这是一个私有/非官方API,Notion不提供支持。