@andrzejchm/notion-cli 0.11.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)*
@@ -82,6 +82,162 @@ To update the skill file, re-download it from the URL in step 2 to the same loca
82
82
 
83
83
  ## Commands Reference
84
84
 
85
+ ### `notion attach <id|url> <file> [files...]`
86
+
87
+ Upload and attach local files to a Notion page as file blocks.
88
+
89
+ ```bash
90
+ # Attach a single image
91
+ notion attach "$PAGE_ID" screenshot.png
92
+
93
+ # Attach multiple files
94
+ notion attach "$PAGE_ID" report.pdf data.csv image.png
95
+
96
+ # Add a caption to all attached files
97
+ notion attach "$PAGE_ID" diagram.png --caption "Architecture diagram"
98
+
99
+ # Override auto-detected block type
100
+ notion attach "$PAGE_ID" file.svg --type image
101
+
102
+ # Output JSON response
103
+ notion attach "$PAGE_ID" file.pdf --json
104
+ ```
105
+
106
+ | Flag | Description |
107
+ |------|-------------|
108
+ | `--caption <text>` | Caption for the file block(s) |
109
+ | `--type <type>` | Override auto-detected block type (`image\|file\|pdf\|audio\|video`) |
110
+ | `--json` | Output JSON response |
111
+
112
+ Block type is auto-detected from the file extension. Images (png, jpg, gif, webp, svg, etc.) become `image` blocks, audio files become `audio` blocks, video files become `video` blocks, PDFs become `pdf` blocks, and everything else becomes a `file` block.
113
+
114
+ Files ≤20 MB are uploaded in a single request. Larger files are split into 20 MB chunks automatically.
115
+
116
+ Required integration capabilities: **Read content**, **Insert content**
117
+
118
+ ### `notion append <id|url>` — `--file` flag
119
+
120
+ The `append` command accepts a repeatable `--file <path>` option to attach local files after the markdown content:
121
+
122
+ ```bash
123
+ # Append markdown and attach a file
124
+ notion append "$PAGE_ID" -m "See attached screenshot:" --file screenshot.png
125
+
126
+ # Attach files without any markdown (files only)
127
+ notion append "$PAGE_ID" --file image.png --file data.csv
128
+
129
+ # Pipe markdown and attach a file
130
+ echo "# Report" | notion append "$PAGE_ID" --file report.pdf
131
+ ```
132
+
133
+ ### `notion create-page` — `--file` flag
134
+
135
+ The `create-page` command accepts a repeatable `--file <path>` option to attach local files after the page is created:
136
+
137
+ ```bash
138
+ # Create a page and attach a PDF
139
+ notion create-page --parent "$PAGE_ID" --title "Report" --file report.pdf
140
+
141
+ # Create a page with markdown body and attached files
142
+ notion create-page --parent "$PAGE_ID" --title "Meeting Notes" -m "# Agenda" --file slides.pdf --file notes.txt
143
+ ```
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
+
85
241
  ### `notion search <query>` / `notion ls`
86
242
 
87
243
  Search or list pages and databases. Both commands support:
@@ -145,7 +301,7 @@ Required integration capabilities: **Read content**, **Update content**
145
301
 
146
302
  ### `notion archive <id|url>`
147
303
 
148
- Archive (trash) a Notion page.
304
+ Archive (trash) a Notion page or database.
149
305
 
150
306
  ```bash
151
307
  # Archive a page by ID
@@ -156,6 +312,26 @@ notion archive "https://www.notion.so/My-Page-b55c9c91384d452b81dbd1ef79372b75"
156
312
 
157
313
  # Output the full updated page object as JSON
158
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
159
335
  ```
160
336
 
161
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.11.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.14.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"