notas 26.5.0 → 26.6.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/README.md +2 -2
- package/bin/install.js +44 -43
- package/package.json +1 -1
- package/skills/notion/SKILL.md +11 -5
package/README.md
CHANGED
|
@@ -56,8 +56,8 @@ notas notion version
|
|
|
56
56
|
|
|
57
57
|
## Skills
|
|
58
58
|
|
|
59
|
-
| Skill
|
|
60
|
-
|
|
59
|
+
| Skill | Description |
|
|
60
|
+
| ---------- | --------------------------------------------------------------------------------------------------------- |
|
|
61
61
|
| **notion** | Reference guide for the notas CLI Notion provider — pages, databases, blocks, users, comments, and search |
|
|
62
62
|
|
|
63
63
|
### Claude Code
|
package/bin/install.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Buffer } from "node:buffer";
|
|
2
|
+
import { execSync } from "child_process";
|
|
2
3
|
import fs from "fs";
|
|
4
|
+
import https from "https";
|
|
5
|
+
import { createRequire } from "module";
|
|
3
6
|
import path from "path";
|
|
4
|
-
import { execSync } from "child_process";
|
|
5
7
|
import { fileURLToPath } from "url";
|
|
6
|
-
import { createRequire } from "module";
|
|
7
8
|
|
|
8
9
|
const require = createRequire(import.meta.url);
|
|
9
10
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -11,53 +12,53 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
11
12
|
const REPO = "circlesac/notas-cli";
|
|
12
13
|
|
|
13
14
|
const PLATFORMS = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
"darwin-x64": { artifact: "notas-darwin-x64", ext: ".tar.gz" },
|
|
16
|
+
"darwin-arm64": { artifact: "notas-darwin-arm64", ext: ".tar.gz" },
|
|
17
|
+
"linux-x64": { artifact: "notas-linux-x64", ext: ".tar.gz" },
|
|
18
|
+
"linux-arm64": { artifact: "notas-linux-arm64", ext: ".tar.gz" }
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
function download(url) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
https.get(url, (res) => {
|
|
24
|
+
if (res.statusCode === 302 || res.statusCode === 301) {
|
|
25
|
+
return download(res.headers.location).then(resolve).catch(reject);
|
|
26
|
+
}
|
|
27
|
+
if (res.statusCode !== 200) return reject(new Error(`HTTP ${res.statusCode}`));
|
|
28
|
+
const chunks = [];
|
|
29
|
+
res.on("data", (c) => chunks.push(c));
|
|
30
|
+
res.on("end", () => resolve(Buffer.concat(chunks)));
|
|
31
|
+
res.on("error", reject);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
const nativeDir = path.join(__dirname, "native");
|
|
36
37
|
const binPath = path.join(nativeDir, "notas");
|
|
37
38
|
|
|
38
39
|
if (!fs.existsSync(binPath)) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
40
|
+
const { version } = require("../package.json");
|
|
41
|
+
if (version) {
|
|
42
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
43
|
+
const info = PLATFORMS[platform];
|
|
44
|
+
if (!info) {
|
|
45
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const { artifact, ext } = info;
|
|
50
|
+
const url = `https://github.com/${REPO}/releases/download/v${version}/${artifact}${ext}`;
|
|
51
|
+
console.info(`Downloading notas v${version} for ${platform}...`);
|
|
52
|
+
|
|
53
|
+
const data = await download(url);
|
|
54
|
+
fs.mkdirSync(nativeDir, { recursive: true });
|
|
55
|
+
|
|
56
|
+
const tmp = path.join(nativeDir, `tmp${ext}`);
|
|
57
|
+
fs.writeFileSync(tmp, data);
|
|
58
|
+
execSync(`tar xzf "${tmp}"`, { cwd: nativeDir });
|
|
59
|
+
fs.unlinkSync(tmp);
|
|
60
|
+
|
|
61
|
+
fs.chmodSync(binPath, 0o755);
|
|
62
|
+
console.info("Installed successfully.");
|
|
63
|
+
}
|
|
63
64
|
}
|
package/package.json
CHANGED
package/skills/notion/SKILL.md
CHANGED
|
@@ -15,11 +15,11 @@ notas notion db list # List all databases
|
|
|
15
15
|
|
|
16
16
|
## Global Flags
|
|
17
17
|
|
|
18
|
-
| Flag
|
|
19
|
-
|
|
20
|
-
| `--workspace` | `-w`
|
|
21
|
-
| `--json`
|
|
22
|
-
| `--plain`
|
|
18
|
+
| Flag | Alias | Description |
|
|
19
|
+
| ------------- | ----- | ------------------------------------------- |
|
|
20
|
+
| `--workspace` | `-w` | Select workspace (when multiple configured) |
|
|
21
|
+
| `--json` | | Output as JSON |
|
|
22
|
+
| `--plain` | | Output as tab-separated plain text |
|
|
23
23
|
|
|
24
24
|
## Authentication
|
|
25
25
|
|
|
@@ -65,6 +65,7 @@ notas notion pages restore <page-id>
|
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
Stdin support:
|
|
68
|
+
|
|
68
69
|
```bash
|
|
69
70
|
cat notes.md | notas notion pages create <parent-id> --title "From File" --stdio
|
|
70
71
|
```
|
|
@@ -90,6 +91,7 @@ notas notion blocks delete <block-id>
|
|
|
90
91
|
Block types: `paragraph`, `heading_1`, `heading_2`, `heading_3`, `bulleted_list_item`, `numbered_list_item`, `to_do`, `toggle`, `code`, `quote`, `callout`, `divider`, `bookmark`
|
|
91
92
|
|
|
92
93
|
Stdin support:
|
|
94
|
+
|
|
93
95
|
```bash
|
|
94
96
|
cat code.py | notas notion blocks append <page-id> --type code --language python --stdio
|
|
95
97
|
```
|
|
@@ -134,16 +136,19 @@ notas notion api PATCH /v1/pages/<id> --body '{"archived":true}'
|
|
|
134
136
|
## Common Workflows
|
|
135
137
|
|
|
136
138
|
### Create a page with content from a file
|
|
139
|
+
|
|
137
140
|
```bash
|
|
138
141
|
cat document.md | notas notion pages create <parent-id> --title "My Doc" --stdio
|
|
139
142
|
```
|
|
140
143
|
|
|
141
144
|
### Query a database and pipe to jq
|
|
145
|
+
|
|
142
146
|
```bash
|
|
143
147
|
notas notion db query <db-id> --json | jq '.results[].properties.Name.title[0].plain_text'
|
|
144
148
|
```
|
|
145
149
|
|
|
146
150
|
### Append multiple blocks from a script
|
|
151
|
+
|
|
147
152
|
```bash
|
|
148
153
|
notas notion blocks append <page-id> --type heading_1 --text "Section Title"
|
|
149
154
|
notas notion blocks append <page-id> --text "Paragraph content"
|
|
@@ -151,6 +156,7 @@ cat snippet.py | notas notion blocks append <page-id> --type code --language pyt
|
|
|
151
156
|
```
|
|
152
157
|
|
|
153
158
|
### Search and get page content
|
|
159
|
+
|
|
154
160
|
```bash
|
|
155
161
|
PAGE_ID=$(notas notion search "meeting notes" --json | jq -r '.results[0].id')
|
|
156
162
|
notas notion blocks list $PAGE_ID --recursive --plain
|