@andrzejchm/notion-cli 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -4
- package/dist/cli.js +302 -71
- package/dist/cli.js.map +1 -1
- package/docs/FEATURE-PARITY.md +20 -23
- package/docs/README.agents.md +60 -13
- package/docs/skills/using-notion-cli/SKILL.md +0 -2
- package/package.json +1 -1
package/docs/FEATURE-PARITY.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
> This document tracks gaps and serves as a prioritized roadmap for closing them.
|
|
5
5
|
|
|
6
6
|
**Legend:**
|
|
7
|
-
- **CLI** = `@andrzejchm/notion-cli` (this repo, v0.
|
|
7
|
+
- **CLI** = `@andrzejchm/notion-cli` (this repo, v0.9.0)
|
|
8
8
|
- **MCP** = Official Notion MCP server
|
|
9
9
|
|
|
10
10
|
---
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
|
|
14
14
|
| Area | CLI | MCP | Parity |
|
|
15
15
|
|------|-----|-----|--------|
|
|
16
|
-
| Search |
|
|
16
|
+
| Search | Keyword + sort by last edited | Semantic + AI + connected sources + date/creator filters | Partial |
|
|
17
17
|
| Page read | Markdown via API | Markdown + discussions + transcripts | Partial |
|
|
18
18
|
| Page create | Under pages only | Under pages, databases, data sources; batch; templates; icon/cover | Partial |
|
|
19
|
-
| Page edit |
|
|
19
|
+
| Page edit | Multi-op `--find`/`--replace`, `--range` | Search-and-replace (multi-op), full replace, template apply, verification | Partial |
|
|
20
20
|
| Page properties | Read + write via `update --prop` | Full read + write (update any property) | ✅ Parity |
|
|
21
21
|
| Move pages | - | Batch move to any parent | Gap |
|
|
22
22
|
| Duplicate pages | - | Duplicate with async content copy | Gap |
|
|
23
23
|
| Archive/delete | `archive` | Trash pages | ✅ Parity |
|
|
24
|
-
| Database create |
|
|
24
|
+
| Database create | `db create --prop` syntax | SQL DDL `CREATE TABLE` syntax | Partial |
|
|
25
25
|
| Database schema update | Read-only schema | `ADD/DROP/RENAME/ALTER COLUMN` via DDL | Gap |
|
|
26
26
|
| Database views | - | Create + update 10 view types with DSL | Gap |
|
|
27
|
-
| Comments | Page-level
|
|
27
|
+
| Comments | Page-level + block-level + thread replies, list with discussion IDs | Page-level + inline (selection-anchored) + reply to thread + rich text | Partial |
|
|
28
28
|
| Users | List all | List + search + fetch by ID + fetch self | Partial |
|
|
29
29
|
| Teams | - | List teamspaces + search | Gap |
|
|
30
30
|
| Create pages in DB | `create-page --parent <db>` with `--prop` | Full property support, date/place/checkbox expanded formats | ✅ Parity |
|
|
@@ -56,25 +56,23 @@ These gaps directly limit what an AI agent can accomplish through the CLI compar
|
|
|
56
56
|
**CLI:** `notion archive <id>` — archives (trashes) a page. Supports `--json` for full page output.
|
|
57
57
|
**Status:** Shipped in v0.9.0.
|
|
58
58
|
|
|
59
|
-
#### 4. Search filters (date range, creator)
|
|
59
|
+
#### 4. Search filters (date range, creator) — partially addressed
|
|
60
60
|
**MCP:** `created_date_range` (start/end dates), `created_by_user_ids` filter, scoped search within page/database/teamspace.
|
|
61
|
-
**CLI:** Keyword
|
|
62
|
-
**
|
|
63
|
-
**
|
|
61
|
+
**CLI:** Keyword search with `--type` filter and `--sort asc|desc` (sort by last edited time).
|
|
62
|
+
**Status:** `--sort` added in v0.9.0. Date range and creator filters are **blocked** — the MCP server uses an internal Notion API not accessible to integration tokens. The public search endpoint only supports `sort` as an additional parameter.
|
|
63
|
+
**Remaining gap:** `--created-after`, `--created-before`, `--created-by` cannot be implemented with the public API.
|
|
64
64
|
|
|
65
65
|
### Tier 2 - Medium Impact (power-user and advanced agent workflows)
|
|
66
66
|
|
|
67
|
-
#### 5. Inline / anchored comments
|
|
67
|
+
#### 5. Inline / anchored comments — partially shipped
|
|
68
68
|
**MCP:** `selection_with_ellipsis` targets a specific block; `discussion_id` replies to existing threads. Rich text with mentions, dates, links.
|
|
69
|
-
**CLI:**
|
|
70
|
-
**
|
|
71
|
-
**Suggested flags:** `notion comment <id> -m "text" --anchor "## Section...content"` / `--reply-to <discussion-id>`
|
|
69
|
+
**CLI:** Thread replies (`--reply-to <discussion-id>`) and block-level comments (`--block <block-id>`) shipped. Discussion IDs shown in `notion comments` list output. Inline text-selection anchoring is not available in the public API. Plain text only.
|
|
70
|
+
**Remaining gap:** Rich text (mentions, dates, links) and inline text-selection anchoring (`selection_with_ellipsis`) — the latter requires internal API access.
|
|
72
71
|
|
|
73
|
-
#### 6. Create databases
|
|
72
|
+
#### 6. ✅ Create databases (shipped v0.10.0)
|
|
74
73
|
**MCP:** `CREATE TABLE` DDL with full type system (select, relation, rollup, formula, unique_id, etc.).
|
|
75
|
-
**CLI:**
|
|
76
|
-
**
|
|
77
|
-
**Suggested command:** `notion create-db --parent <id> --title "Tasks" --schema "Name TITLE, Status SELECT(Todo,Done)"`
|
|
74
|
+
**CLI:** `notion db create --parent <id> --title "Tasks" --prop "Status:select:To Do,Done"` — supports title, rich_text, number, select, multi_select, status, date, checkbox, url, email, phone_number, people, files, created_time, last_edited_time. Relation, rollup, formula, and unique_id are not supported (too complex for CLI flags).
|
|
75
|
+
**Status:** Shipped in v0.10.0.
|
|
78
76
|
|
|
79
77
|
#### 7. Move pages
|
|
80
78
|
**MCP:** Batch move up to 100 pages/databases to a new parent (page, database, data source, or workspace).
|
|
@@ -88,11 +86,10 @@ These gaps directly limit what an AI agent can accomplish through the CLI compar
|
|
|
88
86
|
**Why:** Evolving database structure (adding a new status option, renaming a field) without leaving the terminal.
|
|
89
87
|
**Suggested command:** `notion db alter <id> --add "Priority SELECT(High,Medium,Low)" --rename "Status:Project Status"`
|
|
90
88
|
|
|
91
|
-
#### 9. Multi-operation content editing
|
|
89
|
+
#### 9. ✅ Multi-operation content editing (shipped v0.9.0)
|
|
92
90
|
**MCP:** `update_content` accepts an array of `{ old_str, new_str }` pairs (up to 100) in a single call, with `replace_all_matches` option.
|
|
93
|
-
**CLI:** `notion edit-page` supports
|
|
94
|
-
**
|
|
95
|
-
**Suggested approach:** Support multiple `--replace "old...new"` flags or a JSON patch file.
|
|
91
|
+
**CLI:** `notion edit-page` supports multiple `--find`/`--replace` pairs in a single invocation (PR #6).
|
|
92
|
+
**Status:** Shipped in v0.9.0.
|
|
96
93
|
|
|
97
94
|
#### 10. Duplicate pages
|
|
98
95
|
**MCP:** `duplicate-page` — async copy of any accessible page.
|
|
@@ -181,6 +178,6 @@ The CLI isn't just chasing MCP parity — it has unique strengths:
|
|
|
181
178
|
|
|
182
179
|
---
|
|
183
180
|
|
|
184
|
-
*Last updated: 2026-03-
|
|
185
|
-
*CLI version compared: 0.
|
|
181
|
+
*Last updated: 2026-03-24*
|
|
182
|
+
*CLI version compared: 0.9.0*
|
|
186
183
|
*MCP version compared: Official Notion MCP (2026-03)*
|
package/docs/README.agents.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# notion-cli for
|
|
1
|
+
# notion-cli for AI Coding Agents
|
|
2
2
|
|
|
3
|
-
Complete guide for using notion-cli with
|
|
3
|
+
Complete guide for using notion-cli with AI coding agents (Claude Code, OpenCode, Cursor, Windsurf, etc.).
|
|
4
4
|
|
|
5
5
|
## Quick Install
|
|
6
6
|
|
|
7
|
-
Tell
|
|
7
|
+
Tell your AI agent:
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
Fetch and follow instructions from https://raw.githubusercontent.com/andrzejchm/notion-cli/main/docs/README.agents.md
|
|
@@ -24,14 +24,17 @@ npm install -g @andrzejchm/notion-cli
|
|
|
24
24
|
|
|
25
25
|
Homebrew bundles Node.js automatically. npm requires Node.js ≥ 22.
|
|
26
26
|
|
|
27
|
-
### 2. Install the skill
|
|
27
|
+
### 2. Install the skill
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
The skill file teaches your AI agent how to use notion-cli. It follows the open [Agent Skills](https://agentskills.io) standard.
|
|
30
|
+
|
|
31
|
+
**Skill URL:**
|
|
32
|
+
```
|
|
33
|
+
https://raw.githubusercontent.com/andrzejchm/notion-cli/main/docs/skills/using-notion-cli/SKILL.md
|
|
33
34
|
```
|
|
34
35
|
|
|
36
|
+
**Agent:** Ask the user whether they want the skill installed **globally** (all projects) or **per-project**, then consult your own documentation for the correct skill install path. The skill directory name must be `using-notion-cli` and the file must be named `SKILL.md`.
|
|
37
|
+
|
|
35
38
|
### 3. Authenticate
|
|
36
39
|
|
|
37
40
|
**Interactive setup** (choose OAuth or integration token):
|
|
@@ -63,7 +66,7 @@ notion --version # CLI installed
|
|
|
63
66
|
notion ls # auth works
|
|
64
67
|
```
|
|
65
68
|
|
|
66
|
-
Restart
|
|
69
|
+
Restart your agent session after installing so it picks up the new skill.
|
|
67
70
|
|
|
68
71
|
## Updating
|
|
69
72
|
|
|
@@ -73,14 +76,33 @@ brew upgrade notion-cli
|
|
|
73
76
|
|
|
74
77
|
# npm
|
|
75
78
|
npm install -g @andrzejchm/notion-cli
|
|
76
|
-
|
|
77
|
-
# Update skill file (either install method)
|
|
78
|
-
curl -fsSL https://raw.githubusercontent.com/andrzejchm/notion-cli/main/docs/skills/using-notion-cli/SKILL.md \
|
|
79
|
-
-o ~/.config/opencode/skills/using-notion-cli/SKILL.md
|
|
80
79
|
```
|
|
81
80
|
|
|
81
|
+
To update the skill file, re-download it from the URL in step 2 to the same location.
|
|
82
|
+
|
|
82
83
|
## Commands Reference
|
|
83
84
|
|
|
85
|
+
### `notion search <query>` / `notion ls`
|
|
86
|
+
|
|
87
|
+
Search or list pages and databases. Both commands support:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Sort results by last edited time
|
|
91
|
+
notion search "meeting notes" --sort desc
|
|
92
|
+
notion ls --sort asc
|
|
93
|
+
|
|
94
|
+
# Filter by type
|
|
95
|
+
notion search "Q1" --type page
|
|
96
|
+
notion ls --type database
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
| Flag | Description |
|
|
100
|
+
|------|-------------|
|
|
101
|
+
| `--sort <asc\|desc>` | Sort by last edited time |
|
|
102
|
+
| `--type <page\|database>` | Filter by object type |
|
|
103
|
+
| `--cursor <cursor>` | Pagination cursor from a previous `--next` hint |
|
|
104
|
+
| `--json` | Force JSON output |
|
|
105
|
+
|
|
84
106
|
### `notion update <id|url>`
|
|
85
107
|
|
|
86
108
|
Update properties on any Notion page (standalone or database entry).
|
|
@@ -137,3 +159,28 @@ notion archive "$PAGE_ID" --json
|
|
|
137
159
|
```
|
|
138
160
|
|
|
139
161
|
Required integration capabilities: **Read content**, **Update content**
|
|
162
|
+
|
|
163
|
+
### `notion comment [id|url] -m <text>`
|
|
164
|
+
|
|
165
|
+
Add a comment to a page, block, or discussion thread.
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Page-level comment
|
|
169
|
+
notion comment "$PAGE_ID" -m "Reviewed and approved."
|
|
170
|
+
|
|
171
|
+
# Reply to an existing discussion thread (use discussion ID from `notion comments`)
|
|
172
|
+
notion comment --reply-to "$DISCUSSION_ID" -m "Agreed, let's proceed."
|
|
173
|
+
|
|
174
|
+
# Comment on a specific block
|
|
175
|
+
notion comment --block "$BLOCK_ID" -m "This section needs revision."
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Flag | Description |
|
|
179
|
+
|------|-------------|
|
|
180
|
+
| `-m, --message <text>` | Comment text (required) |
|
|
181
|
+
| `--reply-to <discussion-id>` | Reply to an existing discussion thread |
|
|
182
|
+
| `--block <block-id>` | Comment on a specific block |
|
|
183
|
+
|
|
184
|
+
The `notion comments <id>` list command now shows `DISCUSSION` and `PARENT` columns so agents can reference discussion IDs with `--reply-to`.
|
|
185
|
+
|
|
186
|
+
Required integration capabilities: **Read content**, **Insert content**, **Read comments**, **Insert comments**
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: using-notion-cli
|
|
3
3
|
description: Reads and writes Notion pages using the `notion` CLI tool. Use when accessing Notion content, searching workspace pages, querying database entries, reading page markdown, appending content, creating pages, or adding comments from the terminal or within automated workflows.
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: opencode
|
|
6
4
|
---
|
|
7
5
|
|
|
8
6
|
## Setup
|