@getnote/cli 0.1.6 → 0.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getnote/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "CLI tool for Get笔记 — manage notes and knowledge bases from the terminal",
5
5
  "keywords": [
6
6
  "getnote",
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: getnote-auth
3
- version: 0.1.0
3
+ version: 0.3.0
4
4
  description: Manage authentication for Get笔记 CLI
5
5
  ---
6
6
 
7
7
  # getnote-auth Skill
8
8
 
9
- Log in, log out, and check authentication status for the `getnote` CLI.
9
+ Log in, log out, and check authentication status.
10
10
 
11
11
  ## Commands
12
12
 
@@ -16,26 +16,23 @@ Log in, log out, and check authentication status for the `getnote` CLI.
16
16
  getnote auth login [--api-key <key>] [--client-id <id>]
17
17
  ```
18
18
 
19
- Two modes:
20
-
21
19
  | Mode | Command | Description |
22
20
  |------|---------|-------------|
23
21
  | 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 |
22
+ | API Key | `getnote auth login --api-key <key>` | Saves key directly, no browser needed |
25
23
 
26
- **Examples:**
27
24
  ```bash
28
25
  # OAuth flow (opens browser)
29
26
  getnote auth login
30
27
 
31
- # Direct API key
28
+ # API key directly
32
29
  getnote auth login --api-key gk_live_xxx
33
30
 
34
31
  # API key + Client ID
35
32
  getnote auth login --api-key gk_live_xxx --client-id cli_xxx
36
33
  ```
37
34
 
38
- API keys start with `gk_live_`. Get yours at: https://www.biji.com/settings/developer
35
+ Get your API key at: https://www.biji.com/settings/developer (keys start with `gk_live_`)
39
36
 
40
37
  ---
41
38
 
@@ -45,9 +42,8 @@ API keys start with `gk_live_`. Get yours at: https://www.biji.com/settings/deve
45
42
  getnote auth status
46
43
  ```
47
44
 
48
- Shows whether the CLI is authenticated and which API key is in use.
45
+ Shows whether authenticated and which API key is active.
49
46
 
50
- **Example:**
51
47
  ```bash
52
48
  getnote auth status
53
49
  ```
@@ -60,9 +56,8 @@ getnote auth status
60
56
  getnote auth logout
61
57
  ```
62
58
 
63
- Removes the saved API key from local config.
59
+ Removes saved credentials from `~/.getnote/config.json`.
64
60
 
65
- **Example:**
66
61
  ```bash
67
62
  getnote auth logout
68
63
  ```
@@ -71,7 +66,7 @@ getnote auth logout
71
66
 
72
67
  ## Agent Usage Notes
73
68
 
74
- - Always run `getnote auth status` before other commands to verify authentication.
69
+ - Always run `getnote auth status` first to verify authentication before other commands.
75
70
  - 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.
71
+ - `--api-key` on any command is a temporary per-invocation override and does not save credentials.
72
+ - Credentials saved at `~/.getnote/config.json`; env vars `GETNOTE_API_KEY` / `GETNOTE_CLIENT_ID` take higher priority.
@@ -1,79 +1,68 @@
1
1
  ---
2
2
  name: getnote-kb
3
- version: 0.1.0
3
+ version: 0.3.0
4
4
  description: Manage knowledge bases in Get笔记 via the getnote CLI
5
5
  ---
6
6
 
7
7
  # getnote-kb Skill
8
8
 
9
- Manage knowledge bases (话题/topic) in Get笔记 — list, create, and add or remove notes.
9
+ Manage knowledge bases — list, create, browse notes, add/remove notes.
10
10
 
11
11
  ## Prerequisites
12
12
 
13
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
14
 
16
15
  ## Commands
17
16
 
18
- ### List knowledge bases
17
+ ### List all knowledge bases
19
18
 
20
19
  ```
21
- getnote kb list [--output json|table]
20
+ getnote kbs
22
21
  ```
23
22
 
24
- Returns all knowledge bases accessible to the authenticated user.
23
+ Returns all knowledge bases. Each item includes: `topic_id`, `name`, `description`, `note_count`, `created_at`.
25
24
 
26
- **Examples:**
27
25
  ```bash
28
- # Human-friendly table
29
- getnote kb list
30
-
31
- # Machine-readable JSON
32
- getnote kb list --output json
26
+ getnote kbs
27
+ getnote kbs -o json
33
28
  ```
34
29
 
35
30
  ---
36
31
 
37
- ### Create a knowledge base
32
+ ### List notes in a knowledge base
38
33
 
39
34
  ```
40
- getnote kb create <name> [--desc <description>]
35
+ getnote kb <topic_id> [--limit <n>] [--all]
41
36
  ```
42
37
 
43
- | Flag | Description |
44
- |------|-------------|
45
- | `--desc` | Optional description for the knowledge base |
38
+ Returns 20 notes per page by default.
39
+
40
+ | Flag | Default | Description |
41
+ |------|---------|-------------|
42
+ | `--limit` | 20 | Notes per page |
43
+ | `--all` | — | Fetch all notes (auto-paginate) |
46
44
 
47
- **Examples:**
48
45
  ```bash
49
- getnote kb create "Research Papers"
50
- getnote kb create "Project Docs" --desc "Documentation links for the main project"
46
+ getnote kb vnrOAaGY
47
+ getnote kb vnrOAaGY --all
48
+ getnote kb vnrOAaGY -o json
51
49
  ```
52
50
 
53
51
  ---
54
52
 
55
- ### List notes in a knowledge base
53
+ ### Create a knowledge base
56
54
 
57
55
  ```
58
- getnote kb notes <topic_id> [--limit <n>] [--output json|table]
56
+ getnote kb create <name> [--desc <description>]
59
57
  ```
60
58
 
61
- | Flag | Default | Description |
62
- |------|---------|-------------|
63
- | `--limit` | 20 | Maximum number of notes to return |
64
-
65
- **Examples:**
66
59
  ```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
60
+ getnote kb create "Research Papers"
61
+ getnote kb create "Project Docs" --desc "Documentation links"
75
62
  ```
76
63
 
64
+ > Max 50 knowledge bases per day (resets at 00:00 Beijing time).
65
+
77
66
  ---
78
67
 
79
68
  ### Add notes to a knowledge base
@@ -82,17 +71,15 @@ getnote kb notes kb_abc123 --output json
82
71
  getnote kb add <topic_id> <note_id> [note_id...]
83
72
  ```
84
73
 
85
- Supports adding multiple notes in a single call.
74
+ Supports multiple note IDs. Max 20 per call.
86
75
 
87
- **Examples:**
88
76
  ```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
77
+ getnote kb add vnrOAaGY 1234567890
78
+ getnote kb add vnrOAaGY 1234567890 9876543210
94
79
  ```
95
80
 
81
+ > Already-existing notes are silently skipped.
82
+
96
83
  ---
97
84
 
98
85
  ### Remove notes from a knowledge base
@@ -101,23 +88,15 @@ getnote kb add kb_abc123 note_xyz789 note_def456 note_ghi012
101
88
  getnote kb remove <topic_id> <note_id> [note_id...]
102
89
  ```
103
90
 
104
- Supports removing multiple notes in a single call.
105
-
106
- **Examples:**
107
91
  ```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
92
+ getnote kb remove vnrOAaGY 1234567890
113
93
  ```
114
94
 
115
95
  ---
116
96
 
117
97
  ## Agent Usage Notes
118
98
 
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.
99
+ - Use `-o json` when parsing results programmatically.
100
+ - Get `topic_id` from `getnote kbs -o json` (the `topic_id` field, not `id`).
101
+ - `kb add` / `kb remove` accept multiple note IDs — prefer batching over multiple calls.
122
102
  - 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.
@@ -1,156 +1,151 @@
1
1
  ---
2
2
  name: getnote-note
3
- version: 0.1.0
3
+ version: 0.3.0
4
4
  description: Manage notes in Get笔记 via the getnote CLI
5
5
  ---
6
6
 
7
7
  # getnote-note Skill
8
8
 
9
- Manage individual notes in Get笔记 — save, list, get, update, delete, and track save tasks.
9
+ Save, list, view, update, and delete notes in Get笔记.
10
10
 
11
11
  ## Prerequisites
12
12
 
13
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
14
 
16
15
  ## Commands
17
16
 
18
17
  ### Save a note
19
18
 
20
19
  ```
21
- getnote note save <url|text> [--title <title>] [--tag <tag>]...
20
+ getnote save <url|text|image_path> [--title <title>] [--tag <tag>]...
22
21
  ```
23
22
 
24
23
  | Flag | Description |
25
24
  |------|-------------|
26
- | `--title` | Optional title for the note |
25
+ | `--title` | Optional title |
27
26
  | `--tag` | Tag to apply; may be repeated |
28
27
 
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**.
28
+ - URL (`http://` or `https://`) → link note (async, auto-polls until done)
29
+ - Local image path → image note (async, auto-polls until done)
30
+ - Otherwise → text note (sync)
31
31
 
32
- **Examples:**
33
32
  ```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
33
+ getnote save https://example.com --title "Great article"
34
+ getnote save "Remember to review the docs" --tag work --tag important
35
+ getnote save ./screenshot.png --title "Design mockup"
42
36
  ```
43
37
 
44
- The response includes a `task_id` you can use to track progress:
45
- ```bash
46
- getnote note task <task_id>
47
- ```
38
+ In `-o json` mode, silently polls and returns the final note JSON (including `title`, `content`/summary, `note_type`, `tags`, `created_at`).
48
39
 
49
40
  ---
50
41
 
51
- ### List notes
42
+ ### Track save task
52
43
 
53
44
  ```
54
- getnote note list [--limit <n>] [--since-id <id>] [--output json|table]
45
+ getnote task <task_id>
55
46
  ```
56
47
 
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` |
48
+ Manually check progress of an async save task.
62
49
 
63
- **Examples:**
64
50
  ```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
51
+ getnote task task_xyz789 -o json
76
52
  ```
77
53
 
54
+ Returns `status` (`pending` / `processing` / `success` / `failed`) and `note_id` when done.
55
+
78
56
  ---
79
57
 
80
- ### Get note details
58
+ ### List recent notes
81
59
 
82
60
  ```
83
- getnote note get <note_id>
61
+ getnote notes [--since-id <id>] [--all]
84
62
  ```
85
63
 
86
- **Example:**
64
+ Returns 20 notes per page (fixed). No `--limit` flag.
65
+
66
+ | Flag | Description |
67
+ |------|-------------|
68
+ | `--since-id` | Pagination cursor (last note ID seen) |
69
+ | `--all` | Fetch all notes (auto-paginate, streams output) |
70
+
87
71
  ```bash
88
- getnote note get note_abc123
89
- getnote note get note_abc123 --output json
72
+ getnote notes
73
+ getnote notes --all
74
+ getnote notes --since-id 1234567890
75
+ getnote notes -o json
90
76
  ```
91
77
 
78
+ **Note types**: `plain_text` / `img_text` / `link` / `audio` / `meeting` / `local_audio` / `internal_record` / `class_audio` / `recorder_audio` / `recorder_flash_audio`
79
+
92
80
  ---
93
81
 
94
- ### Update a note
82
+ ### Get note details
95
83
 
96
84
  ```
97
- getnote note update <note_id> [--title <title>] [--content <content>] [--tags <tag1,tag2>]
85
+ getnote note <id> [--field <field>]
98
86
  ```
99
87
 
100
- | Flag | Description |
88
+ Returns full note including content, tags, attachments. Use `--field` to extract a single value.
89
+
90
+ | `--field` values | Description |
101
91
  |------|-------------|
102
- | `--title` | New title |
103
- | `--content` | New content body |
104
- | `--tags` | Comma-separated tags (replaces all existing tags) |
92
+ | `id` | Note ID |
93
+ | `title` | Title |
94
+ | `content` | Content / AI summary |
95
+ | `type` | Note type |
96
+ | `created_at` | Creation time |
97
+ | `updated_at` | Last updated time |
98
+ | `url` | Source URL (link notes) |
99
+ | `excerpt` | Excerpt |
105
100
 
106
- **Example:**
107
101
  ```bash
108
- getnote note update note_abc123 --title "Updated title" --tags "work,important"
102
+ getnote note 1234567890
103
+ getnote note 1234567890 --field content
104
+ getnote note 1234567890 --field url
105
+ getnote note 1234567890 -o json
109
106
  ```
110
107
 
111
108
  ---
112
109
 
113
- ### Delete a note
110
+ ### Update a note
114
111
 
115
112
  ```
116
- getnote note delete <note_id> [--yes]
113
+ getnote note update <id> [--title <title>] [--content <content>] [--tag <tags>]
117
114
  ```
118
115
 
119
116
  | Flag | Description |
120
117
  |------|-------------|
121
- | `--yes` | Skip the confirmation prompt |
118
+ | `--title` | New title |
119
+ | `--content` | New content (plain_text notes only) |
120
+ | `--tag` | Comma-separated tags — **replaces all existing tags** |
122
121
 
123
- **Examples:**
124
122
  ```bash
125
- # Interactive confirmation
126
- getnote note delete note_abc123
127
-
128
- # Skip confirmation (useful in scripts)
129
- getnote note delete note_abc123 --yes
123
+ getnote note update 1234567890 --title "Updated title"
124
+ getnote note update 1234567890 --tag "work,important"
130
125
  ```
131
126
 
127
+ > ⚠️ `--tag` replaces all tags. For partial tag changes use `getnote tag add/remove`.
128
+ > ⚠️ Content update only works on `plain_text` notes.
129
+
132
130
  ---
133
131
 
134
- ### Query task progress
132
+ ### Delete a note
135
133
 
136
134
  ```
137
- getnote note task <task_id>
135
+ getnote note delete <id> [-y]
138
136
  ```
139
137
 
140
- Use this after `note save` to check whether a URL has been processed.
138
+ Moves note to trash.
141
139
 
142
- **Example:**
143
140
  ```bash
144
- getnote note task task_xyz789
145
- getnote note task task_xyz789 --output json
141
+ getnote note delete 1234567890 -y
146
142
  ```
147
143
 
148
144
  ---
149
145
 
150
146
  ## Agent Usage Notes
151
147
 
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.
148
+ - Use `-o json` when parsing responses programmatically.
149
+ - `notes` list returns **20 per page** (no `--limit`); paginate with `--since-id`.
150
+ - Note IDs are int64 — always handle as strings to avoid precision loss in JavaScript.
156
151
  - Exit code `0` = success; non-zero = error. Error details go to stderr.
@@ -1,50 +1,51 @@
1
1
  ---
2
2
  name: getnote-search
3
- version: 0.1.0
3
+ version: 0.3.0
4
4
  description: Semantic search across notes in Get笔记 via the getnote CLI
5
5
  ---
6
6
 
7
7
  # getnote-search Skill
8
8
 
9
- Semantic search across all notes or within a specific knowledge base in Get笔记.
9
+ Semantic search across all notes or within a specific knowledge base.
10
10
 
11
11
  ## Prerequisites
12
12
 
13
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
14
 
16
15
  ## Commands
17
16
 
18
17
  ### Search notes
19
18
 
20
19
  ```
21
- getnote search <query> [--kb <topic_id>] [--limit <n>] [--output json|table]
20
+ getnote search <query> [--kb <topic_id>] [--limit <n>]
22
21
  ```
23
22
 
24
23
  | Flag | Default | Description |
25
24
  |------|---------|-------------|
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` |
25
+ | `--kb` | — | Limit search to a knowledge base (`topic_id`) |
26
+ | `--limit` | 10 | Max results (max 10) |
27
+
28
+ Results are ranked by semantic relevance (high → low). Each result includes: `note_id`, `title`, `content` (excerpt), `created_at`, `note_type`.
29
+
30
+ > Note: `note_id` is only populated for `NOTE` type results. Other types (`FILE`, `BLOGGER`, `LIVE`, etc.) return an empty `note_id`.
29
31
 
30
- **Examples:**
31
32
  ```bash
32
33
  # Search across all notes
33
34
  getnote search "大模型 API"
34
35
 
35
- # Search within a specific knowledge base
36
+ # Search within a knowledge base
36
37
  getnote search "RAG" --kb qnNX75j0
37
38
 
38
- # Limit results and get JSON output
39
- getnote search "机器学习" --limit 5 --output json
39
+ # Limit results + JSON output
40
+ getnote search "机器学习" --limit 5 -o json
40
41
  ```
41
42
 
42
43
  ---
43
44
 
44
45
  ## Agent Usage Notes
45
46
 
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.
47
+ - Use `-o json` when parsing results programmatically.
48
+ - Get `topic_id` for `--kb` from `getnote kbs -o json`.
49
+ - For `NOTE` type results, use `getnote note <note_id>` to get the full content.
50
+ - Max `--limit` is 10; use `getnote notes` for browsing without a query.
50
51
  - Exit code `0` = success; non-zero = error. Error details go to stderr.
@@ -1,65 +1,65 @@
1
1
  ---
2
2
  name: getnote-tag
3
- version: 0.1.0
3
+ version: 0.3.0
4
4
  description: Manage note tags in Get笔记 via the getnote CLI
5
5
  ---
6
6
 
7
7
  # getnote-tag Skill
8
8
 
9
- Add, list, and remove tags on notes in Get笔记.
9
+ Add, list, and remove tags on notes.
10
10
 
11
11
  ## Prerequisites
12
12
 
13
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
14
 
16
15
  ## Commands
17
16
 
18
17
  ### List tags on a note
19
18
 
20
19
  ```
21
- getnote tag list <note_id> [--output json|table]
20
+ getnote tag list <note_id>
22
21
  ```
23
22
 
24
- **Examples:**
23
+ Returns all tags with their IDs and types.
24
+
25
+ Tag types:
26
+ - `ai` — auto-generated by AI
27
+ - `manual` — added by the user
28
+ - `system` — system tag (**cannot be deleted**)
29
+
25
30
  ```bash
26
31
  getnote tag list 1896830231705320746
27
- getnote tag list 1896830231705320746 --output json
32
+ getnote tag list 1896830231705320746 -o json
28
33
  ```
29
34
 
30
- Returns tag list including tag IDs (needed for `tag remove`).
31
-
32
35
  ---
33
36
 
34
- ### Add a tag to a note
37
+ ### Add a tag
35
38
 
36
39
  ```
37
40
  getnote tag add <note_id> <tag>
38
41
  ```
39
42
 
40
- **Examples:**
41
43
  ```bash
42
44
  getnote tag add 1896830231705320746 工作
43
- getnote tag add 1896830231705320746 阅读
44
45
  ```
45
46
 
46
47
  ---
47
48
 
48
- ### Remove a tag from a note
49
+ ### Remove a tag
49
50
 
50
51
  ```
51
52
  getnote tag remove <note_id> <tag_id>
52
53
  ```
53
54
 
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.
55
+ > ⚠️ Requires **tag ID** (integer from `tag list`), not tag name.
56
+ > ⚠️ `system` type tags cannot be removed.
56
57
 
57
- **Examples:**
58
58
  ```bash
59
- # First, find the tag ID
60
- getnote tag list 1896830231705320746 --output json
59
+ # Step 1: get tag IDs
60
+ getnote tag list 1896830231705320746 -o json
61
61
 
62
- # Then remove by tag ID
62
+ # Step 2: remove by tag ID
63
63
  getnote tag remove 1896830231705320746 123
64
64
  ```
65
65
 
@@ -67,7 +67,6 @@ getnote tag remove 1896830231705320746 123
67
67
 
68
68
  ## Agent Usage Notes
69
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.
70
+ - `tag remove` takes a **numeric tag ID**, not a name — always call `tag list` first.
71
+ - To replace all tags at once, use `getnote note update --tag "tag1,tag2"` instead.
73
72
  - Exit code `0` = success; non-zero = error. Error details go to stderr.