Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计异常

notion-cliNotion CLI 搜索

Agent Skill

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

总安装

4,776

周安装

201

GitHub Stars

178

下载量

1,672
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

notion-cli 提供命令行接口访问 Notion API,支持页面、数据库和工作区管理。

  • 适合让 AI Agent 查询知识库、创建记录、同步外部信息到 Notion。
  • 支持双输出模式:人类可读表格与机器 JSON 格式,覆盖全量 API 能力。
  • 安装命令:npx skills add https://github.com/4ier/notion-cli --skill notion-cli。
  • 需配置 NOTION_TOKEN 或使用 notion auth login 授权,区分内部与公共集成权限。

SKILL.md

Notion CLI

notion is a CLI for the Notion API. Single Go binary, full API coverage, dual output (pretty tables for humans, JSON for agents). Current: v0.7.0.

Install

# Homebrew
brew install 4ier/tap/notion-cli

# npm
npm install -g @4ier/notion-cli

# Go
go install github.com/4ier/notion-cli@latest

# Or download a binary from https://github.com/4ier/notion-cli/releases

Auth

notion auth login --with-token <<< "ntn_xxxxxxxxxxxxx"
notion auth login --with-token --profile work <<< "ntn_xxx"  # named profile
export NOTION_TOKEN=ntn_xxxxxxxxxxxxx                        # env var alternative
notion auth status        # shows workspace + integration type (internal/public)
notion auth switch        # interactive profile picker
notion auth switch work   # direct switch
notion auth doctor        # health check — warns if internal integration

auth status / doctor surface the integration type, so it's easy to spot when you need to share a parent page before creating workspace-root content.

Search

notion search "query"                    # everything
notion search "query" --type page        # pages only
notion search "query" --type database    # databases only

Pages

notion page view <id|url>                # render page content
notion page list                         # list workspace pages
notion page create <parent> --title "X" --body "content"
notion page create <db-id> --db "Name=Review" "Status=Todo"  # database row

# Archive / restore (soft-delete)
notion page archive <id>                 # canonical
notion page trash <id>                   # alias
notion page delete <id>                  # alias (legacy)
notion page restore <id>                 # reverse

# Move / open / edit
notion page move <id> --to <parent>
notion page open <id>                    # open in browser
notion page edit <id|url>                # edit in $EDITOR (markdown round-trip)

# Properties (type-aware)
notion page set <id> Key=Value ...
notion page props <id>                   # show all (summary; paginated values may be truncated)
notion page props <id> <prop-id>         # single raw JSON

# NEW in v0.7: paginated single-property fetch (fixes >25-item truncation)
notion page property <id> <prop-id>
notion page property <id> --name "References"         # resolve id by display name
notion page property <id> <prop-id> --format json

# Relations
notion page link <id> --prop "Rel" --to <target-id>
notion page unlink <id> --prop "Rel" --from <target-id>

# NEW in v0.7: server-side markdown I/O (preferred for full-page dumps)
notion page markdown <id>                # print to stdout
notion page markdown <id> --out page.md  # write to file
notion page markdown <id> --format json  # full response (truncated flag, unknown_block_ids)

notion page set-markdown <id> --file new.md           # replace whole page (default)
cat new.md | notion page set-markdown <id> --file -   # stdin
notion page set-markdown <id> --append --text "\n\n> Appended"
notion page set-markdown <id> --after "Status...pending" --text "Now: done"
notion page set-markdown <id> --range "old...stale" --text "fresh" --allow-deleting-content

page markdown vs block list --md: prefer page markdown for whole pages — it uses the server renderer and handles toggles, columns, synced blocks, and databases-as-pages correctly. Use block list --md only when you need a single sub-block.

Databases

notion db list                           # list databases
notion db view <id>                      # show schema
notion db query <id>                     # all rows
notion db query <id> -F 'Status=Done' -s 'Date:desc'
notion db query <id> --filter-json '{"or":[...]}'
notion db query <id> --all
notion db create <parent> --title "X" --props "Status:select,Date:date"
notion db update <id> --title "New Name" --add-prop "Priority:select"
notion db add <id> "Name=Task" "Status=Todo" "Priority=High"
notion db add-bulk <id> --file items.json
notion db export <id>                    # CSV (default)
notion db export <id> --format json
notion db export <id> --format md -o report.md
notion db open <id>

Filter operators

SyntaxMeaning
=equals
!=not equals
> / >=greater than (or equal)
< / <=less than (or equal)
~=contains

Multiple -F flags combine with AND. Property types are auto-detected from schema.

Sort: -s 'Date:desc' or -s 'Name:asc'

Bulk add file format

[{"Name": "Task A", "Status": "Todo"}, {"Name": "Task B", "Status": "Done"}]

Blocks

notion block list <parent-id>            # list child blocks
notion block list <parent-id> --all
notion block list <parent-id> --depth 3  # recursive
notion block list <parent-id> --md       # markdown; prefer 'page markdown' for pages
notion block get <id>

# Append / insert — both handle >100 children and >2000-char code blocks automatically
notion block append <parent> "text"
notion block append <parent> "text" -t bullet
notion block append <parent> "text" -t code --lang ts        # 'ts' / 'sh' / 'yml' etc. normalized
notion block append <parent> --file notes.md                 # any length, auto-batched
notion block append <parent> --file big.md --on-oversize=truncate
notion block insert <parent> "text" --after <block-id>

# Update — now with markdown support
notion block update <id> --text "plain new content"
notion block update <id> --text "See **[docs](https://x.com)**" --markdown
notion block update <id> --file patch.md                     # must parse to exactly one block

notion block delete <id1> [id2] [id3]
notion block move <id> --after <target>
notion block move <id> --before <target>
notion block move <id> --parent <new-parent>

Block types: paragraph/p, h1/h2/h3, bullet, numbered, todo, quote, code, callout, divider.

Media blocks (image / file / video / audio / pdf)

# External URL (http/https)
notion block append <page> --image-url https://example.com/a.png --caption "fig 1"

# Local file → upload + embed in one command
notion block append <page> --image-file ./chart.png --caption "heap usage"
notion block append <page> --pdf-file ./spec.pdf
notion block append <page> --video-file ./demo.mp4

# Reference an existing file_upload id
notion block append <page> --image-upload 351d45fb-... --caption "reused"

Same triple (--<kind>-url / --<kind>-file / --<kind>-upload) exists for image, file, video, audio, pdf. --caption works with any.

Comments

notion comment list <page-id>
notion comment add <page-id> --text "comment text"
notion comment add <page-id> --text "with @mention" --mention-user <user-id>
notion comment get <comment-id>
notion comment reply <comment-id> "reply text"          # same thread

# NEW in v0.7
notion comment update <comment-id> --text "edited text"
notion comment update <comment-id> --text "with @mention" --mention-user <user-id>
notion comment delete <comment-id>                      # single or many
notion comment delete <id1> <id2> <id3>                 # variadic

Users

notion user me                           # current bot info
notion user list                         # all workspace users
notion user get <user-id>

Files

# List / retrieve / upload
notion file list
notion file get <upload-id>                                # NEW in v0.7 — status / size / URL
notion file upload ./local/file.pdf                        # local path
notion file upload https://example.com/chart.png --name chart.png   # URL source
curl -sSL https://host/file.zip | notion file upload - --name file.zip   # stdin
notion file upload ./image.png --to <page-id>              # upload + attach to page

Raw API (escape hatch)

notion api GET /v1/users/me              # /v1/ is auto-prepended if missing
notion api GET /users/me                 # → prints 'note: prepending /v1...' and works
notion api POST /v1/search --body '{"query":"test"}'
notion api PATCH /v1/pages/<id> --body @body.json        # read body from file
echo '{"query":"x"}' | notion api POST /v1/search --body -  # explicit stdin

Output Modes

  • Terminal (TTY): colored tables, readable formatting
  • Piped / scripted: JSON automatically
  • Explicit: --format json / --format table / --format md
  • --debug: show HTTP request/response details

All output includes full Notion UUIDs. All commands accept Notion URLs or IDs.

Tips for agents

  • notion db add and notion page set auto-detect property types from schema, so Tags=a,b,c (multi_select) and Done=true (checkbox) both just work.
  • For long markdown, prefer notion page set-markdown --file over notion block append --file — server-side parsing has no 100-children limit.
  • For relation / rollup properties that may have >25 items, always use notion page property (not page view / page props).
  • Pipe to jq: notion db query <id> -F 'Status=Done' --format json | jq '.results[].id'
  • When an error looks confusing, check it for a hint line — the CLI decorates common API errors with actionable next steps.
  • When working with an internal integration: workspace-root page creation isn't allowed — share a parent page first, then pass its id.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

31.7%
按下载量换算530

Claude

29.8%
按下载量换算498

Cursor

20.4%
按下载量换算341

Gemini CLI

8.47%
按下载量换算142

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills