| name | notion-cli |
| description | Notion workspace management via CLI. Activate when user mentions "Notion", "notion page", "notion database", or wants to search/create/update content in their Notion workspace. |
Notion CLI Skill
Use this skill when the user wants to interact with their Notion workspace.
Trigger Examples
- "Search my Notion for meeting notes"
- "Create a new Notion page"
- "Add content to my Notion page"
- "Query my Notion database"
- "Show me my Notion page"
- "Update my Notion page title"
- "Add a task to my Notion database"
- "Export my Notion page to markdown"
- "Backup my Notion workspace"
Quick Reference
Authentication
notion-cli --set-auth <integration-token>
notion-cli --set-auth <token> --profile work
notion-cli --check-auth
notion-cli --clear-auth
notion-cli --list-profiles
Pages
notion-cli --get-page <page-id>
notion-cli --create-page <parent-id> --title "Title" [--icon "emoji"] [--template <name>]
notion-cli --update-page <page-id> --title "New Title"
notion-cli --archive-page <page-id>
Blocks (Page Content)
notion-cli --get-blocks <page-id> [--all]
notion-cli --get-block <block-id>
notion-cli --append-block <page-id> --type paragraph --content "Text"
notion-cli --append-blocks <page-id> --file blocks.json
notion-cli --update-block <block-id> --content "New text"
notion-cli --delete-block <block-id>
Block types: paragraph, heading_1, heading_2, heading_3, bulleted_list_item, numbered_list_item, to_do, quote, callout, toggle, divider, code
Databases
notion-cli --get-database <db-id>
notion-cli --query-database <db-id> [--filter <json>] [--sort <json>] [--all]
notion-cli --create-db-item <db-id> --props '<json>'
notion-cli --update-db-item <item-id> --props '<json>'
Database Shortcuts (Task Management)
notion-cli --add-task <db-id> --name "Task Name" [--status "Status"] [--due "2024-12-31"]
notion-cli --complete-task <task-id>
notion-cli --list-tasks <db-id> [--status "In Progress"]
Search
notion-cli --search "query" [--filter page|database] [--all]
Comments
notion-cli --get-comments <block-id>
notion-cli --add-comment <page-id> --content "Comment text" [--discussion <id>]
Users
notion-cli --get-users
notion-cli --get-user <user-id>
notion-cli --get-me
Templates
notion-cli --list-templates
notion-cli --create-page <parent-id> --template meeting-notes --title "Title"
Available: meeting-notes, task-list, project-brief, weekly-review, bug-report
Export & Import
notion-cli --export-page <page-id> [--export-format markdown|json] [--output <file>]
notion-cli --import-markdown <page-id> --file <file.md>
notion-cli --backup [--output <file.json>]
Output Formats
notion-cli <command> --format json|table|csv|yaml|pretty
Workflows
1. First-time Setup
notion-cli --set-auth secret_xxxxx
notion-cli --check-auth
2. Search and View Content
notion-cli --search "meeting notes"
notion-cli --get-page <page-id>
notion-cli --get-blocks <page-id> --all
3. Create New Page with Template
notion-cli --create-page <parent-id> --template meeting-notes --title "Weekly Sync"
notion-cli --append-block <new-page-id> --type paragraph --content "Additional notes..."
4. Quick Task Management
notion-cli --add-task <db-id> --name "Review PR" --status "In Progress" --due "2024-12-31"
notion-cli --list-tasks <db-id> --status "In Progress"
notion-cli --complete-task <task-id>
5. Export and Backup
notion-cli --export-page <page-id> --export-format markdown --output page.md
notion-cli --backup --output workspace-backup.json
6. Multiple Workspaces
notion-cli --set-auth secret_personal --profile personal
notion-cli --set-auth secret_work --profile work
notion-cli --search "notes" --profile work
Response Format
All responses are JSON:
{"ok":true,"data":{...}}
{"ok":false,"error":"message","code":"ERROR_CODE"}
Error Codes
AUTH_ERROR - Authentication failed
NOT_FOUND - Resource not found
RATE_LIMIT - Too many requests
MISSING_PARAM - Required parameter missing
INVALID_PARAM - Invalid parameter value
HTTP_ERROR - Network error
Important Notes
- The integration must be shared with pages/databases to access them
- Page IDs can be found in the page URL (32-character string after the page name)
- Use
--database flag when creating a page inside a database
- Filter and props parameters must be valid JSON
- Use
--all flag to auto-paginate and get all results
- Use
--format table for human-readable output