vibe-notion

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vibe 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 (
/api/v3/
), which is separate from the official public API. For official API access, use
vibe-notionbot
.
一款TypeScript CLI工具,支持AI Agent和人类通过非官方私有API与Notion工作区交互。支持对页面、数据库、块、搜索和用户管理的完整CRUD操作。
注意:本工具使用Notion的内部/私有API(
/api/v3/
),与官方公开API相互独立。如需使用官方API,请使用
vibe-notionbot

Quick Start

快速开始

bash
undefined
bash
undefined

1. 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
token_v2
from the Notion desktop app automatically. No API keys or OAuth needed.
bash
undefined
自动从Notion桌面应用中提取
token_v2
,无需API密钥或OAuth授权。
bash
undefined

Extract 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
~/.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
Read
and
Write
tools to manage your memory file.
Agent会维护一个
~/.config/vibe-notion/MEMORY.md
文件作为跨会话的持久化内存。该文件由Agent管理——CLI不会读取或写入此文件。请使用
Read
Write
工具管理你的内存文件。

Reading Memory

读取内存

At the start of every task, read
~/.config/vibe-notion/MEMORY.md
using the
Read
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.
每个任务开始时,使用
Read
工具读取
~/.config/vibe-notion/MEMORY.md
文件,加载之前发现的工作区ID、页面ID、数据库ID和用户偏好设置。
  • 如果文件尚未存在,无需担心——可以继续操作,当有有用信息需要存储时再创建该文件。
  • 如果无法读取文件(权限问题、目录缺失),无需报错,直接继续操作即可。

Writing Memory

写入内存

After discovering useful information, update
~/.config/vibe-notion/MEMORY.md
using the
Write
tool. Write triggers include:
  • After discovering workspace IDs (from
    workspace list
    )
  • After discovering useful page IDs, database IDs, collection IDs (from
    search
    ,
    page list
    ,
    page get
    ,
    database list
    , 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
Write
tool overwrites the entire file.
发现有用信息后,使用
Write
工具更新
~/.config/vibe-notion/MEMORY.md
文件。触发写入操作的场景包括:
  • 发现工作区ID后(来自
    workspace list
    命令)
  • 发现有用的页面ID、数据库ID、集合ID后(来自
    search
    page list
    page get
    database list
    等命令)
  • 用户提供别名或偏好设置后(例如:“将这个称为任务数据库”、“我的主工作区是X”)
  • 发现页面/数据库的结构后(父子关系、哪些数据库属于哪些页面)
写入时,请包含完整的文件内容——
Write
工具会覆盖整个文件。

What 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
token_v2
, 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。

Handling Stale Data

处理过期数据

If a memorized ID returns an error (page not found, access denied), remove it from
MEMORY.md
. Don't blindly trust memorized data — verify when something seems off. Prefer re-searching over using a memorized ID that might be stale.
如果记忆中的ID返回错误(页面未找到、访问被拒绝),请将其从
MEMORY.md
中删除。不要盲目信任记忆中的数据——当出现异常时请进行验证。相比使用可能过期的记忆ID,重新搜索更可靠。

Format / Example

格式 / 示例

Here's a concrete example of how to structure your
MEMORY.md
:
markdown
undefined
以下是
MEMORY.md
文件的具体结构示例:
markdown
undefined

Vibe Notion Memory

Vibe Notion Memory

Workspaces

Workspaces

  • abc123-...
    — Acme Corp (default)
  • abc123-...
    — Acme Corp (default)

Pages (Acme Corp)

Pages (Acme Corp)

  • page-id-1
    — Product Roadmap (top-level)
  • page-id-2
    — Q1 Planning (under Product Roadmap)
  • page-id-1
    — Product Roadmap (top-level)
  • page-id-2
    — Q1 Planning (under Product Roadmap)

Databases (Acme Corp)

Databases (Acme Corp)

  • coll-id-1
    — Tasks (under Product Roadmap, views:
    view-1
    )
  • coll-id-2
    — Contacts (top-level)
  • coll-id-1
    — Tasks (under Product Roadmap, views:
    view-1
    )
  • coll-id-2
    — Contacts (top-level)

Aliases

Aliases

  • "roadmap" →
    page-id-1
    (Product Roadmap)
  • "tasks" →
    coll-id-1
    (Tasks database)
  • "roadmap" →
    page-id-1
    (Product Roadmap)
  • "tasks" →
    coll-id-1
    (Tasks database)

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_v2
bash
vibe-notion auth extract    # 从Notion桌面应用提取token_v2
vibe-notion auth status     # 检查身份验证状态
vibe-notion auth logout     # 删除已存储的token_v2

Page Commands

页面命令

bash
undefined
bash
undefined

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

Archive a page

归档页面

vibe-notion page archive <page_id> --workspace-id <workspace_id> --pretty
undefined
vibe-notion page archive <page_id> --workspace-id <workspace_id> --pretty
undefined

Database Commands

数据库命令

bash
undefined
bash
undefined

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

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
undefined
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
undefined

Block Commands

块命令

bash
undefined
bash
undefined

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

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
undefined
vibe-notion block delete <block_id> --workspace-id <workspace_id> --pretty
undefined

Block 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:
FormatSyntaxExample
Plain
[["text"]]
[["Hello"]]
Bold
["text", [["b"]]]
["Hello", [["b"]]]
Italic
["text", [["i"]]]
["Hello", [["i"]]]
Strikethrough
["text", [["s"]]]
["Hello", [["s"]]]
Inline code
["text", [["c"]]]
["Hello", [["c"]]]
Link
["text", [["a", "url"]]]
["Click", [["a", "https://example.com"]]]
Bold + Italic
["text", [["b"], ["i"]]]
["Hello", [["b"], ["i"]]]
Multiple segments:
[["plain "], ["bold", [["b"]]], [" more plain"]]
富文本使用带有格式代码的嵌套数组:
FormatSyntaxExample
Plain
[["text"]]
[["Hello"]]
Bold
["text", [["b"]]]
["Hello", [["b"]]]
Italic
["text", [["i"]]]
["Hello", [["i"]]]
Strikethrough
["text", [["s"]]]
["Hello", [["s"]]]
Inline code
["text", [["c"]]]
["Hello", [["c"]]]
Link
["text", [["a", "url"]]]
["Click", [["a", "https://example.com"]]]
Bold + Italic
["text", [["b"], ["i"]]]
["Hello", [["b"], ["i"]]]
多段内容:
[["plain "], ["bold", [["b"]]], [" more plain"]]

Comment Commands

评论命令

bash
undefined
bash
undefined

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
undefined
vibe-notion comment get <comment_id> --workspace-id <workspace_id> --pretty
undefined

Search Command

搜索命令

bash
undefined
bash
undefined

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
undefined
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
undefined

User Commands

用户命令

bash
undefined
bash
undefined

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
undefined
vibe-notion user get <user_id> --workspace-id <workspace_id> --pretty
undefined

Output Format

输出格式

JSON (Default)

JSON(默认)

All commands output JSON by default for AI consumption:
bash
undefined
所有命令默认输出JSON格式,供AI使用:
bash
undefined

Search 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
undefined
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
undefined

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
}
bash
undefined
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
undefined

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" }
  ]
}
bash
undefined
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
undefined

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" }
  ]
}
bash
undefined
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
undefined

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
--pretty
flag for formatted output on any command:
bash
vibe-notion search "Roadmap" --workspace-id <workspace_id> --pretty
在任何命令中使用
--pretty
标志获取格式化输出:
bash
vibe-notion search "Roadmap" --workspace-id <workspace_id> --pretty

When to Use
--backlinks

何时使用
--backlinks

Backlinks reveal which pages/databases link to a given page. This is critical for efficient navigation.
Use
--backlinks
when:
  • 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
undefined

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

→ 反向链接立即显示所有链接到此计划的人员/行

undefined
undefined

Pagination

分页

Commands that return lists support pagination via
has_more
,
next_cursor
fields:
  • block children
    : Cursor-based. Pass
    next_cursor
    value from previous response as
    --start-cursor
    .
  • search
    : Offset-based. Pass
    next_cursor
    value (a number) as
    --start-cursor
    .
  • database query
    : Use
    --limit
    to control page size.
    has_more
    indicates more results exist, but the private API does not support cursor-based pagination — increase
    --limit
    to fetch more rows.
返回列表的命令通过
has_more
next_cursor
字段支持分页:
  • block children
    :基于游标。将上一次响应中的
    next_cursor
    值作为
    --start-cursor
    传递。
  • search
    :基于偏移量。将
    next_cursor
    值(数字)作为
    --start-cursor
    传递。
  • database query
    :使用
    --limit
    控制页面大小。
    has_more
    表示存在更多结果,但私有API不支持基于游标的分页——增加
    --limit
    以获取更多行。

Troubleshooting

故障排除

If a
vibe-notion
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
  • pnpm add -g vibe-notion
  • bun add -g vibe-notion
如果
vibe-notion
命令返回“command not found”,说明CLI未安装。请询问用户偏好的包管理器,并提供以下选项:
  • npm install -g vibe-notion
  • yarn global add vibe-notion
  • pnpm add -g vibe-notion
  • bun add -g vibe-notion

Limitations

限制

  • auth extract
    supports macOS and Linux. Windows DPAPI decryption is not yet supported.
  • token_v2
    uses the unofficial internal API and may break if Notion changes it.
  • This is a private/unofficial API and is not supported by Notion.
  • auth extract
    支持macOS和Linux。暂不支持Windows DPAPI解密。
  • token_v2
    使用非官方内部API,如果Notion更改该API,可能会失效。
  • 这是一个私有/非官方API,Notion不提供支持。