跳到正文
Skillpedia
PDF、Word 与幻灯片394k · #68

notion

它能做什么

它指导 AI 智能体处理 Notion 页面、数据源、评论、文件和搜索。它适合把笔记、项目或数据库保存在 Notion 中的人。

适用场景

  • ✓你想让智能体读取或更新某个 Notion 页面的时候。
  • ✓你需要查询 Notion 数据库或数据源中的行的时候。
  • ✓你想添加评论,或在 Notion 工作区中搜索的时候。

技能链接

https://github.com/openclaw/openclaw/blob/main/skills/notion/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/openclaw/openclaw/blob/main/skills/notion/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请找到名为 Product Roadmap 的 Notion 页面,并添加一条评论,请团队审阅第四季度部分。”

每周 5 个新技能,1 分钟读完。

工作原理

技能使用 ntn 命令以 Markdown 形式读取和修改页面、查询数据源并管理评论。只有当该命令无法满足需求时,它才会退回到直接调用 API。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Notion

Prefer official ntn CLI. Use curl only when ntn is unavailable or a raw request is clearer.

Setup

npm install -g ntn
ntn --version
ntn login

Script/headless auth:

export NOTION_API_TOKEN=secret_or_ntn_token
export NOTION_API_VERSION=2026-03-11

ntn api sets Authorization and Notion-Version automatically. It uses CLI login by default, or NOTION_API_TOKEN when set.

Inspect

ntn doctor
ntn api ls
ntn api ls --json
ntn api v1/comments --help
ntn api v1/comments --spec -X POST
ntn api v1/comments --docs -X POST

Pages

Markdown-first helpers:

ntn pages get <page-id>
ntn pages get <page-id> --json
ntn pages create --parent page:<page-id> --content '# Title\n\nBody'
ntn pages create --parent data-source:<data-source-id> < page.md
ntn pages update <page-id> --content '# Updated'
ntn pages update <page-id> < page.md
ntn pages trash <page-id> --yes

Notes:

  • pages get prints Markdown with page properties as frontmatter.
  • Content input: --content, stdin, or editor in a TTY.
  • Parent refs: page:<id>, database:<id>, data-source:<id>.
  • For properties/templates/full Pages API, use ntn api v1/pages.

Data sources

ntn datasources resolve <database-id>
ntn datasources resolve <database-id> --json
ntn datasources query <data-source-id>
ntn datasources query <data-source-id> --limit 50 --json
ntn datasources query <data-source-id> --sort 'Date desc'
ntn datasources query <data-source-id> --filter '{"property":"Done","checkbox":{"equals":true}}'

Use resolve when you have a database ID. Query needs a data source ID.

Raw API

ntn api v1/users/me
ntn api v1/search query=roadmap page_size:=10
ntn api v1/pages 'parent[data_source_id]='"$DS_ID" 'properties[Name][title][0][text][content]=New item'
ntn api "v1/pages/$PAGE_ID" -X PATCH in_trash:=true
ntn api "v1/blocks/$PAGE_ID/children" -X PATCH \
  'children[0][type]=paragraph' \
  'children[0][paragraph][rich_text][0][text][content]=Hello'

Input syntax:

  • path=value: string body field.
  • path:=json: typed JSON body field.
  • name==value: query parameter.
  • Header:Value: request header.
  • --data '<json>' or stdin JSON for larger bodies.
  • Only one body source per request.

Files

ntn files create < image.png
ntn files create --filename photo.png --content-type image/png < /tmp/photo
ntn files create --external-url https://example.com/photo.png
ntn files get <upload-id>
ntn files list

Workers

ntn workers new
ntn workers deploy
ntn workers list --json
ntn workers runs list --json
ntn workers runs logs <run-id>

Workers may require Business/Enterprise plan and workspace enablement.

Curl fallback

curl -sS "https://api.notion.com/v1/users/me" \
  -H "Authorization: Bearer $NOTION_API_TOKEN" \
  -H "Notion-Version: 2026-03-11" \
  -H "Content-Type: application/json"

Version notes

  • Current latest API version: 2026-03-11.
  • Use in_trash, not archived.
  • Append block positioning uses position, not flat after.
  • transcription block renamed to meeting_notes.
  • Databases can contain multiple data sources; page parents generally use data_source_id.
常见问题

我如何登录?

你可以使用 ntn login 命令登录,或在脚本中通过环境变量提供令牌。

它能把页面移到回收站吗?

可以,但该命令在运行前需要明确的确认标志。

它能处理数据库属性吗?

可以。对于属性、模板和完整的 Pages API,技能使用直接 API 的方式。

详情

作者的原始描述

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

repo: openclaw/openclaw

热度

GitHub 星标
394k
排名
#68
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能