notion-cli

Manage Notion pages, databases, blocks, comments, and files from the terminal via the Notion API.

3|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/ZHLX2005/sl --skill notion-cli-zhlx2005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: notion-cli
Source: https://github.com/ZHLX2005/sl/tree/main/skills/notion-cli
Command: npx skills add https://github.com/ZHLX2005/sl --skill notion-cli-zhlx2005

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with Notion programmatically usually requires writing custom API scripts for every task. This Skill provides a single CLI covering the entire Notion API, so you can read, create, update, query, and organize workspace content directly from the terminal or from agent workflows. ## Core Features & Use Cases - Full API Coverage: 50+ commands for pages, databases, blocks, comments, users, and file uploads, with a raw notion api escape hatch for anything else. - Agent-Friendly Output: Pretty tables in the terminal and automatic JSON when piped, so results can flow into jq or other tools. - Markdown Round-Trips: Dump whole pages to markdown with page markdown and replace or patch content with page set-markdown, including append and range-based edits. - Use Case: Query a database for all tasks with Status=Todo, export the results to CSV, then append a summary block to a weekly report page — all in three commands. ## Quick Start Ask the AI to use the notion CLI to search your workspace for a page, view its content, and then create a new page or database row based on what it finds.

Frequently Asked Questions about notion-cli

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

FAQPage Schema
How do I query a Notion database from the command line?

Use `notion db query <id>` with filter flags like `-F 'Status=Done'` and sort flags like `-s 'Date:desc'`. Property types are auto-detected from the schema, and `--format json` lets you pipe results into jq.

How to create a Notion page from the terminal?

Run `notion page create <parent> --title "X" --body "content"` for a regular page, or pass a database id with `--db "Name=Review" "Status=Todo"` to add a database row. Note that internal integrations cannot create workspace-root pages; share a parent page first.

Does the notion CLI support markdown export and import?

Yes. `notion page markdown <id>` renders a full page to markdown using the server-side renderer, and `notion page set-markdown <id> --file new.md` replaces or patches page content, including append and range-based edits.

Why does my Notion page property show truncated values?

Relation and rollup properties with more than 25 items get truncated in `page view` and `page props`. Use `notion page property <id> <prop-id>` to fetch the fully paginated value of a single property.

Can I upload files and images to Notion from the CLI?

Yes. `notion file upload` accepts local paths, URLs, or stdin, and `notion block append <page> --image-file ./chart.png` uploads and embeds media in one step. Image, file, video, audio, and pdf block types are supported.