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.
Agent skill for interacting with Notion workspaces via the notion-cli.
notion CLI installed and in PATHnotion auth addnotion pages list - List all accessible pagesnotion pages get <id> - Get page by IDnotion pages create --parent=<id> --title="..." - Create pagenotion pages update <id> --set name=value - Update propertiesnotion pages archive <id> - Archive pagenotion pages append-md <id> - Append markdown (pipe to stdin)notion pages export-md <id> - Export page as markdownnotion databases list - List all databasesnotion databases get <id> - Get database schemanotion databases query <id> --filter='{"property":"..."}' - Query rowsnotion databases create-page <db-id> --title="..." -p key=value - Create rownotion blocks list <parent-id> - List child blocksnotion blocks append <parent-id> --blocks-file=blocks.json - Append blocksnotion blocks delete <id> - Delete blocknotion search "query" --type=page|database - Search workspacenotion users list - List workspace usersnotion users me - Get current bot usernotion batch - Execute JSONL commands from stdin--json: Structured JSON output (recommended for agents)--plain: TSV output for scriptingThe --where flag (-w) provides an expressive query syntax for filtering.
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() |
| 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 |
notion pages list -d $DB -w "Status.eq(Done)" -w "Priority.eq(High)"
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)"
# Get data source ID first
notion databases list
# Query with simple filter
notion pages list -d <data-source-id> -w "Status.eq(Done)" --json
# Multiple filters (AND)
notion pages list -d <data-source-id> -w "Status.eq(In Progress)" -w "Priority.eq(High)"
# Date filter
notion pages list -d <data-source-id> -w "Due.this_week()"
# Relation filter
notion pages list -d <data-source-id> -w "Project.contains(<project-uuid>)"
echo "# Hello World\n\nThis is a test." | notion pages append-md <page-id>
notion databases query <db-id> --filter='{"property":"Status","status":{"equals":"Done"}}' --json
cat <<EOF | notion batch --json
{"cmd":"pages.create","args":{"parent":"...","title":"Page 1"}}
{"cmd":"pages.create","args":{"parent":"...","title":"Page 2"}}
EOF
--json for structured, parseable output