Notion CLI
for cmdhub.
Databases, pages, blocks, and search with command-level schema.
cmdhub get notion
data_object Agent Contract
Agents should start with auth/status and discovery commands, inspect schemas before composition, and treat commands marked as mutating as state-changing operations.
Output
Use human output for reading, `--json` for one object, and `--jsonl` for pipes.
Auth
Notion private session. Stored locally by the CLI for the selected Notion workspace.
Refs
Prefer list/search, then short refs or piped JSONL. Use `resolve` to inspect cached refs.
Schemas
Use `notion schema` and `catalog.json` to inspect fields, flags, examples, and side effects.
Auth scopes
Notion private session tokenterminal Command Reference
Generated from source. Global flags apply to all commands.
Global Flags
--json
bool
Emit JSON machine output--jsonl
bool
Emit JSONL records for piping--output, -o
string
Compatibility output mode: json|jsonl. Prefer --json or --jsonl--view
string = summary
View mode: summary|full--profile
string = default
Config/auth profile--config
string
Config path override--quiet, -q
bool
Suppress non-essential diagnostics--debug
bool
Enable debug diagnostics--limit
int = 50
Maximum items to emit--page-size
int = 50
Requested upstream page size--cursor
string
Continuation cursor--no-paginate
bool
Fetch only one page--version, -v
bool
Print version informationnotion auth
Manage Notion PAT authenticationManage Notion Personal Access Token authentication for the active profile.
Use auth status when commands fail with AUTH_REQUIRED. Use auth login to store a Notion PAT. Use auth whoami to confirm which user or bot the profile points at.
notion auth login
Store a Notion Personal Access TokenStore a Notion Personal Access Token (PAT) for the active profile.
This validates the PAT against the Notion REST API and caches the returned identity metadata.
--pat
string
read the Notion PAT from stdin when set to ---pat-env
string
read the Notion PAT from this environment variablenotion auth logout
Remove stored Notion credentialsnotion auth refresh
Validate the stored Notion PATnotion auth status
Show Notion auth statusnotion auth whoami
Show the current Notion user and workspacenotion block
Work with Notion blocksGet, list, append, and delete Notion blocks within a page.
Blocks are referred to by –page where ref is a local marker (p1), URL, or UUID.
notion block append
Append a block to a Notion pageAppend a new block to the end of a Notion page.
Use –body to supply text directly, @file to read from a file, or - to read from stdin. When –body - is used, –page must be provided explicitly (stdin is consumed for body text). When –page is omitted, a piped item from a previous command is used as the page reference.
Supported block types: paragraph, heading_1, heading_2, heading_3, bulleted_list, numbered_list, to_do, code, quote
--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, quotenotion block delete
Delete (trash) one or more Notion blocksDelete a block by local block ref or a piped item from block list.
This moves the block to trash (alive=false). It does not permanently delete. Use notion block list –page p1 –jsonl to pipe block items into this command.
--all
bool
Confirm batch block deletion--yes
bool
Confirm destructive batch block deletionnotion block get
Get one or more Notion blocks by refGet a Notion block by local marker, URL, or UUID.
Run block list first to populate local block markers from a page.
notion block list
List blocks in a Notion pageList the blocks contained in a Notion page.
Returns a structured list of block types and their text content. Use –depth to control how many levels of nesting are returned (default: all).
--depth
int
Max nesting depth (0 = unlimited)--page
string
Page reference (marker, URL, or UUID)notion capabilities
Describe capabilitiesnotion config
Inspect local configurationnotion config explain
Explain resolved configurationnotion data-source
Work with Notion data sourcesList, inspect, and query Notion data sources.
Data sources are the queryable tables that live under Notion databases. Run data-source list first to populate local markers for follow-up commands.
notion data-source get
Get one or more Notion data sources by refGet a Notion data source by local marker, URL, or UUID.
Returns metadata including title, collection ID, and property schema.
notion data-source list
List accessible Notion data sourcesList Notion data sources accessible to the current PAT.
This searches the workspace for queryable database-like content and assigns local markers (ds1, …) for follow-up commands. Use –query to narrow results by title.
--limit
int = 20
Maximum number of results to return--query
string
Text query to match database titlesnotion data-source query
Query rows in a Notion data sourceQuery rows in a Notion database or data source.
Returns page rows with their titles and properties. Use –query for simple text matching across titles/properties. Use –filter and –sort for advanced queries (raw Notion query JSON).
--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 JSONnotion database
Work with Notion databasesList, inspect, and query Notion databases.
Databases are referred to by local marker (d1), Notion URL, or UUID. Run database list first to populate local markers.
notion database get
Get one or more Notion databases by refGet a Notion database by local marker, URL, or UUID.
Returns metadata including title, collection ID, and property schema.
notion database list
List accessible Notion databasesList Notion databases accessible to the current PAT.
This searches the workspace for queryable database-like content and assigns local markers (d1, …) for follow-up commands. Use –query to narrow results by title.
--limit
int = 20
Maximum number of results to return--query
string
Text query to match database titlesnotion database query
Query rows in a Notion databaseQuery rows in a Notion database or data source.
Returns page rows with their titles and properties. Use –query for simple text matching across titles/properties. Use –filter and –sort for advanced queries (raw Notion query JSON).
--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 JSONnotion doctor
Run Notion adapter diagnosticsnotion login
Store a Notion Personal Access TokenStore a Notion Personal Access Token (PAT) for the active profile.
This validates the PAT against the Notion REST API and caches the returned identity metadata.
--pat
string
read the Notion PAT from stdin when set to ---pat-env
string
read the Notion PAT from this environment variablenotion logout
Remove stored Notion credentialsnotion page
Work with Notion pagesGet and modify Notion pages.
Pages are referred to by local marker (p1), Notion URL, or UUID. Run database query or workspace search first to populate local page markers.
notion page create
Create a new Notion pageCreate a new Notion page within a database.
Use –body to append a paragraph block to the new page. Supports inline text, @file to read from a file, or - to read body from stdin (parent is always explicit). Creating child pages directly under top-level pages is not supported by the current Notion REST write path; create the page in a database contained by that 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 titlenotion page get
Get one or more Notion pages by refGet a Notion page by local marker, URL, or UUID.
Returns page metadata, parent information, and a block summary.
notion page list
List Notion pagesList Notion pages from the workspace, a database, or a parent page.
With no selector, this lists recent pages from workspace search. Use –database to list rows from a database. Use –parent-page to list direct child pages under a parent page. Use –query to narrow returned pages by title or property text.
--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)--query
string
Text query to match returned page titles and propertiesnotion page restore
Restore one or more Notion pages from trashRestore a Notion page from trash by local marker, URL, or UUID.
Use this only after selecting the exact trashed page ref.
--all
bool
Confirm batch page restore--yes
bool
Confirm batch page restorenotion page trash
Move one or more Notion pages to trashMove a Notion page to trash by local marker, URL, or UUID.
This is an idempotent operation. Trashed pages can be restored with notion page restore.
--all
bool
Confirm batch page trash--yes
bool
Confirm destructive batch page trashnotion page update
Update a Notion pageUpdate a Notion page title and optionally append body text.
Use –body to append a paragraph block to the page. Supports inline text, @file to read from a file, or - to read body from stdin (page ref must then be a positional argument — stdin cannot carry both the ref and body text).
--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 titlenotion profile
Manage provider profilesnotion profile create
Create an unauthenticated provider profilenotion profile delete
Delete a local provider profilenotion profile list
List provider profilesnotion profile rename
Rename a local provider profilenotion profile use
Set the default provider profilenotion resolve
Resolve a Notion local marker or shortened canonical referenceResolve a Notion short reference into its canonical payload.
Use this when you have a marker such as d1, p1, or b1, or a shortened canonical id, and want to inspect what it refers to.
Resolution is profile-scoped. If a marker does not resolve, verify –profile and rerun the relevant list command.
notion schema
Emit Notion adapter schema hintsShow schema hints for the Notion resource payloads emitted by this CLI.
Use this when you need to understand structured output fields for automation or downstream parsing.
--in
bool
Show input schema--input
bool
Show input schema--out
bool
Show output schemanotion version
Show notion version informationnotion workspace
Search and inspect the Notion workspaceSearch workspace content visible to the current Notion PAT.
Use workspace search when you need mixed page and database discovery before selecting a local ref.
notion workspace search
Search Notion for pages, databases, and data sourcesSearch the Notion workspace for pages, databases, and data sources matching a query.
Assigns local markers (p1, d1, ds1, …) for follow-up commands.
--in-trash
string
Filter by trash state: true or false--limit
int = 20
Maximum number of results to return--query
string
Search query text--type
string
Filter by type: page, database, or data-sourceplay_circle Live Examples
Output captured from a real workspace. Regenerate with
scripts/gen-docs.sh --update.
auth
Authenticated as kestrelphilip@gmail.com Next steps: - Pages: notion page list --limit 10 - Databases: notion database list --limit 10 - Capabilities: notion capabilities - Schema: notion schema
databases
REF SOURCE_REFS WHEN d1 ds1 Fri 24 Apr 16:31 d2 ds2 Wed 15 Apr 10:27 d3 ds3 Wed 15 Apr 09:28 Next steps: - Open: notion database get d1 - Pages: notion page list --limit 10 - Databases: notion database list --limit 10 - Capabilities: notion capabilities
pages
blocks
search
No search found. Next steps: - Pages: notion page list --limit 10 - Databases: notion database list --limit 10 - Capabilities: notion capabilities - Schema: notion schema
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 --jsonl \
| notion page get
