Notion CLI — Notion命令行工具
v0.0.1通过命令行工具管理Notion,包括页面、数据库和块的操作。
7· 4,800·27 当前·27 累计
安全扫描
OpenClaw
可疑
medium confidence该技能提供Notion CLI操作功能,代码和指令与其声明目的一致。
评估建议
此技能用于通过命令行操作Notion数据库和页面。...详细分析 ▾
ℹ 用途与能力
Name/description match the actions shown (creating/reading/updating Notion pages/databases). The single required env var NOTION_TOKEN is appropriate. Minor mismatch: SKILL.md/homepage point to the GitHub repo 'litencatt/notion-cli' but the install instruction uses npm package '@iansinnott/notion-cli' (different author/namespace). This could be a harmless fork or documentation mistake but should be verified before installing.
ℹ 指令范围
Runtime instructions stay within the Notion API/CLI domain (curl examples target api.notion.com and notion-cli commands). However the SKILL.md recommends storing the API key in ~/.config/notion/api_key and reading it into NOTION_TOKEN; the registry metadata declared no required config paths. The instructions therefore reference a local config file path that wasn't declared in metadata — not necessarily malicious but a documentation/consistency issue.
ℹ 安装机制
This is an instruction-only skill (no install spec or code files), so nothing will be written by the skill itself. The SKILL.md tells the user to run `npm install -g @iansinnott/notion-cli` manually. Because there is no install spec, you should independently verify the npm package identity, author, and trustworthiness (package name/author doesn't match the SKILL.md homepage).
✓ 凭证需求
Only NOTION_TOKEN is requested as the primary credential, which is proportionate for a Notion CLI skill. Note: the instructions advise storing the token in plaintext at ~/.config/notion/api_key — this is convenient but increases risk if other processes or skills can access your home directory. Prefer using secure secret storage where available and grant the token minimal scopes (only the integration access needed).
✓ 持久化与权限
The skill does not request permanent presence (always is false) and does not modify other skills or system-wide settings. Model invocation is allowed (default) which is normal for user-invocable skills. No elevated persistence or hidden autorun behavior is present in the files provided.
安装前注意事项
- 确保已正确配置Notion API密钥
- 谨慎操作重要数据
- Limit the integration's access to only the pages/databases needed.
- If you see unexpected network endpoints, or if the npm package author differs from the GitHub repo, do not install until you confirm the package's provenance. If you want, I can help check the npm package and GitHub repo for authorship and recent release metadata.
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv0.0.12026/2/5
初始版本,支持Notion CLI管理
● 无害
安装命令 点击复制
官方npx clawhub@latest install notion-cli
镜像加速npx clawhub@latest install notion-cli --registry https://cn.clawhub-mirror.com
技能文档
# notion Use notion-cli to create/read/update pages, data sources (databases), and blocks.
Setup
- Install notion-cli:
npm install -g @iansinnott/notion-cli - Create an integration at https://notion.so/my-integrations
- Copy the API key (starts with ntn_ or secret_)
- Store it:
mkdir -p ~/.config/notion
- echo "ntn_your_key_here" > ~/.config/notion/api_key
- Share target pages/databases with your integration (click "..." → "Connect to" → your integration name)
Usage
All commands require the NOTION_TOKEN environment variable to be set: ``bash
export NOTION_TOKEN=$(cat ~/.config/notion/api_key)
`
Common Operations
- Search for pages and data sources:
notion-cli search --query "page title"
- Get page:
notion-cli page retrieve
- Get page content (blocks):
notion-cli page retrieve
- Create page in a database:
`bash
curl -X POST https://api.notion.com/v1/pages \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Content-Type: application/json" \
-H "Notion-Version: 2025-09-03" \
--data '{
"parent": { "database_id": "YOUR_DATABASE_ID" },
"properties": {
"Name": {
"title": [
{
"text": {
"content": "Nouvelle idée"
}
}
]
}
}
}'
`
- Query a database:
notion-cli db query
- Update page properties:
`bash
curl -X PATCH https://api.notion.com/v1/pages/PAGE_ID \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Content-Type: application/json" \
-H "Notion-Version: 2025-09-03" \
--data '{
"properties": {
"Name": {
"title": [
{
"text": {
"content": "Nouveau titre"
}
}
]
},
"Status": {
"status": {
"name": "In progress"
}
},
"Priority": {
"select": {
"name": "High"
}
},
"Due date": {
"date": {
"start": "2026-02-10"
}
},
"Description": {
"rich_text": [
{
"text": {
"content": "Description mise à jour"
}
}
]
}
}
}'
`
- Get database info:
notion-cli db retrieve
Property Types
Common property formats for database items:
- Title:
{"title": [{"text": {"content": "..."}}]}
Rich text: {"rich_text": [{"text": {"content": "..."}}]}
Status: {"status": {"name": "Option"}}
Select: {"select": {"name": "Option"}}
Multi-select: {"multi_select": [{"name": "A"}, {"name": "B"}]}
Date: {"date": {"start": "2024-01-15", "end": "2024-01-16"}}
Checkbox: {"checkbox": true}
Number: {"number": 42}
URL: {"url": "https://..."}
Email: {"email": "a@b.com"}
Examples
- Search for pages:
notion-cli search --query "AIStories"
- Query database with filter:
`bash
notion-cli db query 2faf172c094981d3bbcbe0f115457cda \
-a '{
"property": "Status",
"status": { "equals": "Backlog" }
}'
`
- Retrieve page content:
notion-cli page retrieve 2fdf172c-0949-80dd-b83b-c1df0410d91b -r
- Update page status:
`bash
curl -X PATCH https://api.notion.com/v1/pages/2fdf172c-0949-80dd-b83b-c1df0410d91b \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Content-Type: application/json" \
-H "Notion-Version: 2025-09-03" \
--data '{
"properties": {
"Status": {
"status": {
"name": "In progress"
}
}
}
}'
`
Key Features
- Interactive mode: For complex queries, run
notion-cli db query without arguments to enter interactive mode
Multiple output formats: table (default), csv, json, yaml
Raw JSON: Use --raw flag for complete API responses
Filter syntax: Use -a flag for complex filters with AND/OR conditions
Notes
- Page/database IDs are UUIDs (with or without dashes)
- The CLI handles authentication automatically via NOTION_TOKEN
- Rate limits are managed by the CLI
- Use
notion-cli help` for complete command reference
References
- GitHub Notion-CLI: https://github.com/litencatt/notion-cli
- Notion API Documentation: https://developers.notion.com
数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制