Access and manage your Notion workspace via a CLI to search, create, update, and delete pages, databases, blocks, users, and comments with multiple output fo...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install notion-cli-agent或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install notion-cli-agent⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/notion-cli-agent/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
notion-cli Interact with your Notion workspace via the notion-cli.
A production-grade CLI for the Notion API that supports searching, creating and managing pages, databases, blocks, users, and comments with multiple output formats (JSON, table, CSV).
Install Clone and install the CLI:
git clone https://github.com/FroeMic/notion-cli
cd notion-cli
npm install
npm run build
npm link
Set NOTION_API_KEY environment variable:
ntn_ or secret_)~/.claude/.env for Claude Code~/.bashrc or ~/.zshrc: export NOTION_API_KEY="your-api-key"Optional: Set NOTION_DEBUG=true for verbose request/response logging.
Repository: https://github.com/FroeMic/notion-cli
Commands Search across your workspace:
notion search [query] # Search pages, databases, and data sources
notion search [query] --filter page # Search only pages
notion search [query] --filter database # Search only databases
notion search [query] --sort ascending # Sort by last edited time
Work with pages:
notion pages get <page-id> # Get page details
notion pages create --parent <id> --title <text> # Create a new page
notion pages update <page-id> --properties <json> # Update page properties
notion pages archive <page-id> # Archive a page
notion pages restore <page-id> # Restore an archived page
notion pages property <page-id> <property-id> # Get a specific property value
Work with databases:
notion databases get <database-id> # Get database schema
notion databases create --parent <id> --title <text> # Create a database
notion databases update <database-id> --title <text> # Update database metadata
notion databases query <data-source-id> # Query records in a data source
notion databases query <id> --filter <json> # Query with filters
notion databases query <id> --sort <json> # Query with sorting
Work with blocks (page content):
notion blocks get <block-id> # Get a block
notion blocks children <block-id> # List child blocks
notion blocks append <block-id> --content <json> # Append new blocks
notion blocks update <block-id> --content <json> # Update a block
notion blocks delete <block-id> # Delete a block
Work with users:
notion users list # List workspace members
notion users get <user-id> # Get user details
notion users me # Get the authenticated bot user
Work with comments:
notion comments list --block <block-id> # List comments on a block
notion comments create --page <page-id> --content <text> # Add a comment to a page
Global options (available on all commands):
--api-key <key> # Override NOTION_API_KEY env var
-f, --format <fmt> # Output format: json (default), table, csv
--limit <n> # Max results to return
--cursor <cursor> # Pagination cursor
Key Concepts | Concept | Purpose | Example | |-------------|--------------------------------------|------------------------------------------| | Pages | Individual Notion pages | A meeting note, a project brief | | Databases | Structured collections of pages | A task tracker, a CRM table | | Data Sources| Individual tables within a database | A specific view/table in a database | | Blocks | Content elements within a page | Paragraphs, headings, lists, code blocks | | Properties | Typed fields on database pages | Title, status, date, select, relation | | Users | Workspace members and integrations | Team members, bot integrations | | Comments | Discussion threads on pages/blocks | Feedback, review notes |
API Reference
https://api.notion.com/v12022-06-28Authorization: Bearer $NOTION_API_KEYCommon API Operations Search for a page:
curl -X POST https://api.notion.com/v1/search \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"query": "Meeting Notes", "filter": {"value": "page", "property": "object"}}'
Query a database with filters:
curl -X POST https://api.notion.com/v1/databases/<database-id>/query \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"filter": {"property": "Status", "status": {"equals": "In Progress"}}}'
Create a page in a database:
curl -X POST https://api.notion.com/v1/pages \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"parent": {"database_id": "<database-id>"}, "properties": {"Name": {"title": [{"text": {"content": "New Task"}}]}}}'
Append content to a page:
curl -X PATCH https://api.notion.com/v1/blocks/<block-id>/children \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"children": [{"object": "block", "type": "paragraph", "paragraph": {"rich_text": [{"type": "text", "text": {"content": "Hello world"}}]}}]}'
Notes
--limit and --cursor.json (default), table, or csv with the -f flag.Files 1 total
安装 Notion CLI – Command Line Interface based access to Notion for your agent 后,可以对 AI 说这些话来触发它
Help me get started with Notion CLI – Command Line Interface based access to Notion for your agent
Explains what Notion CLI – Command Line Interface based access to Notion for your agent does, walks through the setup, and runs a quick demo based on your current project
Use Notion CLI – Command Line Interface based access to Notion for your agent to access and manage your Notion workspace via a CLI to search, create...
Invokes Notion CLI – Command Line Interface based access to Notion for your agent with the right parameters and returns the result directly in the conversation
What can I do with Notion CLI – Command Line Interface based access to Notion for your agent in my documents & notes workflow?
将技能文件夹放到 ~/.claude/skills/notion-cli-agent/ 目录(个人级,所有项目可用),或 .claude/skills/notion-cli-agent/(项目级)。重启 AI 客户端后,用 /notion-cli-agent 主动调用,或让 AI 根据上下文自动发现并使用。
Notion CLI – Command Line Interface based access to Notion for your agent 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Notion CLI – Command Line Interface based access to Notion for your agent 可免费安装使用。请查阅仓库了解许可证信息。
Access and manage your Notion workspace via a CLI to search, create, update, and delete pages, databases, blocks, users, and comments with multiple output fo...
Lists the top use cases for Notion CLI – Command Line Interface based access to Notion for your agent, with example commands for each scenario
Automate my documents & notes tasks using Notion CLI – Command Line Interface based access to Notion for your agent
Identifies repetitive steps in your workflow and sets up Notion CLI – Command Line Interface based access to Notion for your agent to handle them automatically
Notion CLI – Command Line Interface based access to Notion for your agent 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。