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
Auth
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
Pages
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.
Databases
Filter operators
Multiple -F flags combine with AND. Property types are auto-detected from schema.
Sort: -s 'Date:desc' or -s 'Name:asc'
Bulk add file format
Blocks
Block types: paragraph/p, h1/h2/h3, bullet, numbered, todo, quote, code, callout, divider.
Media blocks (image / file / video / audio / pdf)
Same triple (--<kind>-url / --<kind>-file / --<kind>-upload) exists for image, file, video, audio, pdf. --caption works with any.
Comments
Users
Files
Raw API (escape hatch)
Output Modes
- Terminal (TTY): colored tables, readable formatting
- Piped / scripted: JSON automatically
- Explicit:
--format json/--format table/--format md --debug: show HTTP request/response details
All output includes full Notion UUIDs. All commands accept Notion URLs or IDs.
Tips for agents
notion db addandnotion page setauto-detect property types from schema, soTags=a,b,c(multi_select) andDone=true(checkbox) both just work.- For long markdown, prefer
notion page set-markdown --fileovernotion block append --file— server-side parsing has no 100-children limit. - For relation / rollup properties that may have >25 items, always use
notion page property(notpage view/page props). - Pipe to
jq:notion db query <id> -F 'Status=Done' --format json | jq '.results[].id' - When an error looks confusing, check it for a
→hint line — the CLI decorates common API errors with actionable next steps. - When working with an internal integration: workspace-root page creation isn't allowed — share a parent page first, then pass its id.

