@andrzejchm/notion-cli 0.11.0 → 0.12.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.
- package/.agents/skills/using-notion-cli/SKILL.md +55 -6
- package/README.md +25 -0
- package/dist/cli.js +448 -129
- package/dist/cli.js.map +1 -1
- package/docs/README.agents.md +60 -0
- package/package.json +2 -2
package/docs/README.agents.md
CHANGED
|
@@ -82,6 +82,66 @@ 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
|
+
|
|
85
145
|
### `notion search <query>` / `notion ls`
|
|
86
146
|
|
|
87
147
|
Search or list pages and databases. Both commands support:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrzejchm/notion-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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.
|
|
52
|
+
"@notionhq/client": "^5.16.0",
|
|
53
53
|
"chalk": "^5.6.0",
|
|
54
54
|
"commander": "^14.0.0",
|
|
55
55
|
"yaml": "^2.8.0"
|