Search pages, list users, view page activity, and explore trending content — all from the terminal. All commands output JSON.
Every command outputs structured JSON — pipe into jq, scripts, or AI agents
8 commands covering search, pages, users, trending, and activity analytics
Search across all Notion pages. Results include titles, IDs, types, relevance scores, and view counts.
Fetch any page by ID and see its full content rendered as a text summary — headers, lists, toggles, and more.
Discover the most-viewed pages in your workspace. Sort by view count, last edited, or title.
List all workspace users with their names, emails, IDs, and roles. Useful for scripting and lookups.
See who has visited a page, how many times, and when. Track engagement on your most important docs.
See where your team spends the most time. Identify power users and their most active pages.
Interactive setup validates your credentials against the Notion API before storing them. Reconfigure anytime with --force.
Includes a Warp and Claude Code skill. Agents automatically use notion-cli when you ask about Notion pages.
All list commands fetch every page automatically with --all. No manual cursor handling — just get all the data.
Three steps from install to your first Notion query
Install @dotbrains/notion-cli from GitHub Packages. One-time registry and auth token setup, then a single npm install.
Run notion init to interactively set up your Notion credentials. It validates them against the API before saving.
Search pages, view trending content, check activity — all from the command line. Pipe JSON output into jq, scripts, or AI agents.
See notion-cli in action — search, pages, trending, and agent workflows
# Full-text search across all Notion pages
$ notion search "onboarding guide"
→ [
{ "title": "Getting Started", "id": "abc-123", "type": "page", "score": "12.34", "views": 245 },
{ "title": "Team Onboarding", "id": "def-456", "type": "page", "score": "10.56", "views": 189 }
]
# List all pages sorted by last edited
$ notion pages --sort edited --limit 20From agent automation to content auditing — notion-cli fits into any workflow
Let Warp or Claude autonomously search, retrieve, and analyze Notion pages. The included skill teaches agents how to use notion-cli.
Search for pages by keyword, view trending content, and quickly find the most relevant documentation — all without leaving your terminal.
List all pages, check last-edited dates, and identify stale content. Export metadata as JSON for analysis.
Monitor who is reading which pages. Track engagement on onboarding docs, runbooks, and team wikis.
All output is JSON — pipe into jq for transforms, feed into dashboards, or generate reports from page and user activity data.
Search for relevant docs in CI, verify documentation exists for new features, or alert on low-engagement pages.
Install notion-cli and query Notion in under a minute
Note: Published to GitHub Packages. One-time registry + auth setup required.
# 1. Point @dotbrains scope at GitHub Packages
npm config set @dotbrains:registry https://npm.pkg.github.com
# 2. Authenticate (use a PAT with read:packages scope)
npm config set //npm.pkg.github.com/:_authToken $(gh auth token)
# 3. Install globally
npm install -g @dotbrains/notion-cli# Set up your Notion credentials
notion init
# Search for pages
notion search "onboarding guide"
# Get a specific page
notion page abc-123-def
# List trending pages
notion trending
# See page activity
notion page-activity abc-123-defTip: Open DevTools in your browser, go to the Network tab, and copy your credentials from any request to www.notion.so/api/.
Install @dotbrains/notion-cli and manage Notion from the command line in under a minute