notion-cli
Notion CLI for creating and managing pages, databases, and blocks.
What this skill does
# notion
Use *notion-cli* to create/read/update pages, data sources (databases), and blocks.
## Setup
- Install notion-cli: `npm install -g @iansinnott/notion-cli`
- Create an integration at https://notion.so/my-integrations
- Copy the API key (starts with *ntn_* or *secret_*)
- Store it:
- `mkdir -p ~/.config/notion`
- `echo "ntn_your_key_here" > ~/.config/notion/api_key`
- Share target pages/databases with your integration (click "..." → "Connect to" → your integration name)
## Usage
All commands require the *NOTION_TOKEN* environment variable to be set:
```bash
export NOTION_TOKEN=$(cat ~/.config/notion/api_key)
```
## Common Operations
- **Search for pages and data sources:**
`notion-cli search --query "page title"`
- **Get page:**
`notion-cli page retrieve <PAGE_ID>`
- **Get page content (blocks):**
`notion-cli page retrieve <PAGE_ID> -r`
- **Create page in a database:**
```bash
curl -X POST https://api.notion.com/v1/pages \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Content-Type: application/json" \
-H "Notion-Version: 2025-09-03" \
--data '{
"parent": { "database_id": "YOUR_DATABASE_ID" },
"properties": {
"Name": {
"title": [
{
"text": {
"content": "Nouvelle idée"
}
}
]
}
}
}'
```
- **Query a database:**
`notion-cli db query <DB_ID> -a '{"property":"Status","status":{"equals":"Active"}}'`
- **Update page properties:**
```bash
curl -X PATCH https://api.notion.com/v1/pages/PAGE_ID \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Content-Type: application/json" \
-H "Notion-Version: 2025-09-03" \
--data '{
"properties": {
"Name": {
"title": [
{
"text": {
"content": "Nouveau titre"
}
}
]
},
"Status": {
"status": {
"name": "In progress"
}
},
"Priority": {
"select": {
"name": "High"
}
},
"Due date": {
"date": {
"start": "2026-02-10"
}
},
"Description": {
"rich_text": [
{
"text": {
"content": "Description mise à jour"
}
}
]
}
}
}'
```
- **Get database info:**
`notion-cli db retrieve <DB_ID>`
## Property Types
Common property formats for database items:
- **Title:** `{"title": [{"text": {"content": "..."}}]}`
- **Rich text:** `{"rich_text": [{"text": {"content": "..."}}]}`
- **Status:** `{"status": {"name": "Option"}}`
- **Select:** `{"select": {"name": "Option"}}`
- **Multi-select:** `{"multi_select": [{"name": "A"}, {"name": "B"}]}`
- **Date:** `{"date": {"start": "2024-01-15", "end": "2024-01-16"}}`
- **Checkbox:** `{"checkbox": true}`
- **Number:** `{"number": 42}`
- **URL:** `{"url": "https://..."}`
- **Email:** `{"email": "[email protected]"}`
## Examples
- **Search for pages:**
`notion-cli search --query "AIStories"`
- **Query database with filter:**
```bash
notion-cli db query 2faf172c094981d3bbcbe0f115457cda \
-a '{
"property": "Status",
"status": { "equals": "Backlog" }
}'
```
- **Retrieve page content:**
`notion-cli page retrieve 2fdf172c-0949-80dd-b83b-c1df0410d91b -r`
- **Update page status:**
```bash
curl -X PATCH https://api.notion.com/v1/pages/2fdf172c-0949-80dd-b83b-c1df0410d91b \
-H "Authorization: Bearer $NOTION_TOKEN" \
-H "Content-Type: application/json" \
-H "Notion-Version: 2025-09-03" \
--data '{
"properties": {
"Status": {
"status": {
"name": "In progress"
}
}
}
}'
```
## Key Features
- *Interactive mode:* For complex queries, run `notion-cli db query <DB_ID>` without arguments to enter interactive mode
- *Multiple output formats:* table (default), csv, json, yaml
- *Raw JSON:* Use `--raw` flag for complete API responses
- *Filter syntax:* Use `-a` flag for complex filters with AND/OR conditions
## Notes
- Page/database IDs are UUIDs (with or without dashes)
- The CLI handles authentication automatically via *NOTION_TOKEN*
- Rate limits are managed by the CLI
- Use `notion-cli help` for complete command reference
## References
- GitHub Notion-CLI: https://github.com/litencatt/notion-cli
- Notion API Documentation: https://developers.notion.com
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.