Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
A powerful CLI for the Notion API. Query databases, manage pages, add comments, and automate your workspace from the terminal. Built for AI agents and humans alike.
The init command saves your API key and auto-discovers all databases shared with your integration. Each database gets an alias (a short slug derived from the database title) so you never need to type raw UUIDs.
Tip: In Notion, you must share each database with your integration first: open the database → ••• menu → Connections → Add your integration.
Auto-Aliases
When you run notion init, every shared database is automatically assigned a slug alias:
Found 3 databases:
✅ projects → Projects
✅ tasks → Tasks
✅ reading-list → Reading List
You can then use instead of everywhere. Manage aliases manually with:
projects
a1b2c3d4-e5f6-...
notion alias list # Show all aliases
notion alias add mydb <db-id> # Add a custom alias
notion alias rename old new # Rename an alias
notion alias remove mydb # Remove an alias
Commands Reference
Database Discovery
notion dbs # List all databases shared with your integration
notion alias list # Show configured aliases with IDs
notion delete <page-id> # By page ID
notion delete tasks --filter "Name=Old task"# By alias + filter
notion delete workouts --filter "Date=2026-02-09"# By alias + filter
Relations & Rollups
notion relations tasks --filter "Name=Ship feature"# See linked pages with titles
notion relations projects --filter "Name=Launch CLI"# Explore connections
Relations are automatically resolved to page titles in get output. Rollups are parsed into numbers, dates, or arrays instead of raw JSON.
# By alias + filter — no page ID needed
notion update tasks --filter "Name=Review PR #42" --prop "Status=Done"# Or by page ID if you already have it
notion update <page-id> --prop "Status=Done"
5. Read page content (zero UUIDs)
# By alias + filter
notion get tasks --filter "Name=Review PR #42"
notion blocks tasks --filter "Name=Review PR #42"# Or by page ID
notion get <page-id>
notion blocks <page-id>
notion me # Check integration identity
notion props tasks --filter "Name=Ship feature"# Quick property dump
notion templates tasks # List available templates
Property Type Reference
When using --prop key=value, the CLI auto-detects the property type from the database schema:
Type
Example Value
Notes
title
Name=Hello World
Main title property
rich_text
Notes=Some text
Plain text content
number
Amount=42.5
Numeric values
select
Status=Active
Single select option
multi_select
Tags=bug,urgent
Comma-separated options
date
Due=2026-03-01
ISO 8601 date string
checkbox
Done=true
true, 1, or yes
url
Link=https://example.com
Full URL
email
Contact=user@example.com
Email address
phone_number
Phone=+1234567890
Phone number string
status
Status=In Progress
Status property
Multi-Workspace Profiles
Manage multiple Notion accounts from one CLI:
notion workspace add work --key ntn_work_key # Add workspace
notion workspace add personal --key ntn_personal # Add another
notion workspace list # Show all
notion workspace use work # Switch active
notion workspace remove old # Remove one# Per-command override
notion query tasks --workspace personal
notion -w work add projects --prop "Name=Q2 Plan"# Init with workspace
notion init --workspace work --key ntn_work_key
Aliases are scoped per workspace. Old single-key configs auto-migrate to a "default" workspace.
Notion API 2025 — Dual IDs
The Notion API (2025-09-03) uses dual IDs for databases: a database_id and a data_source_id. notioncli handles this automatically — when you run notion init or notion alias add, both IDs are discovered and stored. You never need to think about it.
Troubleshooting
"No Notion API key found" — Run notion init --key ntn_... or export NOTION_API_KEY=ntn_...
"Unknown database alias" — Run notion alias list to see available aliases, or notion init to rediscover
"Not found" errors — Make sure the database/page is shared with your integration in Notion
Filter/sort property not found — Property names are case-insensitive; run notion --json query <alias> --limit 1 to see available properties