notion-cli

Interact with the Notion API, manage workers, and upload files using the ntn CLI.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/joydai2026-del/skills --skill notion-cli-joydai2026-del
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: notion-cli
Source: https://github.com/joydai2026-del/skills/tree/main/notion-cli
Command: npx skills add https://github.com/joydai2026-del/skills --skill notion-cli-joydai2026-del

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with the Notion API from an agent or terminal requires knowing exact endpoint syntax, request shapes, and several non-obvious traps (full-replace page updates, data source IDs, typed body parameters). This Skill teaches the self-documenting ntn CLI so tasks like creating pages, querying databases, uploading files, and deploying workers succeed on the first attempt. ## Core Features & Use Cases - API discovery and calls: List endpoints, read docs and OpenAPI fragments, and issue GET/POST requests with correct argument order and typed := body fields. - Page and database operations: Create and update pages with Markdown content, create databases with initial data sources, and add rows against the correct data source ID. - Files and workers: Upload files via the File Uploads API wrapper and scaffold, deploy, list, and execute Notion workers. - Trap avoidance: Built-in guidance for full-replace updates on pages with children, non-interactive --yes confirmation, slow large-page updates, and safe trash-and-recreate ordering. - Use Case: Ask the agent to create a Notion database under a parent page, populate it with rows that have Markdown bodies, and attach an uploaded image, all through ntn commands. ## Quick Start Ask the agent to use the ntn CLI to create a new Notion page under a given parent page with Markdown content, after setting the NOTION_API_TOKEN environment variable.

Frequently Asked Questions about notion-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call the Notion API from the command line?▼

Use the ntn CLI with the form `ntn api <path> -X <METHOD> -d '<json>'`. The method is inferred (GET by default, POST when a body is present), and you can run `ntn api ls` and `ntn api <path> --docs` to discover endpoints and syntax.

How do I create a Notion page with Markdown content?▼

Run `ntn pages create --parent page:<id> --content '...'` to create a page with Markdown body text. For comments, pass a `markdown` field in the JSON body of `ntn api v1/comments` instead of building rich_text manually.

Why does ntn pages update fail with child pages or databases?▼

The update is a full replace and refuses when the page has child pages or databases to prevent data loss. Save the children locally, trash them, update the parent, then recreate the database and rows rather than using --allow-deleting-content.

How do I add rows to a Notion database via the API?▼

Create the database with POST /v1/databases including initial_data_source.properties, then create rows with parent set to the data source ID from data_sources[0].id, not the database ID. Using the database ID for rows fails.

Why does ntn api reject numbers in the request body?▼

Plain `param=value` always sends a string, so numeric fields fail validation. Use `param:=value` for typed numbers and booleans in POST bodies, and `==` for query-string parameters on GET requests.

Does the ntn CLI need interactive login?▼

Not if NOTION_API_TOKEN is set, since the CLI uses it automatically. Only run `ntn login`, which requires visiting a URL in a browser, when the environment variable is unavailable.