notion-cli-agentAccess and manage your Notion workspace via a CLI to search, create, update, and delete pages, databases, blocks, users, and comments with multiple output fo...
Install via ClawdBot CLI:
clawdbot install FroeMic/notion-cli-agentnotion-cli
Interact with your Notion workspace via the notion-cli.
A production-grade CLI for the Notion API that supports searching, creating and managing pages, databases, blocks, users, and comments with multiple output formats (JSON, table, CSV).
Install
Clone and install the CLI:
git clone https://github.com/FroeMic/notion-cli
cd notion-cli
npm install
npm run build
npm link
Set NOTION_API_KEY environment variable:
ntn_ or secret_)~/.claude/.env for Claude Code~/.bashrc or ~/.zshrc: export NOTION_API_KEY="your-api-key"Optional: Set NOTION_DEBUG=true for verbose request/response logging.
Repository: https://github.com/FroeMic/notion-cli
Commands
Search across your workspace:
notion search [query] # Search pages, databases, and data sources
notion search [query] --filter page # Search only pages
notion search [query] --filter database # Search only databases
notion search [query] --sort ascending # Sort by last edited time
Work with pages:
notion pages get <page-id> # Get page details
notion pages create --parent <id> --title <text> # Create a new page
notion pages update <page-id> --properties <json> # Update page properties
notion pages archive <page-id> # Archive a page
notion pages restore <page-id> # Restore an archived page
notion pages property <page-id> <property-id> # Get a specific property value
Work with databases:
notion databases get <database-id> # Get database schema
notion databases create --parent <id> --title <text> # Create a database
notion databases update <database-id> --title <text> # Update database metadata
notion databases query <data-source-id> # Query records in a data source
notion databases query <id> --filter <json> # Query with filters
notion databases query <id> --sort <json> # Query with sorting
Work with blocks (page content):
notion blocks get <block-id> # Get a block
notion blocks children <block-id> # List child blocks
notion blocks append <block-id> --content <json> # Append new blocks
notion blocks update <block-id> --content <json> # Update a block
notion blocks delete <block-id> # Delete a block
Work with users:
notion users list # List workspace members
notion users get <user-id> # Get user details
notion users me # Get the authenticated bot user
Work with comments:
notion comments list --block <block-id> # List comments on a block
notion comments create --page <page-id> --content <text> # Add a comment to a page
Global options (available on all commands):
--api-key <key> # Override NOTION_API_KEY env var
-f, --format <fmt> # Output format: json (default), table, csv
--limit <n> # Max results to return
--cursor <cursor> # Pagination cursor
Key Concepts
| Concept | Purpose | Example |
|-------------|--------------------------------------|------------------------------------------|
| Pages | Individual Notion pages | A meeting note, a project brief |
| Databases | Structured collections of pages | A task tracker, a CRM table |
| Data Sources| Individual tables within a database | A specific view/table in a database |
| Blocks | Content elements within a page | Paragraphs, headings, lists, code blocks |
| Properties | Typed fields on database pages | Title, status, date, select, relation |
| Users | Workspace members and integrations | Team members, bot integrations |
| Comments | Discussion threads on pages/blocks | Feedback, review notes |
API Reference
https://api.notion.com/v12022-06-28Authorization: Bearer $NOTION_API_KEYCommon API Operations
Search for a page:
curl -X POST https://api.notion.com/v1/search \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"query": "Meeting Notes", "filter": {"value": "page", "property": "object"}}'
Query a database with filters:
curl -X POST https://api.notion.com/v1/databases/<database-id>/query \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"filter": {"property": "Status", "status": {"equals": "In Progress"}}}'
Create a page in a database:
curl -X POST https://api.notion.com/v1/pages \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"parent": {"database_id": "<database-id>"}, "properties": {"Name": {"title": [{"text": {"content": "New Task"}}]}}}'
Append content to a page:
curl -X PATCH https://api.notion.com/v1/blocks/<block-id>/children \
-H "Authorization: Bearer $NOTION_API_KEY" \
-H "Notion-Version: 2022-06-28" \
-H "Content-Type: application/json" \
-d '{"children": [{"object": "block", "type": "paragraph", "paragraph": {"rich_text": [{"type": "text", "text": {"content": "Hello world"}}]}}]}'
Notes
--limit and --cursor.json (default), table, or csv with the -f flag.Files
1 total
Generated Mar 1, 2026
Automatically create and update project pages in Notion from external tools like Jira or GitHub. Use the CLI to query databases for task statuses and generate reports, enabling seamless synchronization of project data across platforms.
Schedule and track content creation workflows by using the CLI to search for pages, update properties like publish dates, and append blocks with new content drafts. This streamlines editorial processes for marketing teams.
Maintain a CRM database in Notion by creating new customer pages, updating contact details via properties, and querying records based on filters like deal stage. This helps sales teams manage leads efficiently.
Organize research notes and references by using the CLI to search for pages, create databases for literature reviews, and append blocks with annotations. This aids researchers in structuring their work systematically.
Set up a personal task tracker by creating databases for to-do lists, updating task statuses, and archiving completed items. Use the CLI to query tasks by priority or due date for daily planning.
Offer a free tier with basic CLI features like search and page retrieval, while charging for advanced capabilities such as automated workflows, bulk operations, and premium support. This attracts individual users and scales with enterprise needs.
Provide tailored solutions by using the CLI to integrate Notion with clients' existing systems, such as CRM or ERP software. Charge for setup, training, and ongoing maintenance to help businesses optimize their workflows.
Develop a service where agencies use the CLI to automate content updates, manage client databases, and generate reports. Monetize by offering managed packages that include CLI usage, analytics, and regular performance reviews.
💬 Integration Tip
Set the NOTION_API_KEY in a secure environment file like ~/.claude/.env to avoid exposing credentials, and use the --format json option for easier parsing in automated scripts.
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
Command-line tool to manage Google Workspace services including Gmail, Calendar, Drive, Sheets, Docs, Slides, Contacts, Tasks, People, Groups, and Keep.
Runs shell commands inside a dedicated tmux session named claw, captures, and returns the output, with safety checks for destructive commands.
A modern text-based browser. Renders web pages in the terminal using headless Firefox.
Write robust, portable shell scripts. Use when parsing arguments, handling errors properly, writing POSIX-compatible scripts, managing temp files, running commands in parallel, managing background processes, or adding --help to scripts.
NotebookLM CLI wrapper via `node {baseDir}/scripts/notebooklm.mjs`. Use for auth, notebooks, chat, sources, notes, sharing, research, and artifact generation/download.