notion-cli
makenotion/skills
CLI tool to interact with Notion API, manage workers, and upload files.
What is notion-cli?
The Notion CLI (`ntn`) provides command-line access to the Notion API for creating pages, querying databases, uploading files, and deploying workers. Use it when you need to automate Notion tasks or integrate Notion into scripts and workflows.
- Query and call any Notion API endpoint via `ntn api` with automatic method inference
- Create and update Notion pages with Markdown-formatted content
- Upload files to Notion and manage file uploads
- Deploy and manage Notion workers (serverless functions)
- Retrieve page content as Markdown for reading and processing
- List available API endpoints and view endpoint documentation
How to install notion-cli
npx skills add https://github.com/makenotion/skills --skill notion-cli- Notion API token (set as `NOTION_API_TOKEN` environment variable or obtained via `ntn login`)
How to use notion-cli
- 1.Install the CLI by running `curl -fsSL https://ntn.dev | bash`
- 2.Set up authentication by either exporting `NOTION_API_TOKEN` or running `ntn login`
- 3.Run `ntn api ls` to list all available API endpoints
- 4.Use `ntn api <path> --help` to view documentation and syntax for specific endpoints
- 5.Execute API calls with `ntn api` (e.g., `ntn api v1/pages parent[page_id]=abc123`)
- 6.For page operations, use `ntn pages create` or `ntn pages update` with Markdown content
- 7.Upload files with `ntn files create` and manage them with `ntn files list` / `ntn files get`
- 8.Deploy workers with `ntn workers new` to scaffold and `ntn workers deploy` to publish
Use cases
- Automate page creation and database queries in Notion workspaces
- Upload images or documents to Notion programmatically
- Deploy custom Notion workers for scheduled tasks or integrations
- Query the Notion API directly from scripts without writing HTTP clients
- Read and process Notion page content in automation workflows
- Backend developers building Notion integrations
- DevOps engineers automating Notion workspace management
- Automation engineers creating scripts that interact with Notion
- Anyone building tools or workflows that need Notion API access
notion-cli FAQ
Run `ntn api ls` to list all endpoints, then use `ntn api <path> --help` to see methods and usage. Use `ntn api <path> --spec` to view the OpenAPI schema for request/response details.
Set the `NOTION_API_TOKEN` environment variable if you have a token. Otherwise, run `ntn login` which will open a browser for authentication. The CLI automatically uses whichever is configured.
Yes, use `ntn pages create` with the `--content` flag and pass Markdown-formatted text. The CLI supports bold, italic, code, links, and other inline formatting via Markdown.
Use `ntn files create` to upload a local file (pipe with `<`) or `ntn files create --external-url <url>` to reference an external file. List uploads with `ntn files list`.
Notion workers are serverless functions you can deploy to Notion. Use `ntn workers new <name>` to scaffold a project, then `ntn workers deploy` to publish it. Run `ntn workers exec <capability>` to test execution.
Full instructions (SKILL.md)
Source of truth, from makenotion/skills.
name: notion-cli
description: >-
Use the Notion CLI (ntn) to interact with the Notion API, manage workers,
and upload files. Use when the user asks to "call the Notion API", "deploy a
worker", "upload a file to Notion", "create a page", "query a database", or
any task involving the ntn command.
Notion CLI
Look things up before answering
The CLI is self-documenting. Always prefer running these commands over guessing syntax or relying on memorized knowledge:
ntn api ls— list every public API endpoint.ntn api <path> --help— show methods, doc links, and usage for an endpoint.ntn api <path> --docs— print the full official docs for an endpoint.ntn api <path> --spec— print a reduced OpenAPI fragment (useful for understanding request/response schemas).ntn pages get <page-id>— retrieve a page as Markdown. Use this to read page content.ntn <command> --help— help for any command or subcommand.
Install
curl -fsSL https://ntn.dev | bash
Authentication
- The CLI automatically uses
NOTION_API_TOKENwhen it is set. - Check
NOTION_API_TOKENfirst. If it is already set, prefer using it instead of telling the user to runntn login. ntn login/ntn logout— log the CLI in or out (only use if not usingNOTION_API_TOKEN).ntn loginrequires the user to visit a URL in a web browser.
ntn api
Run ntn api --help for full syntax. Quick summary:
# GET with query param
ntn api v1/users page_size==100
# POST with inline body fields
ntn api v1/pages parent[page_id]=abc123
# POST with JSON body
ntn api v1/pages -d '{"parent":{"page_id":"abc123"}}'
The method is inferred (GET by default, POST when a body is present). Override
with -X METHOD.
Markdown for pages and comments
Prefer ntn pages create / ntn pages update for Markdown page content. Use
the markdown field when creating or updating comments via ntn api.
# Comment with markdown
ntn api v1/comments -d '{"parent":{"page_id":"abc123"},"markdown":"Here is a [link](https://example.com) and **bold text**."}'
# Page with markdown body
ntn pages create --parent page:abc123 --content '## Heading\n\nSome *formatted* content.'
The markdown field supports inline formatting (bold, italic, code, links, etc.).
Only fall back to rich_text if you need features that Markdown cannot express (e.g. mentions, custom emoji, or colors).
ntn files
Convenience wrapper around the File Uploads API.
ntn files create < image.png
ntn files create --external-url https://example.com/photo.png
ntn files list
ntn files get <upload-id>
ntn workers
Manage Notion workers (deploy, list, execute, etc.). Run ntn workers --help
for subcommands.
ntn workers new my-worker # scaffold a new project
ntn workers deploy # deploy from current directory
ntn workers ls # list workers
ntn workers exec <capability> # execute a capability
Related skills
More from makenotion/skills and the wider catalog.
find-skills
Discover and install agent skills to extend your coding agent's capabilities on demand
frontend-design
Build visually distinctive UI with opinionated aesthetic direction, typography, and layout choices that avoid templated defaults.
vercel-react-best-practices
70 React/Next.js performance rules from Vercel Engineering, prioritized by impact for writing, reviewing, and refactoring code.
agent-browser
Fast browser automation CLI for AI agents — navigate, click, scrape, screenshot, and test via Chrome CDP
web-design-guidelines
Review UI code against Web Interface Guidelines for accessibility, UX, and design best practices
finetuning
Fine-tune models on Azure AI Foundry with SFT, DPO, or RFT training methods.