| name | notion |
| description | Interact with Notion workspaces via the notion CLI. Use for managing pages, databases, blocks, search, and users. Supports markdown import/export, batch operations, and smart property updates. Triggered by mentions of Notion, notion-cli, workspace, pages, databases, or knowledge base operations. |
| license | MIT |
| homepage | https://github.com/dedene/notion-cli |
| metadata | {"author":"dedene","version":"0.1.0","openclaw":{"primaryEnv":"NOTION_TOKEN","requires":{"env":["NOTION_TOKEN"],"bins":["notion"]},"install":[{"kind":"brew","tap":"dedene/tap","formula":"notion","bins":["notion"]},{"kind":"go","package":"github.com/dedene/notion-cli/cmd/notion","bins":["notion"]}]}} |
Notion CLI Skill
Agent skill for interacting with Notion workspaces via the notion-cli.
Prerequisites
notion CLI installed and in PATH
- NOTION_TOKEN environment variable set, OR
- Authenticated profile via
notion auth add
Available Commands
Pages
notion pages list - List all accessible pages
notion pages get <id> - Get page by ID
notion pages create --parent=<id> --title="..." - Create page
notion pages update <id> --set name=value - Update properties
notion pages archive <id> - Archive page
notion pages append-md <id> - Append markdown (pipe to stdin)
notion pages export-md <id> - Export page as markdown
Databases
notion databases list - List all databases
notion databases get <id> - Get database schema
notion databases query <id> --filter='{"property":"..."}' - Query rows
notion databases create-page <db-id> --title="..." -p key=value - Create row
Blocks
notion blocks list <parent-id> - List child blocks
notion blocks append <parent-id> --blocks-file=blocks.json - Append blocks
notion blocks delete <id> - Delete block
Search
notion search "query" --type=page|database - Search workspace
Users
notion users list - List workspace users
notion users me - Get current bot user
Batch Operations
notion batch - Execute JSONL commands from stdin
Output Modes
- Default: Human-readable tables
--json: Structured JSON output (recommended for agents)
--plain: TSV output for scripting
Filtering with --where
The --where flag (-w) provides an expressive query syntax for filtering.
Syntax: Property.condition(value)
| Category | Examples |
|---|
| Equality | Status.eq(Done), Status.neq(Todo) |
| Text | Name.contains(Meeting), Name.starts_with(2024) |
| Relations | Project.contains(<uuid>) |
| Numbers | Count.gt(5), Count.lte(100) |
| Dates | Due.before(2024-12-31), Due.this_week() |
| Checkbox | Published.is(true) |
| Empty | Assignee.is_empty(), Notes.is_not_empty() |
Conditions Reference
| Condition | Aliases | Use for |
|---|
eq | equals, is | status, select, text |
neq | not_equals, isnt | status, select, text |
contains | has, includes | relation, multi_select, text |
not_contains | excludes | relation, multi_select, text |
gt, gte, lt, lte | greater_than, etc. | number |
before, after | - | date |
on_or_before, on_or_after | - | date |
this_week, past_month, next_week | - | date |
is_empty, is_not_empty | empty, exists | any |
starts_with, ends_with | - | text |
Multiple --where = AND
notion pages list -d $DB -w "Status.eq(Done)" -w "Priority.eq(High)"
Type Override
When type inference fails, prefix with type:
notion pages list -d $DB -w "select:Category.eq(Work)"
notion pages list -d $DB -w "text:Name.contains(draft)"
Examples
List pages from a database with filters
notion databases list
notion pages list -d <data-source-id> -w "Status.eq(Done)" --json
notion pages list -d <data-source-id> -w "Status.eq(In Progress)" -w "Priority.eq(High)"
notion pages list -d <data-source-id> -w "Due.this_week()"
notion pages list -d <data-source-id> -w "Project.contains(<project-uuid>)"
Create a page with content
echo "# Hello World\n\nThis is a test." | notion pages append-md <page-id>
Query database with JSON filter (advanced)
notion databases query <db-id> --filter='{"property":"Status","status":{"equals":"Done"}}' --json
Batch operations
cat <<EOF | notion batch --json
{"cmd":"pages.create","args":{"parent":"...","title":"Page 1"}}
{"cmd":"pages.create","args":{"parent":"...","title":"Page 2"}}
EOF
Tips for AI Agents
- Always use
--json for structured, parseable output
- Use batch operations for multiple related actions
- Cache database schemas to reduce API calls
- Rate limit: 3 req/sec - batch operations handle this automatically