/notion/.
For API key setup, see Notion Setup.
Config
Filesystem Layout
pages/ hierarchy mirrors Notion’s standalone page tree. The
databases/ hierarchy lists databases shared with the integration and
then the row pages returned by querying each database. Each database
directory contains database.json with the database metadata and its
typed property schema (the columns), but not the rows themselves; the
rows are the row-page directories alongside it, so ls the database
directory to enumerate them. Each page directory contains a page.json
file with the page metadata and content. Child pages appear as nested
directories.
page.json carries the page metadata (page_id, title, url,
timestamps, parent_type/parent_id, created_by/last_edited_by),
a markdown field with the page body rendered as Markdown, and the raw
blocks. Blocks with children embed them recursively under a
children key, and the Markdown renders nested blocks with
indentation.
database.json carries the database metadata (database_id, title,
url, timestamps, parent, archived, is_inline) and properties,
the database’s typed column schema. It does not embed the rows; read a
row’s page.json for its content, since a database row is itself a page
with parent_type of database_id.
database.json
The database’s identity plus its typed column schema (Notion’s own property objects), with no rows inline.ls the database directory to
enumerate row pages:
ntn pages create with a database_id parent and a
properties object whose keys match this schema.
page.json
A page (including a database row). Notion blocks render tomarkdown
and stay available raw under blocks:
Cache
UsesIndexCacheStore for page metadata. No separate content
cache - file content caching is handled by the workspace IOResult
mechanism.
Example
Shell Commands
Standard commands available on the mounted Notion tree:
Acting on Notion (creating and editing pages, appending blocks,
comments, search) goes through the ntn CLI when
installed. Use the
<page-id>/<database-id> from a path segment as
the --page, --block, or --datasource value.