Loading...
Loading...
Use the ntion CLI to interact with Notion workspaces — searching, reading, creating, updating, and managing pages, databases (data sources), and block content. Use when the user wants to: (1) search their Notion workspace, (2) query or list databases, (3) read, create, update, archive, or relate pages, (4) read, append, insert, replace, or delete block content on pages, (5) manage Notion authentication, or (6) perform any Notion workspace operation from the terminal. Trigger on mentions of "Notion", "ntion", page/database IDs, or requests involving workspace content management.
npx skill4agent add mbroton/notion-cli ntion-clinpx ntionntion~/.config/ntion/config.jsonntion authntion auth --token "secret_xxx"
# Or interactive: ntion auth
# Verify: ntion doctorntion search --query "meeting notes"
ntion search --query "tasks" --object page --limit 10
ntion search --query "Q1" --created-after 2026-01-01T00:00:00Z--query--scope <id>--object page|data_source--created-after/--created-before--edited-after/--edited-before--created-by <user_id>--limit--cursor--scan-limit--view compact|full--prettyntion data-sources list --query "tasks"
ntion data-sources get --id <id> --view full
ntion data-sources schema --id <id>
ntion data-sources query --id <id> \
--filter-json '{"property":"Status","status":{"equals":"In Progress"}}' \
--sort-json '{"property":"Created","direction":"descending"}' \
--limit 50schema# Read
ntion pages get --id <id>
ntion pages get --id <id> --include-content --content-format markdown
# Create
ntion pages create \
--parent-data-source-id <ds_id> \
--properties-json '{"Name":"New task","Status":"Not started"}'
# Bulk create (up to 100)
ntion pages create-bulk \
--parent-data-source-id <ds_id> \
--items-json '[{"properties":{"Name":"A"}},{"properties":{"Name":"B"}}]'
# Update
ntion pages update --id <id> --patch-json '{"Status":"Done"}'
# Archive / restore
ntion pages archive --id <id>
ntion pages unarchive --id <id>
# Relations
ntion pages relate --from-id <id> --property "Project" --to-id <target_id>
ntion pages unrelate --from-id <id> --property "Project" --to-id <target_id># Read content as markdown
ntion blocks get --id <page_or_block_id>
ntion blocks get --id <id> --depth 2 --format compact
# Append to end
ntion blocks append --id <id> --markdown $'## Section\n\nContent here'
ntion blocks append --id <id> --markdown-file ./notes.md
# Insert at position
ntion blocks insert --parent-id <id> --markdown "Intro text" --position start
ntion blocks insert --parent-id <id> --markdown "Middle" --after-id <block_id>
# Find blocks
ntion blocks select \
--scope-id <id> \
--selector-json '{"where":{"type":"paragraph","text_contains":"TODO"}}'
# Replace block range
ntion blocks replace-range \
--scope-id <id> \
--start-selector-json '{"where":{"text_contains":"## Old Section"}}' \
--end-selector-json '{"where":{"text_contains":"## Next Section"}}' \
--markdown "## New Section\n\nUpdated content"
# Delete blocks
ntion blocks delete --ids <block_id>
ntion blocks delete --ids <id1> <id2> <id3>ntion data-sources list --query "tasks"ntion data-sources schema --id <id>ntion data-sources query --id <id> --filter-json '...'ntion blocks get --id <page_id>ntion blocks append --id <page_id> --markdown "..."blocks replace-rangention blocks delete --ids <id1> <id2>{"ok": true, "data": {...}, "meta": {"request_id": "..."}}
{"ok": false, "error": {"code": "not_found", "message": "...", "retryable": false}, "meta": {...}}--view compact--view full--concurrency--pretty