npx skills add ...
npx skills add nousresearch/hermes-agent --skill notion
Notion API + ntn CLI: pages, databases, markdown, Workers.
npx skills add nousresearch/hermes-agent --skill notion
Talk to Notion two ways. Same integration token works for both — pick by what's available.
◆ ntn CLI — Notion's official CLI. Shorter syntax, one-line file uploads, required for Workers. macOS + Linux only as of May 2026 (Windows support "coming soon"). Default when installed.
◆ HTTP + curl — works everywhere including Windows. Default fallback when ntn isn't installed.
ntn_ or secret_)${HERMES_HOME:-~/.hermes}/.env:
... → Connect to → your integration name. Without this, the API returns 404 for that page even though it exists.ntn (preferred path on macOS / Linux)Skip ntn login — use the integration token instead. This works headlessly, no browser needed:
Add those exports to your shell profile (or to ${HERMES_HOME:-~/.hermes}/.env) so every session inherits them.
Windows users: skip step 2 entirely until native ntn ships — Path B works fine. If you want CLI ergonomics now, install ntn inside WSL2.
Notion-Version: 2025-09-03 is required on all HTTP requests. ntn handles this for you. In this version, what users call "databases" are called data sources in the API.
ntn CLI (preferred, macOS / Linux)Syntax notes:
key=value — string fieldskey[nested]=value — nested object fieldskey:=value — typed assignment (booleans, numbers, null, arrays)For complex queries with sorts, multiple filter clauses, or compound logic, pipe JSON in:
Compare to the 3-step HTTP flow (create upload → PUT bytes → reference).
| Var | Effect |
|---|---|
NOTION_API_TOKEN | Auth token (overrides keychain) — set this to your integration token |
NOTION_KEYRING=0 | File-based creds at ~/.config/notion/auth.json instead of OS keychain |
NOTION_WORKSPACE_ID | Skip the workspace picker prompt |
All requests share this pattern:
On Windows the curl shipped with Windows 10+ works as-is. PowerShell users can also use Invoke-RestMethod.
Easier to feed to a model than block JSON.
POST /v1/pages accepts a markdown body param.
Common property formats for database items:
{"title": [{"text": {"content": "..."}}]}{"rich_text": [{"text": {"content": "..."}}]}{"select": {"name": "Option"}}{"multi_select": [{"name": "A"}, {"name": "B"}]}{"date": {"start": "2026-01-15", "end": "2026-01-16"}}{"checkbox": true}{"number": 42}{"url": "https://..."}{"email": "user@example.com"}{"relation": [{"id": "page_id"}]}/data_sources/ endpoints for queries and retrieval.database_id and data_source_id.
database_id when creating pages: parent: {"database_id": "..."}data_source_id when querying: POST /v1/data_sources/{id}/query"object": "data_source" with the data_source_id field.ntn)Workers are TypeScript programs Notion hosts for you. One worker can expose any combination of:
Plan / platform gating:
ntn is macOS/Linux only as of May 2026. Windows users need WSL2 or to wait for native support.src/index.ts:
After deploy: ntn workers webhooks list shows the URL Notion generates. Treat that URL as a secret — anyone with it can POST events unless you add signature verification.
When asked to build a Worker, scaffold with ntn workers new, write the code in src/index.ts, set any secrets with ntn workers env set, and deploy. Notion's docs at https://developers.notion.com/workers cover the full API surface.
/markdown endpoints)Standard CommonMark plus XML-like tags for Notion-specific blocks. Use tabs for indentation.
Blocks beyond CommonMark:
Inline:
<mention-user url="..."/>, <mention-page url="...">Title</mention-page>, <mention-date start="2026-05-15"/><span underline="true">text</span><span color="blue">text</span> or block-level {color="blue"} on the first line$x^2$, block $$ ... $$[^https://example.com]Colors: gray brown orange yellow green blue purple pink red, plus *_bg variants for backgrounds.
Headings 5/6 collapse to H4. Multiple > lines render as separate quote blocks — use <br> inside a single > for multi-line quotes.
| Task | mac / Linux | Windows |
|---|---|---|
| Read/write pages, search, query databases | ntn api ... | curl |
| Read a page for an agent to summarize | ntn api v1/pages/{id}/markdown | curl /markdown endpoint |
| Upload a file | ntn files create < file | 3-step HTTP flow |
| One-off API exploration | ntn api ... | curl |
| Build a sync / webhook / agent tool hosted by Notion | ntn workers ... | WSL2 + ntn workers ... |
"is_inline": true when creating data sources to embed them in a page.-s to curl to suppress progress bars (cleaner agent output).jq when reading: ... | jq '.results[0].properties'.Notion MCP, ~91% more token-efficient on DB ops than the previous version) — wire it via Hermes' MCP support if you want streaming Notion access from inside a session, but the paths above are enough for most one-shot tasks.