notes
cmdhub adapter

Notion CLI
for cmdhub.

Databases, pages, blocks, and search with command-level schema.

lock Auth: Private session
Quick Install cmdhub get notion

terminal Command Reference

Generated from source. Global flags apply to all commands.

Global Flags

--config string Config path override
--cursor string Continuation cursor
--debug bool Enable debug diagnostics
--json bool Alias for --output json
--jsonl bool Alias for --output jsonl
--limit int = 50 Maximum items to emit
--no-paginate bool Fetch only one page
--output, -o string = human Output override: json|jsonl (default: human)
--page-size int = 50 Requested upstream page size
--profile string = default Config/auth profile
--quiet, -q bool Suppress non-essential diagnostics
--trace-id string Trace identifier
--view string = summary View mode: summary|full

notion auth — Manage Notion session authentication

notion auth login Store a Notion private session token
--session-token string Notion token_v2 session cookie value (use - to read from stdin)
$ notion auth login --session-token <token>
$ notion auth login --session-token -
notion auth logout Remove stored Notion session credentials
$ notion auth logout
notion auth refresh Validate stored Notion session
$ notion auth refresh
$ notion auth refresh --output json
notion auth status Show Notion auth status
$ notion auth status
$ notion auth status --output json
notion auth whoami Show the current Notion user and workspace
$ notion auth whoami
$ notion auth whoami --output json

notion block — Work with Notion blocks

notion block append Append a block to a Notion page
--body string Block text content; use @file to read from a file, - to read from stdin
--checked bool Mark to_do block as checked (only meaningful with --type to_do)
--page string Page reference (marker, URL, or UUID)
--type string = paragraph Block type: paragraph, heading_1, heading_2, heading_3, bulleted_list, numbered_list, to_do, code, quote
$ notion block append --page p1 --body "Hello world"
$ notion block append --page p1 --body @notes.txt --type code
$ notion block append --page p1 --body "Buy milk" --type to_do --checked
$ echo "From stdin" | notion block append --page p1 --body -
$ notion page get p1 --output jsonl | notion block append --body "New block"
notion block delete Delete (trash) a Notion block
$ notion block delete 34363c01-413c-80d0-9a94-decec2d05793
$ notion block list --page p1 --output jsonl | notion block delete
notion block list List blocks in a Notion page
--depth int Max nesting depth (0 = unlimited)
--page string Page reference (marker, URL, or UUID)
$ notion block list --page p1
$ notion block list --page https://notion.so/...
$ notion page get p1 --output jsonl | notion block list
notion capabilities Describe Notion adapter capabilities

notion database — Work with Notion databases

notion database get Get a Notion database by ref
$ notion database get d1
$ notion database get https://notion.so/...
$ notion database list --output jsonl | notion database get
notion database list List accessible Notion databases
--limit int = 20 Maximum number of results to return
--query string Text query to match database titles
$ notion database list
$ notion database list --query 'Cmdhub Evals'
$ notion database list --limit 10 --output jsonl
notion database query Query rows in a Notion database
--filter string Filter as raw Notion query JSON
--limit int = 50 Maximum number of rows to return
--query string Text query to match returned page titles and properties
--sort string Sort as raw Notion query JSON
$ notion database query d1
$ notion database query d1 --query 'Block Delete Target'
$ notion database query d1 --limit 10
$ notion database query d1 --output jsonl | notion page get
$ notion database list --output jsonl | notion database query
notion doctor Run Notion adapter diagnostics

notion page — Work with Notion pages

notion page archive Archive a Notion page
$ notion page archive p1
$ notion page archive https://notion.so/...
$ notion database query d1 --output jsonl | notion page archive
notion page create Create a new Notion page
--body string Body paragraph text; use @file to read from file, - to read from stdin
--parent string Parent page or database reference
--properties string Raw Notion properties JSON object
--title string Page title
$ notion database list
$ notion page create --parent d1 --title 'New DB Row'
$ notion page create --parent d1 --title 'Notes' --body 'First paragraph here'
$ notion page create --parent d1 --title 'Notes' --body @notes.txt
$ notion page create --parent d1 --properties '{"status":[["In Progress"]]}'
notion page get Get a Notion page by ref
$ notion page get p1
$ notion page get https://notion.so/...
$ notion database query d1 --output jsonl | notion page get
notion page list List Notion pages
--database string Database reference (marker, URL, or UUID)
--limit int = 20 Maximum number of results to return
--parent-page string Parent page reference (marker, URL, or UUID)
$ notion page list
$ notion page list --database d1
$ notion page list --parent-page p1
$ notion page list --database d1 --output jsonl | notion page get
notion page update Update a Notion page
--body string Body paragraph to append; use @file to read from file, - to read from stdin
--properties string Raw Notion properties JSON object
--title string New page title
$ notion page update p1 --title 'New Title'
$ notion page update p1 --body 'Appended paragraph'
$ notion page update p1 --title 'New Title' --body @notes.txt
$ notion database query d1 --output jsonl | notion page update --title 'New Title'
$ notion page update p1 --properties '{"status":[["Done"]]}'
notion resolve Resolve a Notion local marker or shortened canonical reference
notion schema Emit Notion adapter schema hints
--in bool Show input schema
--out bool Show output schema
notion version Show notion version information

play_circle Live Examples

Output captured from a real workspace. Regenerate with scripts/gen-docs.sh --update.

auth

Check current identity
$ notion auth whoami
Authenticated  Philip Kestrel <kestrelphilip@gmail.com>

databases

List accessible databases
$ notion database list
d1      Cmdhub Evals  id: 34c63c01-413c-8064-bbe8-f4e1cda73ef0  (16h ago)
d2      Intent CLI Evals  id: 34363c01-413c-8057-b541-f6eed737a00f  (9d ago)
d3      My first db  id: 34363c01-413c-80b8-b0ed-e4dced3a59bf  (9d ago)
d4      Home views  id: 2b33dd03-a906-4e98-846f-18a86cc7f439  (9d ago)
d5      My Tasks  id: 571358bd-e561-4c1c-b378-7c59cbd22f05  (9d ago)
d6      People  id: d3d63c01-413c-82df-b0d8-014512d331ec  (9d ago)

nudge: notion database query d1
Inspect a database
$ notion database get d1
d1  Cmdhub Evals  (16h ago)
  id: 34c63c01-413c-8064-bbe8-f4e1cda73ef0
  properties:
    Checkbox              checkbox
    Name                  title

nudge: notion database query d1
Query a database
$ notion database query d1 --limit 3
p1      This is the first page  id: 34c63c01-413c-80c6-9443-ddf1293cee13  (16h ago)
p2      This is the second page  id: 34c63c01-413c-80f3-b362-db9738919cda  (15h ago)
p3      Eval Page eval-notion-page-1777094249  id: 9fb5c593-9c68-4684-8a96-d092c769cf9a  (1h ago)

nudge: notion page get p1

pages

Get a page
$ notion page get p1
p1  This is the first page
  id: 34c63c01-413c-80c6-9443-ddf1293cee13
  parent: collection
  edited: 16h ago

nudge: notion block list --page p1

blocks

List page blocks
$ notion block list --page p1
No results.

search

Search the workspace
$ notion search --query eval
p1      Props Create eval-notion-prop-create-1777094912  id: 2ad05e25-20c4-4799-a5f0-6773acb4bbf1  (1h ago)
p2      Eval Page eval-notion-page-1777094902  id: c522fa0c-1afa-43da-a443-b9ee0abbbee4  (1h ago)
p3      Props Create eval-notion-prop-create-1777094264  id: fd972bde-f286-4181-ba6f-dfa8aaab5ad8  (1h ago)
p4      Eval Page eval-notion-page-1777094249  id: 9fb5c593-9c68-4684-8a96-d092c769cf9a  (1h ago)
p5      Cmdhub Evals Root  id: 34c63c01-413c-801f-94c1-fb0096875000  (15h ago)
d1      Cmdhub Evals  id: 34c63c01-413c-8064-bbe8-f4e1cda73ef0  (16h ago)
d2      Intent CLI Evals  id: 34363c01-413c-8057-b541-f6eed737a00f  (9d ago)
p6      Intent CLI Evals Root  id: 34363c01-413c-808e-9b39-dccc1b62c3d6  (9d ago)

nudge: notion page get p1

alt_route Composition Patterns

Bridge your ecosystem with zero middleware.

# Review a database row, then inspect the page it points at
notion database query d1 --limit 1 --output jsonl \
  | notion page get