Open Source • PolyForm Shield 1.0.0

Notion from the Command Line

Search pages, list users, view page activity, and explore trending content — all from the terminal. All commands output JSON.

8
CLI Commands
JSON
Structured Output
Agent
Warp + Claude Skill

Knowledge management that lives in your terminal

Every command outputs structured JSON — pipe into jq, scripts, or AI agents

Search
Full-Text
Pages
Details + Content
Activity
Analytics
Agent
Ready

Everything You Need from Notion

8 commands covering search, pages, users, trending, and activity analytics

Full-Text Search

Search across all Notion pages. Results include titles, IDs, types, relevance scores, and view counts.

Page Details

Fetch any page by ID and see its full content rendered as a text summary — headers, lists, toggles, and more.

Trending Pages

Discover the most-viewed pages in your workspace. Sort by view count, last edited, or title.

User Listing

List all workspace users with their names, emails, IDs, and roles. Useful for scripting and lookups.

Page Activity

See who has visited a page, how many times, and when. Track engagement on your most important docs.

User Activity

See where your team spends the most time. Identify power users and their most active pages.

Secure Init

Interactive setup validates your credentials against the Notion API before storing them. Reconfigure anytime with --force.

Agent Skill

Includes a Warp and Claude Code skill. Agents automatically use notion-cli when you ask about Notion pages.

Auto-Pagination

All list commands fetch every page automatically with --all. No manual cursor handling — just get all the data.

How It Works

Three steps from install to your first Notion query

1

Install notion-cli

Install @dotbrains/notion-cli from GitHub Packages. One-time registry and auth token setup, then a single npm install.

2

Configure Your Credentials

Run notion init to interactively set up your Notion credentials. It validates them against the API before saving.

3

Start Using It

Search pages, view trending content, check activity — all from the command line. Pipe JSON output into jq, scripts, or AI agents.

Code Examples

See notion-cli in action — search, pages, trending, and agent workflows

bash
# 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 20

Use Cases

From agent automation to content auditing — notion-cli fits into any workflow

Agent Workflows

Let Warp or Claude autonomously search, retrieve, and analyze Notion pages. The included skill teaches agents how to use notion-cli.

Knowledge Discovery

Search for pages by keyword, view trending content, and quickly find the most relevant documentation — all without leaving your terminal.

Content Auditing

List all pages, check last-edited dates, and identify stale content. Export metadata as JSON for analysis.

Engagement Tracking

Monitor who is reading which pages. Track engagement on onboarding docs, runbooks, and team wikis.

Usage Analytics

All output is JSON — pipe into jq for transforms, feed into dashboards, or generate reports from page and user activity data.

CI/CD Integration

Search for relevant docs in CI, verify documentation exists for new features, or alert on low-engagement pages.

Quick Start

Install notion-cli and query Notion in under a minute

1. Install

Note: Published to GitHub Packages. One-time registry + auth setup required.

bash
# 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

2. Configure & Use

bash
# 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-def

Tip: Open DevTools in your browser, go to the Network tab, and copy your credentials from any request to www.notion.so/api/.

Ready to Get Started?

Install @dotbrains/notion-cli and manage Notion from the command line in under a minute