@andrzejchm/notion-cli 0.12.0 → 0.13.0

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.
@@ -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.9.0)
7
+ - **CLI** = `@andrzejchm/notion-cli` (this repo, v0.13.0)
8
8
  - **MCP** = Official Notion MCP server
9
9
 
10
10
  ---
@@ -20,15 +20,15 @@
20
20
  | Page properties | Read + write via `update --prop` | Full read + write (update any property) | ✅ Parity |
21
21
  | Move pages | `move --to` / `--to-db` | Batch move to any parent | ✅ Parity |
22
22
  | Duplicate pages | - | Duplicate with async content copy | Gap |
23
- | Archive/delete | `archive` | Trash pages | ✅ Parity |
23
+ | Archive/delete | `archive` (pages + databases), `delete-block` | Trash pages | ✅ Parity |
24
24
  | Database create | `db create --prop` syntax | SQL DDL `CREATE TABLE` syntax | Partial |
25
- | Database schema update | Read-only schema | `ADD/DROP/RENAME/ALTER COLUMN` via DDL | Gap |
25
+ | Database schema update | `--add-prop, --remove-prop, --rename-prop, --set-options` | `ADD/DROP/RENAME/ALTER COLUMN` via DDL | Partial |
26
26
  | Database views | - | Create + update 10 view types with DSL | Gap |
27
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 |
31
- | Batch operations | - | Create up to 100 pages, move up to 100 pages | Gap |
31
+ | Batch operations | `db update-rows` with filter + dry-run | Create up to 100 pages, move up to 100 pages | Partial |
32
32
  | Icon / Cover | `--icon` / `--cover` on `create-page` | Set emoji/image icon + cover on create and update | Partial |
33
33
 
34
34
  ---
@@ -79,11 +79,10 @@ These gaps directly limit what an AI agent can accomplish through the CLI compar
79
79
  **CLI:** `notion move <ids...> --to <page-id>` or `notion move <ids...> --to-db <database-id>`. Supports multiple page IDs as variadic arguments.
80
80
  **Status:** Shipped in v0.11.0.
81
81
 
82
- #### 8. Update database schema
82
+ #### 8. Update database schema (shipped v0.13.0)
83
83
  **MCP:** `ADD COLUMN`, `DROP COLUMN`, `RENAME COLUMN`, `ALTER COLUMN SET` via DDL.
84
- **CLI:** Read-only schema via `notion db schema`.
85
- **Why:** Evolving database structure (adding a new status option, renaming a field) without leaving the terminal.
86
- **Suggested command:** `notion db alter <id> --add "Priority SELECT(High,Medium,Low)" --rename "Status:Project Status"`
84
+ **CLI:** `notion db update <id> --add-prop "Priority:number"` / `--remove-prop` / `--rename-prop` / `--set-options` / `--title`.
85
+ **Status:** Shipped in v0.13.0. Covers add/remove/rename properties and select option management. Does not support relation, rollup, formula, or unique_id types.
87
86
 
88
87
  #### 9. ✅ Multi-operation content editing (shipped v0.9.0)
89
88
  **MCP:** `update_content` accepts an array of `{ old_str, new_str }` pairs (up to 100) in a single call, with `replace_all_matches` option.
@@ -96,53 +95,63 @@ These gaps directly limit what an AI agent can accomplish through the CLI compar
96
95
  **Why:** Templating workflows — copy a template page to start a new project/sprint.
97
96
  **Suggested command:** `notion duplicate <id>`
98
97
 
98
+ #### 11. ✅ Batch update-rows (shipped v0.13.0)
99
+ **MCP:** Create up to 100 pages in a single call.
100
+ **CLI:** `notion db update-rows <id> --filter "Status=Open" --prop "Priority=High"` — query + batch update with concurrency control. `--dry-run` for safe preview.
101
+ **Status:** Shipped in v0.13.0. Covers batch property updates with filter. Batch page creation (100 pages in one call) is still a gap.
102
+
103
+ #### 12. ✅ Delete blocks (shipped v0.13.0)
104
+ **MCP:** No direct equivalent (MCP can trash pages but not arbitrary blocks).
105
+ **CLI:** `notion delete-block <id>` — deletes any block via `DELETE /v1/blocks/{block_id}`.
106
+ **Status:** Shipped in v0.13.0. CLI-only feature not available in MCP.
107
+
99
108
  ### Tier 3 - Lower Impact (nice-to-have, niche workflows)
100
109
 
101
- #### 11. Database views (create + update)
110
+ #### 13. Database views (create + update)
102
111
  **MCP:** 10 view types (table, board, calendar, timeline, gallery, list, form, chart, map, dashboard) with DSL for filters, sorts, grouping.
103
112
  **CLI:** No equivalent.
104
113
  **Why:** Mostly a UI concern; agents rarely need to create views programmatically. But useful for project setup automation.
105
114
 
106
- #### 12. Page icon and cover
115
+ #### 14. Page icon and cover
107
116
  **MCP:** Set emoji/custom emoji/image URL as icon; set image URL as cover on create and update.
108
117
  **CLI:** No equivalent.
109
118
  **Why:** Cosmetic but helps agents create polished pages. Low effort to add as flags.
110
119
  **Suggested flags:** `--icon "🚀"` / `--cover "https://..."`
111
120
 
112
- #### 13. Teams / teamspaces listing
121
+ #### 15. Teams / teamspaces listing
113
122
  **MCP:** `get-teams` with name search.
114
123
  **CLI:** No equivalent.
115
124
  **Why:** Rarely needed by agents. Useful for workspace discovery in large organizations.
116
125
  **Suggested command:** `notion teams`
117
126
 
118
- #### 14. Scoped search (within page / database / teamspace)
127
+ #### 16. Scoped search (within page / database / teamspace)
119
128
  **MCP:** `page_url`, `data_source_url`, `teamspace_id` parameters scope search.
120
129
  **CLI:** Global search only.
121
130
  **Why:** Useful for agents working within a specific project area, but global search + filtering usually suffices.
122
131
  **Suggested flags:** `--within <id>`
123
132
 
124
- #### 15. Page verification
133
+ #### 17. Page verification
125
134
  **MCP:** `update_verification` — mark pages as verified with optional expiry (Business/Enterprise only).
126
135
  **CLI:** No equivalent.
127
136
  **Why:** Enterprise-only feature, limited audience.
128
137
 
129
- #### 16. Template application
138
+ #### 18. Template application
130
139
  **MCP:** Apply database templates on create and update (template content is async).
131
140
  **CLI:** No equivalent.
132
141
  **Why:** Useful for standardized page creation but requires database template discovery first.
133
142
  **Suggested flags:** `--template <template-id>`
134
143
 
135
- #### 17. Batch page creation
144
+ #### 19. Batch page creation
136
145
  **MCP:** Create up to 100 pages in a single call.
137
146
  **CLI:** One page per invocation.
138
147
  **Why:** Performance optimization for bulk workflows. Can be scripted with shell loops for now.
139
148
 
140
- #### 18. Advanced user lookup
149
+ #### 20. Advanced user lookup
141
150
  **MCP:** Search users by name/email, fetch by ID, fetch authenticated user (`self`).
142
151
  **CLI:** `notion users` lists all, no search or lookup.
143
152
  **Suggested flags:** `notion users --search "john"` / `notion users --id <uuid>` / `notion users --me`
144
153
 
145
- #### 19. Fetch page discussions inline
154
+ #### 21. Fetch page discussions inline
146
155
  **MCP:** `include_discussions: true` on fetch shows discussion anchors in page content; `get-comments` with `include_all_blocks`, `include_resolved`.
147
156
  **CLI:** `notion comments` shows page-level comments only, no block-level discussions, no resolved filter.
148
157
  **Suggested flags:** `--all-blocks` / `--include-resolved`
@@ -172,11 +181,11 @@ The CLI isn't just chasing MCP parity — it has unique strengths:
172
181
  - Tier 1 items (1-4) should be tackled before any Tier 2 work
173
182
  - Items 1 and 2 can share infrastructure (property value parsing, `--prop` flag syntax)
174
183
  - Item 3 (archive) is likely a small addition once property updates work (archive is a property)
175
- - Items 6 and 8 (database create/alter) can share a schema DSL parser
184
+ - Items 6 (database create) and 8 (database alter) are both shipped and share property definition parsing
176
185
  - The CLI should NOT try to replicate MCP's SQL DDL syntax — a simpler flag-based approach fits CLI ergonomics better
177
186
 
178
187
  ---
179
188
 
180
- *Last updated: 2026-03-24*
181
- *CLI version compared: 0.9.0*
189
+ *Last updated: 2026-04-08*
190
+ *CLI version compared: 0.13.0*
182
191
  *MCP version compared: Official Notion MCP (2026-03)*
@@ -142,6 +142,102 @@ notion create-page --parent "$PAGE_ID" --title "Report" --file report.pdf
142
142
  notion create-page --parent "$PAGE_ID" --title "Meeting Notes" -m "# Agenda" --file slides.pdf --file notes.txt
143
143
  ```
144
144
 
145
+ ### `notion db create`
146
+
147
+ Create a new database under a parent page with typed property columns.
148
+
149
+ ```bash
150
+ # Database with select, date, and text properties
151
+ notion db create --parent "$PAGE_ID" --title "Project Tracker" \
152
+ --prop "Status:select:To Do,In Progress,Done" \
153
+ --prop "Priority:select:High,Medium,Low" \
154
+ --prop "Due:date:" \
155
+ --prop "Notes:rich_text:"
156
+
157
+ # Minimal — title column is added automatically if not specified
158
+ notion db create --parent "$PAGE_ID" --title "Simple List"
159
+ ```
160
+
161
+ | Flag | Description |
162
+ |------|-------------|
163
+ | `--parent <id\|url>` | Parent page ID or URL (required) |
164
+ | `--title <title>` | Database title (required) |
165
+ | `--prop <definition>` | Property definition (repeatable) |
166
+ | `--json` | Output full JSON response |
167
+
168
+ **Property syntax:** `Name:type[:options]`
169
+
170
+ Supported types: `title`, `rich_text`, `number`, `select`, `multi_select`, `status`, `date`, `checkbox`, `url`, `email`, `phone_number`, `people`, `files`, `created_time`, `last_edited_time`.
171
+
172
+ **Important:** After creating a database, use `notion search "DB Title" --type database` to find the database ID for subsequent operations. The ID returned by `db create` is a URL-based ID that may differ from the API-accessible database ID.
173
+
174
+ Required integration capabilities: **Read content**, **Insert content**
175
+
176
+ ### `notion db update <id|url>`
177
+
178
+ Update database schema — add, remove, or rename properties and manage select options.
179
+
180
+ ```bash
181
+ # Add a new property
182
+ notion db update "$DB_ID" --add-prop "Priority:number"
183
+
184
+ # Add a select property with options
185
+ notion db update "$DB_ID" --add-prop "Severity:select:Low,Medium,High,Critical"
186
+
187
+ # Remove a property
188
+ notion db update "$DB_ID" --remove-prop "Old Column"
189
+
190
+ # Rename a property
191
+ notion db update "$DB_ID" --rename-prop "Status:Project Status"
192
+
193
+ # Replace all select/multi_select options
194
+ notion db update "$DB_ID" --set-options "Priority:P1,P2,P3"
195
+
196
+ # Update database title
197
+ notion db update "$DB_ID" --title "Renamed Database"
198
+
199
+ # Multiple operations in one call
200
+ notion db update "$DB_ID" --add-prop "URL:url" --remove-prop "Notes" --json
201
+ ```
202
+
203
+ | Flag | Description |
204
+ |------|-------------|
205
+ | `--add-prop <definition>` | Add a new property (repeatable). Syntax: `Name:type[:options]` |
206
+ | `--remove-prop <name>` | Remove a property (repeatable) |
207
+ | `--rename-prop <old:new>` | Rename a property (repeatable) |
208
+ | `--set-options <prop:opts>` | Replace all select/multi\_select options |
209
+ | `--title <title>` | Update database title |
210
+ | `--json` | Output full JSON response |
211
+
212
+ Required integration capabilities: **Read content**, **Update content**
213
+
214
+ ### `notion db update-rows <id|url>`
215
+
216
+ Batch update properties on database rows matching a filter.
217
+
218
+ ```bash
219
+ # Update all rows matching a filter
220
+ notion db update-rows "$DB_ID" --filter "Status=Open" --prop "Priority=High"
221
+
222
+ # Update all rows (no filter)
223
+ notion db update-rows "$DB_ID" --prop "Status=Closed"
224
+
225
+ # Dry run — preview affected rows without modifying
226
+ notion db update-rows "$DB_ID" --filter "Category=Bug" --prop "Status=Done" --dry-run
227
+
228
+ # JSON output with per-row success/error
229
+ notion db update-rows "$DB_ID" --filter "Priority=Low" --prop "Status=Archived" --json
230
+ ```
231
+
232
+ | Flag | Description |
233
+ |------|-------------|
234
+ | `--filter <expr>` | Filter rows to update (repeatable, same syntax as `db query --filter`) |
235
+ | `--prop <property=value>` | Property to set on matching rows (repeatable, required) |
236
+ | `--dry-run` | Show matching rows without making changes |
237
+ | `--json` | Output JSON array of `{id, title, success, error?}` objects |
238
+
239
+ Required integration capabilities: **Read content**, **Update content**
240
+
145
241
  ### `notion search <query>` / `notion ls`
146
242
 
147
243
  Search or list pages and databases. Both commands support:
@@ -205,7 +301,7 @@ Required integration capabilities: **Read content**, **Update content**
205
301
 
206
302
  ### `notion archive <id|url>`
207
303
 
208
- Archive (trash) a Notion page.
304
+ Archive (trash) a Notion page or database.
209
305
 
210
306
  ```bash
211
307
  # Archive a page by ID
@@ -216,6 +312,26 @@ notion archive "https://www.notion.so/My-Page-b55c9c91384d452b81dbd1ef79372b75"
216
312
 
217
313
  # Output the full updated page object as JSON
218
314
  notion archive "$PAGE_ID" --json
315
+
316
+ # Archive a database
317
+ notion archive "$DB_ID"
318
+ ```
319
+
320
+ Required integration capabilities: **Read content**, **Update content**
321
+
322
+ ### `notion delete-block <id|url>`
323
+
324
+ Delete a block from a page (inline database, paragraph, etc.).
325
+
326
+ ```bash
327
+ # Delete an inline database
328
+ notion delete-block "$BLOCK_ID"
329
+
330
+ # Delete a block by URL
331
+ notion delete-block "https://www.notion.so/page#blockid"
332
+
333
+ # Output JSON response
334
+ notion delete-block "$BLOCK_ID" --json
219
335
  ```
220
336
 
221
337
  Required integration capabilities: **Read content**, **Update content**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andrzejchm/notion-cli",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Read Notion pages and databases from the terminal. Built for AI agents and developers.",
5
5
  "keywords": [
6
6
  "notion",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@inquirer/prompts": "^8.3.0",
52
- "@notionhq/client": "^5.16.0",
52
+ "@notionhq/client": "^5.17.0",
53
53
  "chalk": "^5.6.0",
54
54
  "commander": "^14.0.0",
55
55
  "yaml": "^2.8.0"