| name | notion |
| description | Manage Notion pages, databases, and comments from the command line. Search, view, create, and edit content in your Notion workspace. |
| allowed-tools | Bash(notion-cli:*) |
Notion CLI
A CLI to manage Notion from the command line, using Notion's remote MCP server.
Prerequisites
The notion-cli command must be available on PATH. To check:
notion-cli --version
If not installed:
go install github.com/lox/notion-cli@latest
Or see: https://github.com/lox/notion-cli
Authentication
The CLI uses OAuth authentication. On first use, it opens a browser for authorization:
notion-cli auth login
notion-cli auth status
notion-cli auth logout
For CI/headless environments, set NOTION_ACCESS_TOKEN environment variable.
Available Commands
notion-cli auth # Manage authentication
notion-cli page # Manage pages (list, view, create, upload, edit)
notion-cli db # Manage databases (list, query)
notion-cli search # Search the workspace
notion-cli comment # Manage comments (list, create)
notion-cli tools # List available MCP tools
Common Operations
Search
notion-cli search "meeting notes"
notion-cli search "project" --limit 5
notion-cli search "query" --json
Pages
All page commands accept a URL, name, or ID to identify pages.
notion-cli page list
notion-cli page list --limit 10
notion-cli page list --json
notion-cli page view <page>
notion-cli page view <page> --raw
notion-cli page view <page> --json
notion-cli page view "Meeting Notes"
notion-cli page view https://notion.so/...
notion-cli page create --title "New Page"
notion-cli page create --title "Doc" --content "# Heading\n\nContent here"
notion-cli page create --title "Child" --parent "Engineering"
notion-cli page create --title "Child" --parent <page-id>
notion-cli page upload ./document.md
notion-cli page upload ./doc.md --title "Custom Title"
notion-cli page upload ./doc.md --parent "Parent Page Name"
notion-cli page edit <page> --replace "New content"
notion-cli page edit <page> --find "old text" --replace-with "new text"
notion-cli page edit <page> --find "section" --append "additional content"
Databases
notion-cli db list
notion-cli db list --json
notion-cli db query <database-url-or-id>
notion-cli db query <id> --json
Comments
notion-cli comment list <page-id>
notion-cli comment list <page-id> --json
notion-cli comment create <page-id> --content "Great work!"
Output Formats
Most commands support --json for machine-readable output:
notion-cli page list --json | jq '.[0].url'
notion-cli search "api" --json | jq '.[] | .title'
Tips for Agents
- Search first - Use
notion-cli search to find pages before operating on them
- Use URLs or IDs - Both work for page/database references
- Check --help - Every command has detailed help:
notion-cli page edit --help
- Raw output - Use
--raw with page view to see the original Notion markup
- JSON for parsing - Use
--json when you need to extract specific fields