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

@jordancoin/notioncli

v1.4.0

Published

A powerful CLI for the Notion API — query databases, manage pages, and automate your workspace from the terminal.

Downloads

652

Readme

notioncli

npm version CI License: MIT Node.js

A CLI for the Notion API. Aliases instead of UUIDs, property names as flags, full CRUD, automatic pagination, rate limit retry. Built for humans and AI agents.

npm install -g @jordancoin/notioncli

Setup

1. Create a Notion Integration

Go to notion.so/profile/integrationsNew integration → copy the API key (ntn_...)

2. Share Your Databases

In Notion, open each database → ••• menu → Connections → add your integration.

3. Initialize

notion init --key ntn_your_api_key_here
✅ API key saved

Found 3 databases:
  ✅ project-tracker  → Project Tracker
  ✅ reading-list     → Reading List
  ✅ meeting-notes    → Meeting Notes

3 aliases saved. Try: notion query project-tracker

Aliases are created automatically from database names. Rename them anytime:

notion alias rename project-tracker projects

Commands

| Command | Description | Example | |---------|-------------|---------| | query | Query a database | notion query projects --filter Status=Active | | add | Create a page | notion add projects --name "Ship it" --status "Todo" | | update | Update a page | notion update projects --filter "Name=Ship it" --status "Done" | | delete | Archive a page | notion delete projects --filter "Name=Old task" | | get | View page details | notion get projects --filter "Name=Ship it" | | props | Quick property view | notion props projects --filter "Name=Ship it" | | blocks | View page content | notion blocks projects --filter "Name=Ship it" --ids | | block-edit | Edit a block | notion block-edit <block-id> "New text" | | block-delete | Delete a block | notion block-delete <block-id> | | append | Add content to a page | notion append projects "Update: shipped!" --filter "Name=Ship it" | | search | Search everything | notion search "meeting" | | dbs | List all databases | notion dbs | | relations | Explore linked pages | notion relations tasks --filter "Name=Ship it" | | comments | View page comments | notion comments tasks --filter "Name=Ship it" | | comment | Add a comment | notion comment tasks "Done! 🚀" --filter "Name=Ship it" | | users | List workspace users | notion users | | me | Show bot identity | notion me | | move | Move page between DBs | notion move tasks --filter "Name=Done" --to archive | | templates | List DB templates | notion templates projects | | db-create | Create a database | notion db-create <parent-id> "Tasks" --prop "Name:title" | | db-update | Update DB schema | notion db-update projects --add-prop "Rating:number" | | upload | Upload file to page | notion upload tasks --filter "Name=Ship it" ./file.png | | import | Import file as pages | notion import projects ./data.csv | | export | Export page as markdown | notion export projects --filter "Name=Ship it" | | alias | Manage aliases | notion alias list | | workspace | Manage workspaces | notion workspace list |


Examples

Query with filters and sorting

$ notion query projects --filter Status=Active --sort Date:desc --limit 5

Date       │ Name            │ Status │ Priority
───────────┼─────────────────┼────────┼──────────
2026-02-09 │ Launch CLI      │ Active │ High
2026-02-08 │ Write Docs      │ Active │ Medium

2 results

Rich filter operators

# Comparison operators
notion query tasks --filter "Priority>3"
notion query tasks --filter "Count>=10"
notion query tasks --filter "Status!=Draft"

# Multiple filters (AND)
notion query tasks --filter Status=Active --filter Priority=High

# Relative dates
notion query tasks --filter "Due=today"
notion query tasks --filter "Created>=last_week"

# Values containing operators (parsed correctly)
notion query tasks --filter "Description=score>=90"
notion query tasks --filter 'Notes="contains quotes"'

Dynamic property flags

Property names from your database schema become CLI flags automatically:

# Instead of --prop "Name=Ship it" --prop "Status=Done":
notion add projects --name "Ship it" --status "Done" --priority "High"
notion update projects --filter "Name=Ship it" --status "Complete"

Import data

# CSV or JSON → database pages
notion import projects ./tasks.csv
notion import projects ./data.json

# Markdown → page with content blocks
notion add projects --name "My Notes" --from notes.md

Export content

# Page content → markdown
notion export projects --filter "Name=Ship it"
# Outputs: # Ship it\n\nPage content as markdown...

View page details (relations auto-resolved)

$ notion get tasks --filter "Name=Implement relations"

Page: a1b2c3d4-5678-90ab-cdef-1234567890ab
URL:  https://www.notion.so/...

Properties:
  Name: Implement relations
  Project: Build CLI              ← relation resolved to title
  Done: ✓
  Task Count: 3                   ← rollup parsed to number

Multi-workspace

notion workspace add work --key ntn_work_key
notion workspace add personal --key ntn_personal_key
notion workspace use work
notion init   # discovers databases for active workspace

# Per-command override
notion query tasks --workspace personal
notion -w work add projects --name "Q2 Plan"

Output formats

notion query tasks --output table   # default
notion query tasks --output csv
notion query tasks --output json
notion query tasks --output yaml
notion --json query tasks           # raw API response (pipe to jq)

AI Agent Usage

notioncli works well as a tool for LLMs and coding agents — no API key juggling, no JSON formatting, just shell commands:

notion dbs                                    # discover databases
notion alias list                             # see available aliases
notion query tasks --filter Status=Todo       # read data
notion add tasks --name "Fix bug" --status "In Progress"   # write data
notion --json query tasks --limit 10          # structured output for parsing

Every page-targeted command accepts alias + --filter instead of UUIDs:

# No UUIDs needed — ever
notion update projects --filter "Name=Ship it" --status "Done"
notion delete projects --filter "Name=Old task"
notion blocks projects --filter "Name=Ship it" --ids

Configuration

Config lives at ~/.config/notioncli/config.json. API key resolution: NOTION_API_KEY env var → config file.

notion alias list       # see aliases
notion alias add tasks <database-id>   # manual alias
notion workspace list   # see workspaces

Reliability

  • Automatic pagination — All list endpoints fetch every result by default. Use --limit to cap.
  • Rate limit retry — 429 responses trigger exponential backoff with jitter (up to 5 attempts). Transparent — no flags needed.
  • Input validation — Numbers, dates, URLs, and emails are validated before hitting the API. Clear error messages instead of cryptic 400s.

Technical Details

For API internals, the 2025 dual-ID system, modular architecture, and testing (213 tests): see TECHNICAL.md.


License

MIT © JordanCoin