Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

notion-syncNotion sync 搜索

Agent Skill

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

总安装

122,662

周安装

5,269

GitHub Stars

6

下载量

42,995
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install notion-sync

简介

实现 Notion 页面和数据库的双向同步与管理。

  • 适合协作编辑、研究跟踪或项目进度管理。
  • 支持多用户环境下的内容一致性维护。notion-sync 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 安装命令:openclaw skills install notion-sync。
  • 需确保网络连通性和 API 访问权限。

SKILL.md

name
notion-sync
description
Bi-directional sync and management for Notion pages and databases. Use when working with Notion workspaces for collaborative editing, research tracking, project management, or when you need to sync markdown files to/from Notion pages or monitor Notion pages for changes.
homepage
https://github.com/robansuini/agent-skills
repository
https://github.com/robansuini/agent-skills/tree/main/productivity/notion-sync
license
MIT-0
metadata
clawdis
requires
env
[NOTION_API_KEY]
bins
[node]
stateDirs
[memory]

Notion Sync

Bi-directional sync between markdown files and Notion pages, plus database management utilities for research tracking and project management.

Upgrading

From v2.0: Replace --token "ntn_..." with --token-file, --token-stdin, or NOTION_API_KEY env var. Bare --token is no longer accepted (credentials should never appear in process listings).

From v1.x: See v2.0 changelog for migration details.

Requirements

  • Node.js v18 or later
  • A Notion integration token (starts with ntn_ or secret_)

Setup

  1. Go to https://www.notion.so/my-integrations
  2. Create a new integration (or use an existing one)
  3. Copy the "Internal Integration Token"
  4. Pass the token using one of these methods (priority order used by scripts):

Option A — Token file (recommended):

   echo "ntn_your_token" > ~/.notion-token && chmod 600 ~/.notion-token
   node scripts/search-notion.js "query" --token-file ~/.notion-token

Option B — Stdin pipe:

   echo "$NOTION_API_KEY" | node scripts/search-notion.js "query" --token-stdin

Option C — Environment variable:

   export NOTION_API_KEY="ntn_your_token"
   node scripts/search-notion.js "query"

Auto default: If ~/.notion-token exists, scripts use it automatically even without --token-file.

  1. Share your Notion pages/databases with the integration:

- Open the page/database in Notion - Click "Share" → "Invite" - Select your integration

JSON Output Mode

All scripts support a global --json flag.

  • Suppresses progress logs written to stderr
  • Keeps stdout machine-readable for automation
  • Errors are emitted as JSON: { "error": "..." }

Example:

node scripts/query-database.js <db-id> --limit 5 --json

Path Safety Mode

Scripts that read/write local files are restricted to the current working directory by default.

  • Prevents accidental reads/writes outside the intended workspace
  • Applies to: md-to-notion.js, add-to-database.js, notion-to-md.js, watch-notion.js
  • Override intentionally with --allow-unsafe-paths

Examples:

# Default (safe): path must be inside current workspace
node scripts/md-to-notion.js docs/draft.md <parent-id> "Draft"

# Intentional override (outside workspace)
node scripts/notion-to-md.js <page-id> ~/Downloads/export.md --allow-unsafe-paths

Core Operations

1. Search Pages and Databases

Search across your Notion workspace by title or content.

node scripts/search-notion.js "<query>" [--filter page|database] [--limit 10] [--json]

Examples:

# Search for newsletter-related pages
node scripts/search-notion.js "newsletter"

# Find only databases
node scripts/search-notion.js "research" --filter database

# Limit results
node scripts/search-notion.js "AI" --limit 5

Output:

[
  {
    "id": "page-id-here",
    "object": "page",
    "title": "Newsletter Draft",
    "url": "https://notion.so/...",
    "lastEdited": "2026-02-01T09:00:00.000Z"
  }
]

2. Query Databases with Filters

Query database contents with advanced filters and sorting.

node scripts/query-database.js <database-id> [--filter <json>] [--sort <json>] [--limit 10] [--json]

Examples:

# Get all items
node scripts/query-database.js xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Filter by Status = "Complete"
node scripts/query-database.js <db-id> \
  --filter '{"property": "Status", "select": {"equals": "Complete"}}'

# Filter by Tags containing "AI"
node scripts/query-database.js <db-id> \
  --filter '{"property": "Tags", "multi_select": {"contains": "AI"}}'

# Sort by Date descending
node scripts/query-database.js <db-id> \
  --sort '[{"property": "Date", "direction": "descending"}]'

# Combine filter + sort
node scripts/query-database.js <db-id> \
  --filter '{"property": "Status", "select": {"equals": "Complete"}}' \
  --sort '[{"property": "Date", "direction": "descending"}]'

Common filter patterns:

  • Select equals: {"property": "Status", "select": {"equals": "Done"}}
  • Multi-select contains: {"property": "Tags", "multi_select": {"contains": "AI"}}
  • Date after: {"property": "Date", "date": {"after": "2024-01-01"}}
  • Checkbox is true: {"property": "Published", "checkbox": {"equals": true}}
  • Number greater than: {"property": "Count", "number": {"greater_than": 100}}

3. Update Page Properties

Update properties for database pages (status, tags, dates, etc.).

node scripts/update-page-properties.js <page-id> <property-name> <value> [--type <type>] [--json]

Supported types: select, multi_select, checkbox, number, url, email, date, rich_text

Examples:

# Set status
node scripts/update-page-properties.js <page-id> Status "Complete" --type select

# Add multiple tags
node scripts/update-page-properties.js <page-id> Tags "AI,Leadership,Research" --type multi_select

# Set checkbox
node scripts/update-page-properties.js <page-id> Published true --type checkbox

# Set date
node scripts/update-page-properties.js <page-id> "Publish Date" "2024-02-01" --type date

# Set URL
node scripts/update-page-properties.js <page-id> "Source URL" "https://example.com" --type url

# Set number
node scripts/update-page-properties.js <page-id> "Word Count" 1200 --type number

4. Batch Update

Batch update a single property across multiple pages in one command.

Mode 1 — Query + Update:

node scripts/batch-update.js <database-id> <property-name> <value> --filter '<json>' [--type select] [--dry-run] [--limit 100]

Example:

node scripts/batch-update.js <db-id> Status Review \
  --filter '{"property":"Status","select":{"equals":"Draft"}}' \
  --type select

Mode 2 — Page IDs from stdin:

echo "page-id-1\
page-id-2\
page-id-3" | \
  node scripts/batch-update.js --stdin <property-name> <value> [--type select] [--dry-run]

Features:

  • --dry-run: prints pages that would be updated (with current property value) without writing
  • --limit <n>: max pages to process (default 100)
  • Pagination in query mode (has_more/next_cursor) up to limit
  • Rate-limit friendly updates (300ms between page updates)
  • Progress and summary on stderr, JSON result array on stdout

5. Markdown → Notion Sync

Push markdown content to Notion with full formatting support.

node scripts/md-to-notion.js \
  "<markdown-file-path>" \
  "<notion-parent-page-id>" \
  "<page-title>" [--json] [--allow-unsafe-paths]

Example:

node scripts/md-to-notion.js \
  "projects/newsletter-draft.md" \
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  "Newsletter Draft - Feb 2026"

Supported formatting:

  • Headings (H1-H3)
  • Bold/italic text
  • Links
  • Bullet lists
  • Code blocks with syntax highlighting
  • Horizontal dividers
  • Paragraphs

Features:

  • Batched uploads (100 blocks per request)
  • Automatic rate limiting (350ms between batches)
  • Rich text is automatically chunked to Notion's 2000-character limit (including bold/italic/link spans)
  • Returns Notion page URL and ID

Output:

Parsed 294 blocks from markdown
✓ Created page: https://www.notion.so/[title-and-id]
✓ Appended 100 blocks (100-200)
✓ Appended 94 blocks (200-294)

✅ Successfully created Notion page!

6. Notion → Markdown Sync

Pull Notion page content and convert to markdown.

node scripts/notion-to-md.js <page-id> [output-file] [--json] [--allow-unsafe-paths]

Example:

node scripts/notion-to-md.js \
  "abc123-example-page-id-456def" \
  "newsletter-updated.md"

Features:

  • Converts Notion blocks to markdown
  • Preserves formatting (headings, lists, code, quotes)
  • Optional file output (writes to file or stdout)

7. Change Detection & Monitoring

Monitor Notion pages for edits and compare with local markdown files.

node scripts/watch-notion.js "<page-id>" "<local-markdown-path>" [--state-file <path>] [--json] [--allow-unsafe-paths]

Example:

node scripts/watch-notion.js \
  "abc123-example-page-id-456def" \
  "projects/newsletter-draft.md"

State tracking: By default maintains state in memory/notion-watch-state.json (relative to current working directory). You can override with --state-file <path> (supports ~ expansion):

node scripts/watch-notion.js "<page-id>" "<local-path>" --state-file ~/.cache/notion-watch-state.json

Default state schema:

{
  "pages": {
    "<page-id>": {
      "lastEditedTime": "2026-01-30T08:57:00.000Z",
      "lastChecked": "2026-01-31T19:41:54.000Z",
      "title": "Your Page Title"
    }
  }
}

Output:

{
  "pageId": "<page-id>",
  "title": "Your Page Title",
  "lastEditedTime": "2026-01-30T08:57:00.000Z",
  "hasChanges": false,
  "localPath": "/path/to/your-draft.md",
  "actions": ["✓ No changes since last check"]
}

Automated monitoring: Schedule periodic checks using cron, CI pipelines, or any task scheduler:

# Example: cron job every 2 hours during work hours
0 9-21/2 * * * cd /path/to/workspace && node scripts/watch-notion.js "<page-id>" "<local-path>"

The script outputs JSON — pipe it to any notification system when hasChanges is true.

8. Database Management

Add Markdown Content to Database

Add a markdown file as a new page in any Notion database.

node scripts/add-to-database.js <database-id> "<page-title>" <markdown-file-path> [--json] [--allow-unsafe-paths]

Examples:

# Add research output
node scripts/add-to-database.js \
  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx \
  "Research Report - Feb 2026" \
  projects/research-insights.md

# Add project notes
node scripts/add-to-database.js \
  <project-db-id> \
  "Sprint Retrospective" \
  docs/retro-2026-02.md

# Add meeting notes
node scripts/add-to-database.js \
  <notes-db-id> \
  "Weekly Team Sync" \
  notes/sync-2026-02-06.md

Features:

  • Creates database page with title property
  • Converts markdown to Notion blocks (headings, paragraphs, dividers)
  • Handles large files with batched uploads
  • Returns page URL for immediate access

Note: Additional properties (Type, Tags, Status, etc.) must be set manually in Notion UI after creation.

Inspect Database Schema

node scripts/get-database-schema.js <database-id> [--json]

Example output:

{
  "object": "database",
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "title": [{"plain_text": "Ax Resources"}],
  "properties": {
    "Name": {"type": "title"},
    "Type": {"type": "select"},
    "Tags": {"type": "multi_select"}
  }
}

Use when:

  • Setting up new database integrations
  • Debugging property names/types
  • Understanding database structure

Archive Pages

node scripts/delete-notion-page.js <page-id> [--json]

Note: This archives the page (sets archived: true), not permanent deletion.

Common Workflows

Collaborative Editing Workflow

  1. Push local draft to Notion:
   node scripts/md-to-notion.js draft.md <parent-id> "Draft Title"
  1. User edits in Notion (anywhere, any device)
  1. Monitor for changes:
   node scripts/watch-notion.js <page-id> <local-path>
   # Returns hasChanges: true when edited
  1. Pull updates back:
   node scripts/notion-to-md.js <page-id> draft-updated.md
  1. Repeat as needed (update same page, don't create v2/v3/etc.)

Research Output Tracking

  1. Generate research locally (e.g., via sub-agent)
  1. Sync to Notion database:
   node scripts/add-research-to-db.js
  1. User adds metadata in Notion UI (Type, Tags, Status properties)
  1. Access from anywhere via Notion web/mobile

Page ID Extraction

From Notion URL: https://notion.so/Page-Title-abc123-example-page-id-456def

Extract: abc123-example-page-id-456def (last part after title)

Or use the 32-char format: abc123examplepageid456def (hyphens optional)

Limitations

  • Property updates: Database properties (Type, Tags, Status) must be added manually in Notion UI after page creation. API property updates can be temperamental with inline databases.
  • Block limits: Very large markdown files (>1000 blocks) may take several minutes to sync due to rate limiting.
  • Formatting: Some complex markdown (tables, nested lists >3 levels) may not convert perfectly.

Troubleshooting

"Could not find page" error:

  • Ensure page/database is shared with your integration
  • Check page ID format (32 chars, alphanumeric + hyphens)

"Module not found" error:

  • Scripts use built-in Node.js https module (no npm install needed)
  • Ensure running from the skill's directory (where scripts/ lives)

Rate limiting:

  • Notion API has rate limits (~3 requests/second)
  • Scripts handle this automatically with 350ms delays between batches

Resources

scripts/

Core Sync:

  • md-to-notion.js - Markdown → Notion sync with full formatting
  • notion-to-md.js - Notion → Markdown conversion
  • watch-notion.js - Change detection and monitoring

Search & Query:

  • search-notion.js - Search pages and databases by query
  • query-database.js - Query databases with filters and sorting
  • update-page-properties.js - Update database page properties
  • batch-update.js - Batch update one property across many pages (query or stdin IDs)

Database Management:

  • add-to-database.js - Add markdown files as database pages
  • get-database-schema.js - Inspect database structure
  • delete-notion-page.js - Archive pages

Utilities:

  • notion-utils.js - Shared utilities (error handling, property formatting, API requests)

All scripts use only built-in Node.js modules (https, fs) - no external dependencies required.

references/

  • database-patterns.md - Common database schemas and property patterns

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

OpenClaw

71.28%
按下载量换算30,647

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

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

安装前确认

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

来源信息

继续浏览同类 Skills