@getnote/cli 0.1.5 → 0.1.6

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.6",
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,77 @@
1
+ ---
2
+ name: getnote-auth
3
+ version: 0.1.0
4
+ description: Manage authentication for Get笔记 CLI
5
+ ---
6
+
7
+ # getnote-auth Skill
8
+
9
+ Log in, log out, and check authentication status for the `getnote` CLI.
10
+
11
+ ## Commands
12
+
13
+ ### Log in
14
+
15
+ ```
16
+ getnote auth login [--api-key <key>] [--client-id <id>]
17
+ ```
18
+
19
+ Two modes:
20
+
21
+ | Mode | Command | Description |
22
+ |------|---------|-------------|
23
+ | OAuth (recommended) | `getnote auth login` | Opens browser to authorize; saves credentials automatically |
24
+ | API Key | `getnote auth login --api-key <key>` | Saves API key directly, no browser needed |
25
+
26
+ **Examples:**
27
+ ```bash
28
+ # OAuth flow (opens browser)
29
+ getnote auth login
30
+
31
+ # Direct API key
32
+ getnote auth login --api-key gk_live_xxx
33
+
34
+ # API key + Client ID
35
+ getnote auth login --api-key gk_live_xxx --client-id cli_xxx
36
+ ```
37
+
38
+ API keys start with `gk_live_`. Get yours at: https://www.biji.com/settings/developer
39
+
40
+ ---
41
+
42
+ ### Check status
43
+
44
+ ```
45
+ getnote auth status
46
+ ```
47
+
48
+ Shows whether the CLI is authenticated and which API key is in use.
49
+
50
+ **Example:**
51
+ ```bash
52
+ getnote auth status
53
+ ```
54
+
55
+ ---
56
+
57
+ ### Log out
58
+
59
+ ```
60
+ getnote auth logout
61
+ ```
62
+
63
+ Removes the saved API key from local config.
64
+
65
+ **Example:**
66
+ ```bash
67
+ getnote auth logout
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Agent Usage Notes
73
+
74
+ - Always run `getnote auth status` before other commands to verify authentication.
75
+ - If not authenticated, prompt the user to run `getnote auth login`.
76
+ - The `--api-key` flag on any command overrides the saved config temporarily (does not save).
77
+ - Credentials are stored locally; `auth logout` removes them.
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: getnote-kb
3
+ version: 0.1.0
4
+ description: Manage knowledge bases in Get笔记 via the getnote CLI
5
+ ---
6
+
7
+ # getnote-kb Skill
8
+
9
+ Manage knowledge bases (话题/topic) in Get笔记 — list, create, and add or remove notes.
10
+
11
+ ## Prerequisites
12
+
13
+ - `getnote` CLI installed and authenticated (`getnote auth status` should show "Authenticated")
14
+ - API key configured via `getnote auth login --api-key <key>` or the `GETNOTE_API_KEY` environment variable
15
+
16
+ ## Commands
17
+
18
+ ### List knowledge bases
19
+
20
+ ```
21
+ getnote kb list [--output json|table]
22
+ ```
23
+
24
+ Returns all knowledge bases accessible to the authenticated user.
25
+
26
+ **Examples:**
27
+ ```bash
28
+ # Human-friendly table
29
+ getnote kb list
30
+
31
+ # Machine-readable JSON
32
+ getnote kb list --output json
33
+ ```
34
+
35
+ ---
36
+
37
+ ### Create a knowledge base
38
+
39
+ ```
40
+ getnote kb create <name> [--desc <description>]
41
+ ```
42
+
43
+ | Flag | Description |
44
+ |------|-------------|
45
+ | `--desc` | Optional description for the knowledge base |
46
+
47
+ **Examples:**
48
+ ```bash
49
+ getnote kb create "Research Papers"
50
+ getnote kb create "Project Docs" --desc "Documentation links for the main project"
51
+ ```
52
+
53
+ ---
54
+
55
+ ### List notes in a knowledge base
56
+
57
+ ```
58
+ getnote kb notes <topic_id> [--limit <n>] [--output json|table]
59
+ ```
60
+
61
+ | Flag | Default | Description |
62
+ |------|---------|-------------|
63
+ | `--limit` | 20 | Maximum number of notes to return |
64
+
65
+ **Examples:**
66
+ ```bash
67
+ # List notes in a knowledge base
68
+ getnote kb notes kb_abc123
69
+
70
+ # Get more results
71
+ getnote kb notes kb_abc123 --limit 50
72
+
73
+ # Machine-readable output
74
+ getnote kb notes kb_abc123 --output json
75
+ ```
76
+
77
+ ---
78
+
79
+ ### Add notes to a knowledge base
80
+
81
+ ```
82
+ getnote kb add <topic_id> <note_id> [note_id...]
83
+ ```
84
+
85
+ Supports adding multiple notes in a single call.
86
+
87
+ **Examples:**
88
+ ```bash
89
+ # Add a single note
90
+ getnote kb add kb_abc123 note_xyz789
91
+
92
+ # Add multiple notes at once
93
+ getnote kb add kb_abc123 note_xyz789 note_def456 note_ghi012
94
+ ```
95
+
96
+ ---
97
+
98
+ ### Remove notes from a knowledge base
99
+
100
+ ```
101
+ getnote kb remove <topic_id> <note_id> [note_id...]
102
+ ```
103
+
104
+ Supports removing multiple notes in a single call.
105
+
106
+ **Examples:**
107
+ ```bash
108
+ # Remove a single note
109
+ getnote kb remove kb_abc123 note_xyz789
110
+
111
+ # Remove multiple notes at once
112
+ getnote kb remove kb_abc123 note_xyz789 note_def456
113
+ ```
114
+
115
+ ---
116
+
117
+ ## Agent Usage Notes
118
+
119
+ - Use `--output json` for all commands when parsing responses programmatically.
120
+ - To get a `topic_id`, first call `getnote kb list --output json` and extract the `id` field.
121
+ - `kb add` and `kb remove` accept multiple note IDs in a single call — prefer batching over multiple calls.
122
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.
123
+ - Combine with `getnote note list --output json` to get note IDs before adding them to a knowledge base.
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: getnote-note
3
+ version: 0.1.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
+ - API key configured via `getnote auth login --api-key <key>` or the `GETNOTE_API_KEY` environment variable
15
+
16
+ ## Commands
17
+
18
+ ### Save a note
19
+
20
+ ```
21
+ getnote note save <url|text> [--title <title>] [--tag <tag>]...
22
+ ```
23
+
24
+ | Flag | Description |
25
+ |------|-------------|
26
+ | `--title` | Optional title for the note |
27
+ | `--tag` | Tag to apply; may be repeated |
28
+
29
+ - If the argument starts with `http://` or `https://`, it is saved as a **link note**.
30
+ - Otherwise it is saved as a **text note**.
31
+
32
+ **Examples:**
33
+ ```bash
34
+ # Save a URL
35
+ getnote note save https://example.com/article --title "Interesting article" --tag reading
36
+
37
+ # Save plain text
38
+ getnote note save "Remember to review the API docs" --tag todo
39
+
40
+ # Save with multiple tags
41
+ getnote note save https://docs.example.com --tag docs --tag reference
42
+ ```
43
+
44
+ The response includes a `task_id` you can use to track progress:
45
+ ```bash
46
+ getnote note task <task_id>
47
+ ```
48
+
49
+ ---
50
+
51
+ ### List notes
52
+
53
+ ```
54
+ getnote note list [--limit <n>] [--since-id <id>] [--output json|table]
55
+ ```
56
+
57
+ | Flag | Default | Description |
58
+ |------|---------|-------------|
59
+ | `--limit` | 20 | Maximum number of notes to return |
60
+ | `--since-id` | — | Cursor for pagination (ID of last note seen) |
61
+ | `--output` | table | Output format: `table` or `json` |
62
+
63
+ **Examples:**
64
+ ```bash
65
+ # List recent 20 notes
66
+ getnote note list
67
+
68
+ # List 50 notes
69
+ getnote note list --limit 50
70
+
71
+ # Paginate using cursor
72
+ getnote note list --since-id note_abc123
73
+
74
+ # Machine-readable JSON output
75
+ getnote note list --output json
76
+ ```
77
+
78
+ ---
79
+
80
+ ### Get note details
81
+
82
+ ```
83
+ getnote note get <note_id>
84
+ ```
85
+
86
+ **Example:**
87
+ ```bash
88
+ getnote note get note_abc123
89
+ getnote note get note_abc123 --output json
90
+ ```
91
+
92
+ ---
93
+
94
+ ### Update a note
95
+
96
+ ```
97
+ getnote note update <note_id> [--title <title>] [--content <content>] [--tags <tag1,tag2>]
98
+ ```
99
+
100
+ | Flag | Description |
101
+ |------|-------------|
102
+ | `--title` | New title |
103
+ | `--content` | New content body |
104
+ | `--tags` | Comma-separated tags (replaces all existing tags) |
105
+
106
+ **Example:**
107
+ ```bash
108
+ getnote note update note_abc123 --title "Updated title" --tags "work,important"
109
+ ```
110
+
111
+ ---
112
+
113
+ ### Delete a note
114
+
115
+ ```
116
+ getnote note delete <note_id> [--yes]
117
+ ```
118
+
119
+ | Flag | Description |
120
+ |------|-------------|
121
+ | `--yes` | Skip the confirmation prompt |
122
+
123
+ **Examples:**
124
+ ```bash
125
+ # Interactive confirmation
126
+ getnote note delete note_abc123
127
+
128
+ # Skip confirmation (useful in scripts)
129
+ getnote note delete note_abc123 --yes
130
+ ```
131
+
132
+ ---
133
+
134
+ ### Query task progress
135
+
136
+ ```
137
+ getnote note task <task_id>
138
+ ```
139
+
140
+ Use this after `note save` to check whether a URL has been processed.
141
+
142
+ **Example:**
143
+ ```bash
144
+ getnote note task task_xyz789
145
+ getnote note task task_xyz789 --output json
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Agent Usage Notes
151
+
152
+ - Use `--output json` for all commands when parsing responses programmatically.
153
+ - `note save` may be async for URLs; poll `note task <task_id>` until `status` is `done`.
154
+ - `note list --output json` returns a JSON array suitable for further processing with `jq`.
155
+ - Pass `--yes` to `note delete` to avoid interactive prompts in automated workflows.
156
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: getnote-search
3
+ version: 0.1.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 in Get笔记.
10
+
11
+ ## Prerequisites
12
+
13
+ - `getnote` CLI installed and authenticated (`getnote auth status` should show "Authenticated")
14
+ - API key configured via `getnote auth login --api-key <key>` or the `GETNOTE_API_KEY` environment variable
15
+
16
+ ## Commands
17
+
18
+ ### Search notes
19
+
20
+ ```
21
+ getnote search <query> [--kb <topic_id>] [--limit <n>] [--output json|table]
22
+ ```
23
+
24
+ | Flag | Default | Description |
25
+ |------|---------|-------------|
26
+ | `--kb` | — | Limit search to a specific knowledge base (topic_id) |
27
+ | `--limit` | 10 | Max results to return (max 10) |
28
+ | `--output` | table | Output format: `table` or `json` |
29
+
30
+ **Examples:**
31
+ ```bash
32
+ # Search across all notes
33
+ getnote search "大模型 API"
34
+
35
+ # Search within a specific knowledge base
36
+ getnote search "RAG" --kb qnNX75j0
37
+
38
+ # Limit results and get JSON output
39
+ getnote search "机器学习" --limit 5 --output json
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Agent Usage Notes
45
+
46
+ - Use `--output json` when parsing results programmatically.
47
+ - To search within a knowledge base, first get the `topic_id` via `getnote kb list --output json`.
48
+ - Results are ranked by semantic relevance, not recency.
49
+ - Max `--limit` is 10; for broader discovery use `getnote notes list` instead.
50
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: getnote-tag
3
+ version: 0.1.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 in Get笔记.
10
+
11
+ ## Prerequisites
12
+
13
+ - `getnote` CLI installed and authenticated (`getnote auth status` should show "Authenticated")
14
+ - API key configured via `getnote auth login --api-key <key>` or the `GETNOTE_API_KEY` environment variable
15
+
16
+ ## Commands
17
+
18
+ ### List tags on a note
19
+
20
+ ```
21
+ getnote tag list <note_id> [--output json|table]
22
+ ```
23
+
24
+ **Examples:**
25
+ ```bash
26
+ getnote tag list 1896830231705320746
27
+ getnote tag list 1896830231705320746 --output json
28
+ ```
29
+
30
+ Returns tag list including tag IDs (needed for `tag remove`).
31
+
32
+ ---
33
+
34
+ ### Add a tag to a note
35
+
36
+ ```
37
+ getnote tag add <note_id> <tag>
38
+ ```
39
+
40
+ **Examples:**
41
+ ```bash
42
+ getnote tag add 1896830231705320746 工作
43
+ getnote tag add 1896830231705320746 阅读
44
+ ```
45
+
46
+ ---
47
+
48
+ ### Remove a tag from a note
49
+
50
+ ```
51
+ getnote tag remove <note_id> <tag_id>
52
+ ```
53
+
54
+ > ⚠️ Requires **tag ID** (not tag name). Use `getnote tag list <note_id>` to find the tag ID first.
55
+ > System tags cannot be removed.
56
+
57
+ **Examples:**
58
+ ```bash
59
+ # First, find the tag ID
60
+ getnote tag list 1896830231705320746 --output json
61
+
62
+ # Then remove by tag ID
63
+ getnote tag remove 1896830231705320746 123
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Agent Usage Notes
69
+
70
+ - Use `--output json` on `tag list` to get tag IDs for use with `tag remove`.
71
+ - `tag remove` takes a **tag ID** (integer), not a tag name — always call `tag list` first if you only have the name.
72
+ - System tags cannot be deleted; the CLI will return an error if attempted.
73
+ - Exit code `0` = success; non-zero = error. Error details go to stderr.