
Notion Cli
Wire your agent or shell scripts to Notion pages, databases, blocks, and files through one Go binary with human tables and JSON for automation.
Overview
notion-cli is an agent skill most often used in Build (also Operate infra, Grow content) that documents the notion terminal client for full Notion API automation with 50+ commands and JSON-friendly output.
Install
npx skills add https://github.com/4ier/notion-cli --skill notion-cliWhat is this skill?
- 50+ commands spanning pages, databases, blocks, comments, users, and file uploads
- Single Go binary (v0.7.0) with Homebrew, npm, and go install paths
- Dual output: pretty tables for humans and JSON for agents (--format json)
- Multi-workspace auth: profiles, NOTION_TOKEN env, auth doctor for integration health
- Database query, relation management, and database export for workspace automation
- 50+ Notion API commands documented
- CLI version v0.7.0 referenced in SKILL.md
Adoption & trust: 776 installs on skills.sh; 222 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You live in Notion for planning and ops but copying data or updating databases manually does not scale for agent-driven shipping and maintenance.
Who is it for?
Solo builders automating Notion-backed specs, content DBs, or light CRM from Claude Code, Codex, or shell pipelines.
Skip if: Builders who only need occasional in-app Notion edits without API tokens, or teams blocked from internal integrations that auth doctor flags.
When should I use this skill?
User needs to read, create, update, query, or manage Notion pages, databases, blocks, comments, users, or files from the terminal or programmatically.
What do I get? / Deliverables
After the skill runs, your agent can authenticate, query, mutate, and export Notion resources via CLI commands with predictable JSON for downstream scripts.
- Authenticated CLI command sequences
- JSON payloads suitable for agent parsing
- Exported database or page mutations
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Notion CLI is primarily adopted while integrating workspace data into products and ops scripts, so Build → integrations is the canonical shelf despite ongoing Operate and Grow uses. The skill documents full Notion API coverage—query, create, update, relations, exports—classic third-party integration work from the terminal.
Where it fits
Pipe CI metadata into a Notion release database using notion query with --format json.
Generate and link scope pages from a template database before committing to a full build.
Rotate and verify integration tokens with notion auth doctor across work profiles.
Bulk-update editorial status properties and export a content calendar for analytics.
How it compares
This is a full Notion API CLI skill package, not a browser MCP that clicks the Notion UI.
Common Questions / FAQ
Who is notion-cli for?
Indie developers and operators who want terminal and agent access to Notion workspaces for pages, databases, blocks, comments, and files without writing bespoke API clients.
When should I use notion-cli?
Use it while integrating Notion into apps and scripts (Build integrations), exporting or syncing operational runbooks (Operate infra), or updating content and lifecycle databases (Grow content)—whenever triggers mention Notion workspace automation or database queries from the com
Is notion-cli safe to install?
It requires API tokens with workspace scope; review the Security Audits panel on this Prism page and treat ntn_ secrets like production credentials.
SKILL.md
READMESKILL.md - Notion Cli
# Notion CLI `notion` is a CLI for the Notion API. Single Go binary, full API coverage, dual output (pretty tables for humans, JSON for agents). Current: **v0.7.0**. ## Install ```bash # Homebrew brew install 4ier/tap/notion-cli # npm npm install -g @4ier/notion-cli # Go go install github.com/4ier/notion-cli@latest # Or download a binary from https://github.com/4ier/notion-cli/releases ``` ## Auth ```bash notion auth login --with-token <<< "ntn_xxxxxxxxxxxxx" notion auth login --with-token --profile work <<< "ntn_xxx" # named profile export NOTION_TOKEN=ntn_xxxxxxxxxxxxx # env var alternative notion auth status # shows workspace + integration type (internal/public) notion auth switch # interactive profile picker notion auth switch work # direct switch notion auth doctor # health check — warns if internal integration ``` `auth status` / `doctor` surface the integration type, so it's easy to spot when you need to share a parent page before creating workspace-root content. ## Search ```bash notion search "query" # everything notion search "query" --type page # pages only notion search "query" --type database # databases only ``` ## Pages ```bash notion page view <id|url> # render page content notion page list # list workspace pages notion page create <parent> --title "X" --body "content" notion page create <db-id> --db "Name=Review" "Status=Todo" # database row # Archive / restore (soft-delete) notion page archive <id> # canonical notion page trash <id> # alias notion page delete <id> # alias (legacy) notion page restore <id> # reverse # Move / open / edit notion page move <id> --to <parent> notion page open <id> # open in browser notion page edit <id|url> # edit in $EDITOR (markdown round-trip) # Properties (type-aware) notion page set <id> Key=Value ... notion page props <id> # show all (summary; paginated values may be truncated) notion page props <id> <prop-id> # single raw JSON # NEW in v0.7: paginated single-property fetch (fixes >25-item truncation) notion page property <id> <prop-id> notion page property <id> --name "References" # resolve id by display name notion page property <id> <prop-id> --format json # Relations notion page link <id> --prop "Rel" --to <target-id> notion page unlink <id> --prop "Rel" --from <target-id> # NEW in v0.7: server-side markdown I/O (preferred for full-page dumps) notion page markdown <id> # print to stdout notion page markdown <id> --out page.md # write to file notion page markdown <id> --format json # full response (truncated flag, unknown_block_ids) notion page set-markdown <id> --file new.md # replace whole page (default) cat new.md | notion page set-markdown <id> --file - # stdin notion page set-markdown <id> --append --text "\n\n> Appended" notion page set-markdown <id> --after "Status...pending" --text "Now: done" notion page set-markdown <id> --range "old...stale" --text "fresh" --allow-deleting-content ``` **`page markdown` vs `block list --md`**: prefer `page markdown` for whole pages — it uses the server renderer and handles toggles, columns, synced blocks, and databases-as-pages correctly. Use `block list --md` only when you need a single sub-block. ## Databa