Community编程与开发github.com

Notion

Notion CLI/API:支持页面、Markdown 内容、数据源、文件、评论、搜索、Workers 及原始 API 调用。

Notion 是什么?

此技能提供了一个名为 `ntn` 的官方 Notion CLI 工具,用于直接与 Notion API 交互,同时保留了在必要时使用 curl 的备选方案。该技能涵盖了 Notion 的核心功能:通过 Markdown 优先的助手获取、创建、更新和删除页面;解析和查询数据库与数据源;执行原始的 REST API 调用,支持字符串、JSON 和查询参数;上传和管理文件;以及部署和监控 Notion Workers。所有操作都可以在命令行中完成,适合快速开发、自动化和 DevOps 流程。`ntn` 会自动处理认证(使用 oauth 登录或 `NOTION_API_TOKEN` 环境变量)和版本头(当前为 `2026-03-11`)。此外,还提供了一些辅助命令如 `ntn doctor` 用于诊断,以及 `--help`, `--spec`, `--docs` 用于探索 API。该技能已更新至最新的 API 版本,并提醒注意 `in_trash` 而非 `archived`、`position` 而非 `after` 等细节变化。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/skills/notion

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Notion 是做什么的?

优先使用官方 ntn CLI。仅当 ntn 不可用或原始请求更清晰时才使用 curl。

设置

npm install -g ntn
ntn --version
ntn login

脚本/无头认证:

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

ntn api 会自动设置 Authorization 和 Notion-Version 头。默认使用 CLI 登录,或在设置了 NOTION_API_TOKEN 时使用该令牌。

检查

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

页面

Markdown 优先的助手:

ntn pages get <page-id>
ntn pages get <page-id> --json
ntn pages create --parent page:<page-id> --content '# 标题\n\n正文'
ntn pages create --parent data-source:<data-source-id> < page.md
ntn pages update <page-id> --content '# 已更新'
ntn pages update <page-id> < page.md
ntn pages trash <page-id> --yes

注意:

  • pages get 以 Markdown 格式输出,页面属性以 YAML frontmatter 形式展示。
  • 内容输入方式:--content、标准输入,或在 TTY 中打开编辑器。
  • 父级引用:page:<id>、database:<id>、data-source:<id>。
  • 如需属性/模板/完整 Pages API,请使用 ntn api v1/pages。

数据源

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}}'

当你有数据库 ID 时使用 resolve。查询需要数据源 ID。

原始 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'

输入语法:

  • path=value:字符串类型 body 字段。
  • path:=json:JSON 类型 body 字段。
  • name==value:查询参数。
  • Header:Value:请求头。
  • --data '<json>' 或标准输入 JSON 用于较大 body。
  • 每个请求仅支持一个 body 来源。

文件

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 可能需要 Business/Enterprise 套餐以及工作区启用。

curl 备选

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"

版本说明

  • 当前最新 API 版本:2026-03-11。
  • 使用 in_trash,而非 archived。
  • 追加块的定位使用 position,而非扁平的 after。
  • transcription 块已重命名为 meeting_notes。
  • 数据库可以包含多个数据源;页面父级通常使用 data_source_id。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

相关技能