Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

notionNotion 知识协作

Agent Skill

用于处理 Notion 页面、数据库、工作区内容和结构化记录。它适合让 Agent 查询知识库、整理页面内容、创建记录或把外部信息同步到 Notion。使用时需要确认集成是否已被授权到目标页面或数据库,并区分读取、追加和覆盖更新;涉及批量写入或修改数据库属性时,应先核对字段名称、属性类型和目标页面。

总安装

279

周安装

12

GitHub Stars

44

下载量

98
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:notion(Notion 知识协作)
来源仓库:https://github.com/nyosegawa/notion-cli
仓库路径:skills/notion
安装命令:
npx skills add https://github.com/nyosegawa/notion-cli --skill notion
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/nyosegawa/notion-cli --skill notion

简介

notion 用于处理 Notion 页面、数据库和工作区内容。

  • 适合查询知识库、整理页面内容或同步外部信息到 Notion。
  • 使用时需要确认集成是否已授权到目标页面或数据库。
  • 涉及批量写入时应先核对字段名称、属性类型和目标页面。
  • notion 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Notion CLI Skill

Operate Notion workspaces using ncli. Two backends:

  • MCP (OAuth) — search, pages, databases, views, comments, users, teams
  • REST API (integration token) — file upload, block operations, any REST endpoint

Prerequisites

# MCP auth (required for most commands)
ncli whoami                    # Check auth status
ncli login                     # If not authenticated

# REST API auth (required for ncli rest / ncli file commands)
ncli rest login                # Save integration token (one-time)

REST API requires integration access to target pages: Go to https://www.notion.so/profile/integrations/internal → select your integration → Content access → add pages.

Core Pattern: Search → Fetch → Act

  1. Searchncli search "<query>" --json to find pages/databases
  2. Fetchncli fetch <id> --json to get details and extract IDs
  3. Act — Use the extracted IDs to create/update/query

See references/id-patterns.md for ID extraction patterns.

Key Commands

MCP Commands (OAuth)

CommandDescription
ncli search "<query>"Search pages/databases
ncli fetch <url-or-id>Get page/database content
ncli page create --title "T" --parent <id>Create page
ncli page update <id> --prop "Key=Value"Update properties
ncli page update <id> --body "content"Replace content
ncli page move <id> --to <parent-id>Move page
ncli page duplicate <id>Duplicate page
ncli db create --title "T" --parent <id> --prop "Name:title"Create database
ncli db query "<view-url>"Query database (view URL required)
ncli comment create <page-id> --body "text"Add comment
ncli api <tool> '{json}'Call any MCP tool directly

REST API Commands (Integration Token)

CommandDescription
ncli file upload <file-path>Upload file (returns file_upload_id)
ncli rest GET <path>GET request
ncli rest POST <path> '{json}'POST request
ncli rest PATCH <path> '{json}'PATCH request
ncli rest DELETE <path>DELETE request

See references/command-reference.md for full arguments and examples.

Global Flags

  • --json — Structured JSON output (always use for programmatic access)
  • --raw — Raw response
  • --data '{json}' — Override all flags with direct JSON input

Common Workflows

1. Search, Fetch, and Update

ncli search "project plan" --json       # → results[].id
ncli fetch <page-id> --json             # → content
ncli page update <page-id> --prop "Status=Done"

2. Database Lifecycle

# Create DB → extract data_source_id (collection://...) from response
ncli db create --title "Tasks" --parent <page-id> \
  --prop "Name:title" --prop "Status:select=Open,Done"

# Create view → extract view_url
ncli view create --data '{"database_id":"<db-id>","data_source_id":"collection://<ds-id>","type":"table","name":"All"}'

# Add entries
ncli page create --parent collection://<ds-id> --title "Task 1" --prop "Status=Open"

# Query
ncli db query "<view-url>"

3. File Upload (REST API)

# Step 1: Upload file → returns file_upload_id + attach hint
ncli file upload ./screenshot.png

# Step 2: Fetch page to find block IDs (MCP or REST)
ncli fetch <page-id> --json
# Or: ncli rest GET /blocks/<page-id>/children

# Step 3: Attach to page (append to end)
ncli rest PATCH /blocks/<page-id>/children '{"children":[{"type":"file","file":{"type":"file_upload","file_upload":{"id":"<file_upload_id>"},"name":"screenshot.png"}}]}'

# Or: Insert after a specific block
ncli rest PATCH /blocks/<page-id>/children '{"position":{"type":"after_block","after_block":{"id":"<block-id>"}},"children":[...]}'

4. Direct REST API Access

ncli rest GET /users/me                 # Verify auth
ncli rest GET /pages/<page-id>          # Get page
ncli rest POST /search '{"query":"x"}'  # Search
ncli rest PATCH /blocks/<id>/children '{"children":[...]}' # Add blocks

Important Notes

  1. page update: properties and content are separate commands--prop/--title and --body cannot be combined
  2. db query requires a view URL — run ncli fetch <db-id> to get it, or create one with ncli view create
  3. view create requires both database_id AND data_source_id — get both from ncli fetch <db-id>
  4. DB page parent uses collection:// prefix--parent collection://<ds-id>
  5. ncli file upload returns file_upload_id — attach to page via ncli rest PATCH (the command prints the exact attach command)
  6. REST API requires separate auth from MCPncli rest login or NOTION_API_KEY env var
  7. REST API requires page access — add pages via integration settings at https://www.notion.so/profile/integrations/internal
  8. Errors include recovery hints — follow the Hint to self-recover

Troubleshooting

MCP auth failed

Error: Not connected to Notion

Run ncli login to authenticate via browser.

REST API: No token

Error: No REST API token configured
  Hint: Set NOTION_API_KEY env var, or run "ncli rest login"

Run ncli rest login or set NOTION_API_KEY.

REST API: Empty search results

Note: No results found. If you expected results, ensure your integration has access to pages.

Go to https://www.notion.so/profile/integrations/internal → select integration → Content access → add pages.

REST API: 404 on page access

Error: REST API resource not found
  Hint: The integration may not have access to this page.

The integration needs explicit access to the page. Add it via integration settings, or use MCP commands which have workspace-wide OAuth access.

File upload: attach fails

If ncli file upload succeeds but ncli rest PATCH to attach fails with 404, the integration doesn't have access to the target page. Add access via integration settings.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.39%
按下载量换算37

Claude

28.94%
按下载量换算28

Cursor

16.6%
按下载量换算16

Gemini CLI

8.94%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills