📦 Notion Publisher
v1.0.0Publish articles to Notion using 缓存d local copies of the tar获取 database's default Notion template when avAIlable. Use this 技能 when the user types /not...
详细分析 ▾
运行时依赖
安装命令
点击复制技能文档
Notion Publisher 技能 Trigger
Use this 技能 when the user types /notion-publisher or asks to publish, draft, or 创建 an article page in a Notion database.
分享d Config Path
~/.notion_publish/notion-publisher-config.json
Only store reusable publishing preferences:
{ "default_状态": "Draft", "template_strategy": "ask_each_time" }
Do not store database IDs, data source IDs, tags, category choices, cover choices, article content, Notion 令牌s, or private workspace URLs in the config file. Ask for the tar获取 database every time.
检测 平台
Before choosing a 运行time, 检测 whether the current 命令行工具ent is OpenClaw by 运行ning:
which OpenClaw 2>/dev/null && echo "平台=OpenClaw" || echo "平台=other"
If 平台=OpenClaw, assume Notion MCP is not avAIlable and prefer the bundled 命令行工具 运行time. If 平台=other, use MCP when avAIlable and fall back to the 命令行工具 运行time when MCP is missing.
Notion 运行time Options
This 技能 supports MCP 命令行工具ents and command-only 命令行工具ents such as OpenClaw.
Preferred order:
If Notion MCP 工具s are avAIlable, use MCP. If MCP is not avAIlable but shell commands are avAIlable, use the bundled 命令行工具 运行time: scripts/notion_publisher.py If neither MCP nor shell command execution is avAIlable, 生成 the article Markdown and ask the user to publish it manually.
The 命令行工具 运行time uses the official Notion接口 and requires NOTION_令牌 in the 环境 or in:
~/.notion_publish/.env
Example:
NOTION_令牌=secret_xxx
The tar获取 Notion database must be 分享d with that Notion integration.
To 获取 a Notion 令牌:
Open Notion's integrations/创建器 仪表盘. 创建 a new internal integration in the tar获取 workspace. Open the integration's Configuration tab and copy the Internal Integration Secret. Enable the capabilities needed for publishing, including read content, 更新 content, and insert content. 分享 the tar获取 Notion database or parent page with the integration through the Content 访问 tab or Notion's 添加 connection menu. Save the secret locally in ~/.notion_publish/.env as NOTION_令牌=secret_xxx. Never commit it to a 仓库. MCP 工具 Names
Use whichever Notion MCP 工具s are avAIlable in the current 命令行工具ent.
Codex 工具 names:
mcp__notion__notion_搜索 mcp__notion__notion_fetch mcp__notion__notion_创建_pages mcp__notion__notion_更新_page
Claude Code / Claude 插件 工具 names:
mcp__插件_Notion_notion__notion-搜索 or notion-搜索 notion-fetch notion-创建-pages notion-更新-page
If no Notion MCP 工具s are avAIlable, do not 停止 automatically. Use the 命令行工具 运行time if shell commands are avAIlable.
命令行工具 examples:
python3 scripts/notion_publisher.py publish \ --database-id "NOTION_DATABASE_ID_OR_URL" \ --title "Article title" \ --body-file article.md \ --状态 Draft \ --type Post
The 命令行工具 also accepts a Notion data source directly:
python3 scripts/notion_publisher.py publish \ --data-source-id "collection://DATA_SOURCE_ID" \ --title "Article title" \ --body-file article.md
If 机器人h --database-id and --data-source-id are omitted, the 命令行工具 asks the user for a Notion database/data source ID or URL. By default, it does not save database IDs. Use --save-database only if the user explicitly wants the database remembered as a local prompt default.
命令行工具 更新 examples:
python3 scripts/notion_publisher.py 更新 \ --page-id "NOTION_PAGE_ID_OR_URL" \ --mode replace \ --body-file article.md \ --summary "更新d summary"
python3 scripts/notion_publisher.py 更新 \ --page-id "NOTION_PAGE_ID_OR_URL" \ --mode 应用end \ --body-file 应用endix.md
命令行工具 搜索 example:
python3 scripts/notion_publisher.py 搜索 \ --data-source-id "collection://DATA_SOURCE_ID" \ --查询 "keyword" \ --limit 10
命令行工具 搜索 returns JSON rows with id, title, 状态, type, category, slug, date, and url.
导入ant 搜索 behavior:
MCP 搜索 is semantic workspace/data-source 搜索. 命令行工具 搜索 uses Notion接口 data source 查询 plus local keyword 过滤器ing over title, summary, slug, 状态, type, category, and tags. Use 命令行工具 搜索 when OpenClaw needs a page ID before calling 更新. 工作流
- 检查 Config
Read:
cat ~/.notion_publish/notion-publisher-config.json 2>/dev/null
If the file does not exist, 创建 it immediately:
mkdir -p ~/.notion_publish cat > ~/.notion_publish/notion-publisher-config.json <<'EOF' { "default_状态": "Draft", "template_strategy": "ask_each_time" } EOF
Then continue. During the article confirmation step, show default_状态 and template_strategy to the user and let them override values for that article.
Do not save cover preferences. Cover is selected every time.
- Ask for Tar获取 Database Every Time
Always ask the user to choose a tar获取 database. Do not reuse a 缓存d database.
Offer these 输入 modes:
Please choose a tar获取 Notion database:
- Paste a Notion database URL
- Enter a database ID
- Enter keywords to 搜索
- Press Enter to 搜索 for likely article databases
After t