npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@4ier/notion-cli

v0.3.0

Published

Full-featured CLI for Notion. Like gh for GitHub, but for Notion. 44 commands, one binary.

Readme


A full-featured command-line interface for Notion. Manage pages, databases, blocks, comments, users, and files — all from your terminal. Built for developers and AI agents who need programmatic access without the browser.

Install

Homebrew (macOS/Linux)

brew install 4ier/tap/notion-cli

Go

go install github.com/4ier/notion-cli@latest

npm

npm install -g notion-cli-go

Scoop (Windows)

scoop bucket add 4ier https://github.com/4ier/scoop-bucket
scoop install notion-cli

Docker

docker run --rm -e NOTION_TOKEN ghcr.io/4ier/notion-cli search "meeting"

Binary

Download from GitHub Releases — available for Linux, macOS, and Windows (amd64/arm64).

Quick Start

# Authenticate
notion auth login --token ntn_xxxxx

# Search your workspace
notion search "meeting notes"

# Query a database with filters
notion db query <db-id> --filter 'Status=Done' --sort 'Date:desc'

# Create a page in a database
notion page create <db-id> --db "Name=Weekly Review" "Status=Todo"

# Read page content as Markdown
notion block list <page-id> --depth 3 --md

# Append blocks from a Markdown file
notion block append <page-id> --file notes.md

# Raw API escape hatch
notion api GET /v1/users/me

Commands

| Group | Commands | Description | |-------|----------|-------------| | auth | login logout status doctor | Authentication & diagnostics | | search | search | Search pages and databases | | page | view list create delete restore move open set props link unlink | Full page lifecycle | | db | list view query create update add add-bulk open | Database CRUD + query | | block | list get append insert update delete | Content block operations | | comment | list add get | Discussion threads | | user | me list get | Workspace members | | file | list upload | File management | | api | <METHOD> <path> | Raw API escape hatch |

39 subcommands covering 100% of the Notion API.

Features

Human-Friendly Filters

No JSON needed for 90% of queries:

notion db query <id> --filter 'Status=Done' --filter 'Priority=High' --sort 'Date:desc'

For complex queries (OR, nesting), use the JSON escape hatch:

notion db query <id> --filter-json '{"or":[{"property":"Status","status":{"equals":"Done"}},{"property":"Status","status":{"equals":"Cancelled"}}]}'

Schema-Aware Properties

Property types are auto-detected from the database schema:

notion page create <db-id> --db "Name=Sprint Review" "Date=2026-03-01" "Points=8" "Done=true"

Smart Output

  • Terminal: Colored tables, formatted text
  • Pipe/Script: Clean JSON for jq, scripts, and AI agents
# Pretty table in terminal
notion db query <id>

# JSON when piped
notion db query <id> | jq '.results[].properties.Name'

Markdown I/O

# Read blocks as Markdown
notion block list <page-id> --md --depth 3

# Write Markdown to Notion
notion block append <page-id> --file document.md

Supports headings, bullets, numbered lists, todos, quotes, code blocks, and dividers.

Recursive Block Reading

notion block list <page-id> --depth 5 --all

URL or ID — Your Choice

# Both work
notion page view abc123def
notion page view https://notion.so/My-Page-abc123def456

Actionable Error Messages

object_not_found: Could not find page with ID abc123
  → Check the ID is correct and the page/database is shared with your integration

For AI Agents

This CLI is designed to be agent-friendly:

  • JSON output when piped — no parsing needed
  • Schema-aware — agents don't need to know property types
  • URL resolution — paste Notion URLs directly
  • Single binary — no runtime dependencies
  • Exit codes — 0 for success, non-zero for errors

Install as an agent skill:

npx skills add 4ier/notion-cli

Configuration

# Token is stored in ~/.config/notion-cli/config.json (mode 0600)
notion auth login --token ntn_xxxxx

# Or use environment variable
export NOTION_TOKEN=ntn_xxxxx

# Check authentication
notion auth status
notion auth doctor

Contributing

Issues and PRs welcome at github.com/4ier/notion-cli.

License

MIT