@getnote/cli 0.1.5 → 0.1.7

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 CHANGED
@@ -23,6 +23,13 @@ npm install -g @getnote/cli
23
23
  npm install -g @getnote/cli
24
24
  ```
25
25
 
26
+ **(可选)安装 AI Agent Skill**
27
+
28
+ 在 Claude Code、Cursor 等 AI 编程工具里用自然语言操作笔记,需要额外安装 Skill:
29
+ ```bash
30
+ npx skills add @getnote/cli -y -g
31
+ ```
32
+
26
33
  **第二步:登录**
27
34
  ```bash
28
35
  getnote auth login
@@ -99,7 +106,13 @@ getnote search "关键词" -o json
99
106
  getnote save https://example.com -o json # 自动轮询,返回最终笔记
100
107
  ```
101
108
 
102
- `skills/` 目录下有 Claude Code 专用的 Skill 文件,加到项目上下文后,AI Agent 可以直接用自然语言操作笔记。
109
+ `skills/` 目录下有 Claude Code 专用的 Skill 文件,安装后 AI Agent 可以直接用自然语言操作笔记:
110
+
111
+ ```bash
112
+ npx skills add @getnote/cli -y -g
113
+ ```
114
+
115
+ 安装后在 Claude Code / Cursor 里说「帮我搜一下关于 RAG 的笔记」即可直接调用。
103
116
 
104
117
  ---
105
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getnote/cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "CLI tool for Get笔记 — manage notes and knowledge bases from the terminal",
5
5
  "keywords": [
6
6
  "getnote",
@@ -23,6 +23,7 @@
23
23
  "files": [
24
24
  "bin/",
25
25
  "scripts/",
26
+ "skills/",
26
27
  "README.md"
27
28
  ]
28
29
  }
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: getnote-auth
3
+ version: 0.2.0
4
+ description: Manage authentication for Get笔记 CLI
5
+ ---
6
+
7
+ # getnote-auth Skill
8
+
9
+ Log in, log out, and check authentication status.
10
+
11
+ ## Commands
12
+
13
+ ### Log in
14
+
15
+ ```
16
+ getnote auth login [--api-key <key>] [--client-id <id>]
17
+ ```
18
+
19
+ | Mode | Command | Description |
20
+ |------|---------|-------------|
21
+ | OAuth (recommended) | `getnote auth login` | Opens browser to authorize |
22
+ | API Key | `getnote auth login --api-key <key>` | Saves key directly, no browser |
23
+
24
+ ```bash
25
+ # OAuth flow
26
+ getnote auth login
27
+
28
+ # API key directly
29
+ getnote auth login --api-key gk_live_xxx
30
+
31
+ # API key + Client ID
32
+ getnote auth login --api-key gk_live_xxx --client-id cli_xxx
33
+ ```
34
+
35
+ API keys start with `gk_live_`. Get yours at: https://www.biji.com/settings/developer
36
+
37
+ ---
38
+
39
+ ### Check status
40
+
41
+ ```
42
+ getnote auth status
43
+ ```
44
+
45
+ ```bash
46
+ getnote auth status
47
+ ```
48
+
49
+ ---
50
+
51
+ ### Log out
52
+
53
+ ```
54
+ getnote auth logout
55
+ ```
56
+
57
+ Removes saved credentials from local config.
58
+
59
+ ```bash
60
+ getnote auth logout
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Agent Usage Notes
66
+
67
+ - Always run `getnote auth status` first to verify authentication before other commands.
68
+ - If not authenticated, prompt the user to run `getnote auth login`.
69
+ - `--api-key` on any command is a temporary override and does not save credentials.
70
+ - Credentials are stored in `~/.getnote/config.json`; `auth logout` removes them.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: getnote-kb
3
+ version: 0.2.0
4
+ description: Manage knowledge bases in Get笔记 via the getnote CLI
5
+ ---
6
+
7
+ # getnote-kb Skill
8
+
9
+ Manage knowledge bases in Get笔记 — list, create, browse notes, add/remove notes.
10
+
11
+ ## Prerequisites
12
+
13
+ - `getnote` CLI installed and authenticated (`getnote auth status` should show "Authenticated")
14
+
15
+ ## Commands
16
+
17
+ ### List all knowledge bases
18
+
19
+ ```
20
+ getnote kbs
21
+ ```
22
+
23
+ ```bash
24
+ getnote kbs
25
+ getnote kbs -o json
26
+ ```
27
+
28
+ ---
29
+
30
+ ### List notes in a knowledge base
31
+
32
+ ```
33
+ getnote kb <topic_id> [--limit <n>] [--all]
34
+ ```
35
+
36
+ | Flag | Default | Description |
37
+ |------|---------|-------------|
38
+ | `--limit` | 20 | Notes per page |
39
+ | `--all` | — | Fetch all notes (auto-paginate) |
40
+
41
+ ```bash
42
+ getnote kb vnrOAaGY
43
+ getnote kb vnrOAaGY --limit 5
44
+ getnote kb vnrOAaGY --all
45
+ getnote kb vnrOAaGY -o json
46
+ ```
47
+
48
+ ---
49
+
50
+ ### Create a knowledge base
51
+
52
+ ```
53
+ getnote kb create <name> [--desc <description>]
54
+ ```
55
+
56
+ ```bash
57
+ getnote kb create "Research Papers"
58
+ getnote kb create "Project Docs" --desc "Documentation links for the main project"
59
+ ```
60
+
61
+ ---
62
+
63
+ ### Add notes to a knowledge base
64
+
65
+ ```
66
+ getnote kb add <topic_id> <note_id> [note_id...]
67
+ ```
68
+
69
+ Supports multiple note IDs in one call.
70
+
71
+ ```bash
72
+ getnote kb add vnrOAaGY 1234567890
73
+ getnote kb add vnrOAaGY 1234567890 9876543210
74
+ ```
75
+
76
+ ---
77
+
78
+ ### Remove notes from a knowledge base
79
+
80
+ ```
81
+ getnote kb remove <topic_id> <note_id> [note_id...]
82
+ ```
83
+
84
+ ```bash
85
+ getnote kb remove vnrOAaGY 1234567890
86
+ getnote kb remove vnrOAaGY 1234567890 9876543210
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Agent Usage Notes
92
+
93
+ - Use `-o json` when parsing results programmatically.
94
+ - Get `topic_id` from `getnote kbs -o json` (the `id` field).
95
+ - `kb add` / `kb remove` accept multiple note IDs — prefer batching over multiple calls.
96
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: getnote-note
3
+ version: 0.2.0
4
+ description: Manage notes in Get笔记 via the getnote CLI
5
+ ---
6
+
7
+ # getnote-note Skill
8
+
9
+ Manage individual notes in Get笔记 — save, list, get, update, delete, and track save tasks.
10
+
11
+ ## Prerequisites
12
+
13
+ - `getnote` CLI installed and authenticated (`getnote auth status` should show "Authenticated")
14
+
15
+ ## Commands
16
+
17
+ ### Save a note
18
+
19
+ ```
20
+ getnote save <url|text|image_path> [--title <title>] [--tag <tag>]...
21
+ ```
22
+
23
+ | Flag | Description |
24
+ |------|-------------|
25
+ | `--title` | Optional title |
26
+ | `--tag` | Tag to apply; may be repeated |
27
+
28
+ - URL (`http://` or `https://`) → saved as link note
29
+ - Local image path → saved as image note
30
+ - Otherwise → saved as text note
31
+
32
+ **Examples:**
33
+ ```bash
34
+ getnote save https://example.com --title "Great article"
35
+ getnote save "Remember to review the docs" --tag work --tag important
36
+ getnote save ./screenshot.png --title "Design mockup"
37
+ ```
38
+
39
+ URL saves are async; the CLI auto-polls until done, then shows the result.
40
+ In `-o json` mode, silently polls and returns the final note JSON.
41
+
42
+ ---
43
+
44
+ ### Track save task
45
+
46
+ ```
47
+ getnote task <task_id>
48
+ ```
49
+
50
+ Check progress of an async save task (returned by `save` for URLs).
51
+
52
+ ```bash
53
+ getnote task task_xyz789
54
+ getnote task task_xyz789 -o json
55
+ ```
56
+
57
+ ---
58
+
59
+ ### List recent notes
60
+
61
+ ```
62
+ getnote notes [--limit <n>] [--since-id <id>] [--all]
63
+ ```
64
+
65
+ | Flag | Default | Description |
66
+ |------|---------|-------------|
67
+ | `--limit` | 20 | Notes per page |
68
+ | `--since-id` | — | Pagination cursor (last note ID seen) |
69
+ | `--all` | — | Fetch all notes (auto-paginate, streams output) |
70
+
71
+ ```bash
72
+ getnote notes
73
+ getnote notes --limit 5
74
+ getnote notes --all
75
+ getnote notes --since-id 1234567890
76
+ getnote notes -o json
77
+ ```
78
+
79
+ ---
80
+
81
+ ### Get note details
82
+
83
+ ```
84
+ getnote note <id> [--field <field>]
85
+ ```
86
+
87
+ | Flag | Description |
88
+ |------|-------------|
89
+ | `--field` | Output a single field: `id` / `title` / `content` / `type` / `created_at` / `updated_at` / `url` / `excerpt` |
90
+
91
+ ```bash
92
+ getnote note 1234567890
93
+ getnote note 1234567890 --field content
94
+ getnote note 1234567890 --field url
95
+ getnote note 1234567890 -o json
96
+ ```
97
+
98
+ ---
99
+
100
+ ### Update a note
101
+
102
+ ```
103
+ getnote note update <id> [--title <title>] [--content <content>] [--tag <tags>]
104
+ ```
105
+
106
+ | Flag | Description |
107
+ |------|-------------|
108
+ | `--title` | New title |
109
+ | `--content` | New content (plain_text notes only) |
110
+ | `--tag` | Comma-separated tags (replaces all existing tags) |
111
+
112
+ ```bash
113
+ getnote note update 1234567890 --title "Updated title"
114
+ getnote note update 1234567890 --tag "work,important"
115
+ ```
116
+
117
+ ---
118
+
119
+ ### Delete a note
120
+
121
+ ```
122
+ getnote note delete <id> [-y]
123
+ ```
124
+
125
+ Moves note to trash.
126
+
127
+ | Flag | Description |
128
+ |------|-------------|
129
+ | `-y` | Skip confirmation prompt |
130
+
131
+ ```bash
132
+ getnote note delete 1234567890
133
+ getnote note delete 1234567890 -y
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Agent Usage Notes
139
+
140
+ - Use `-o json` when parsing responses programmatically.
141
+ - `save` for URLs is async; in `-o json` mode the CLI auto-polls and returns the final note — no manual `task` polling needed.
142
+ - `note update --tag` replaces **all** existing tags; use `getnote tag add/remove` for partial updates.
143
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: getnote-search
3
+ version: 0.2.0
4
+ description: Semantic search across notes in Get笔记 via the getnote CLI
5
+ ---
6
+
7
+ # getnote-search Skill
8
+
9
+ Semantic search across all notes or within a specific knowledge base.
10
+
11
+ ## Prerequisites
12
+
13
+ - `getnote` CLI installed and authenticated (`getnote auth status` should show "Authenticated")
14
+
15
+ ## Commands
16
+
17
+ ### Search notes
18
+
19
+ ```
20
+ getnote search <query> [--kb <topic_id>] [--limit <n>]
21
+ ```
22
+
23
+ | Flag | Default | Description |
24
+ |------|---------|-------------|
25
+ | `--kb` | — | Limit search to a knowledge base (topic_id) |
26
+ | `--limit` | 10 | Max results (max 10) |
27
+
28
+ ```bash
29
+ # Search across all notes
30
+ getnote search "大模型 API"
31
+
32
+ # Search within a knowledge base
33
+ getnote search "RAG" --kb qnNX75j0
34
+
35
+ # Limit results + JSON output
36
+ getnote search "机器学习" --limit 5 -o json
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Agent Usage Notes
42
+
43
+ - Use `-o json` when parsing results programmatically.
44
+ - Get `topic_id` for `--kb` from `getnote kbs -o json`.
45
+ - Results are ranked by semantic relevance, not recency.
46
+ - Max `--limit` is 10; use `getnote notes` for broader browsing.
47
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: getnote-tag
3
+ version: 0.2.0
4
+ description: Manage note tags in Get笔记 via the getnote CLI
5
+ ---
6
+
7
+ # getnote-tag Skill
8
+
9
+ Add, list, and remove tags on notes.
10
+
11
+ ## Prerequisites
12
+
13
+ - `getnote` CLI installed and authenticated (`getnote auth status` should show "Authenticated")
14
+
15
+ ## Commands
16
+
17
+ ### List tags on a note
18
+
19
+ ```
20
+ getnote tag list <note_id>
21
+ ```
22
+
23
+ Returns all tags including their IDs (needed for `tag remove`).
24
+
25
+ ```bash
26
+ getnote tag list 1896830231705320746
27
+ getnote tag list 1896830231705320746 -o json
28
+ ```
29
+
30
+ ---
31
+
32
+ ### Add a tag
33
+
34
+ ```
35
+ getnote tag add <note_id> <tag>
36
+ ```
37
+
38
+ ```bash
39
+ getnote tag add 1896830231705320746 工作
40
+ ```
41
+
42
+ ---
43
+
44
+ ### Remove a tag
45
+
46
+ ```
47
+ getnote tag remove <note_id> <tag_id>
48
+ ```
49
+
50
+ > ⚠️ Requires **tag ID** (integer), not tag name. Run `getnote tag list <note_id>` first to get the ID.
51
+ > System tags cannot be removed.
52
+
53
+ ```bash
54
+ # Get tag IDs first
55
+ getnote tag list 1896830231705320746 -o json
56
+
57
+ # Remove by tag ID
58
+ getnote tag remove 1896830231705320746 123
59
+ ```
60
+
61
+ ---
62
+
63
+ ## Agent Usage Notes
64
+
65
+ - `tag remove` takes a **tag ID**, not a name — always call `tag list` first if you only have the name.
66
+ - For bulk tag replacement, use `getnote note update --tag` instead (replaces all tags at once).
67
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.