rote-toolkit 0.3.0 → 0.3.2
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 +16 -8
- package/dist/api.js +1 -2
- package/dist/cli.js +10 -5
- package/dist/mcp.js +3 -5
- package/dist/types.d.ts +1 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ rote config
|
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
系统会提示你输入:
|
|
28
|
+
|
|
28
29
|
1. **Rote API URL**:例如 `https://your-rote-domain.com`
|
|
29
30
|
2. **OpenKey**:你的 API 密钥
|
|
30
31
|
|
|
@@ -38,18 +39,26 @@ rote config
|
|
|
38
39
|
rote add "今天学到了 MCP 协议,非常有趣!"
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
附带标签、设为公开并置顶:
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
|
-
rote add "实现了一个新的前端组件" -t "代码,前端,React"
|
|
45
|
+
rote add "实现了一个新的前端组件" -t "代码,前端,React" --public --pin
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
### 2)
|
|
48
|
+
### 2) 搜索和获取笔记
|
|
49
|
+
|
|
50
|
+
搜索包含 "MCP" 的笔记:
|
|
48
51
|
|
|
49
52
|
```bash
|
|
50
53
|
rote search "MCP"
|
|
51
54
|
```
|
|
52
55
|
|
|
56
|
+
获取最近的笔记(支持过滤归档和标签):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
rote list --limit 5 --archived -t "知识管理"
|
|
60
|
+
```
|
|
61
|
+
|
|
53
62
|
## MCP 模式使用指南
|
|
54
63
|
|
|
55
64
|
启动 MCP Server:
|
|
@@ -71,11 +80,7 @@ rote-mcp
|
|
|
71
80
|
"mcpServers": {
|
|
72
81
|
"rote-toolkit": {
|
|
73
82
|
"command": "npx",
|
|
74
|
-
"args": [
|
|
75
|
-
"-y",
|
|
76
|
-
"rote-toolkit",
|
|
77
|
-
"mcp"
|
|
78
|
-
]
|
|
83
|
+
"args": ["-y", "rote-toolkit", "mcp"]
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
}
|
|
@@ -88,7 +93,9 @@ rote-mcp
|
|
|
88
93
|
- `rote_list_notes`
|
|
89
94
|
|
|
90
95
|
## 本地开发
|
|
96
|
+
|
|
91
97
|
[text](../../../Downloads/API-KEY-GUIDE.md)
|
|
98
|
+
|
|
92
99
|
```bash
|
|
93
100
|
npm install
|
|
94
101
|
npm run build
|
|
@@ -117,6 +124,7 @@ npm run release:major
|
|
|
117
124
|
```
|
|
118
125
|
|
|
119
126
|
发布脚本会执行:
|
|
127
|
+
|
|
120
128
|
1. 检查 git 工作区是否干净
|
|
121
129
|
2. 检查 npm 登录状态
|
|
122
130
|
3. `npm run build`
|
package/dist/api.js
CHANGED
|
@@ -16,8 +16,7 @@ export class RoteClient {
|
|
|
16
16
|
content: input.content,
|
|
17
17
|
title: input.title ?? "",
|
|
18
18
|
tags: input.tags ?? [],
|
|
19
|
-
state: input.
|
|
20
|
-
type: input.type ?? "rote",
|
|
19
|
+
state: input.isPublic ? "public" : "private",
|
|
21
20
|
pin: input.pin ?? false,
|
|
22
21
|
...(input.articleId ? { articleId: input.articleId } : {}),
|
|
23
22
|
};
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
3
4
|
import { createInterface } from "node:readline/promises";
|
|
4
5
|
import { stdin as input, stdout as output } from "node:process";
|
|
5
6
|
import { getConfigPath, saveConfig } from "./config.js";
|
|
@@ -7,7 +8,9 @@ import { RoteClient } from "./api.js";
|
|
|
7
8
|
import { printNotes } from "./output.js";
|
|
8
9
|
import { startMcpServer } from "./mcp.js";
|
|
9
10
|
const program = new Command();
|
|
10
|
-
|
|
11
|
+
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
12
|
+
const cliVersion = packageJson.version ?? "0.0.0";
|
|
13
|
+
program.name("rote").description("Rote Toolkit CLI").version(cliVersion);
|
|
11
14
|
program
|
|
12
15
|
.command("config")
|
|
13
16
|
.alias("login")
|
|
@@ -30,8 +33,7 @@ program
|
|
|
30
33
|
.argument("<content>", "note content")
|
|
31
34
|
.option("-t, --tags <tags>", "comma-separated tags")
|
|
32
35
|
.option("--title <title>", "title")
|
|
33
|
-
.option("--
|
|
34
|
-
.option("--type <type>", "note type", "rote")
|
|
36
|
+
.option("--public", "publish as public note")
|
|
35
37
|
.option("--pin", "pin the note")
|
|
36
38
|
.option("--article-id <articleId>", "bind to an existing article")
|
|
37
39
|
.action(async (content, options) => {
|
|
@@ -41,8 +43,7 @@ program
|
|
|
41
43
|
content,
|
|
42
44
|
tags,
|
|
43
45
|
title: options.title,
|
|
44
|
-
|
|
45
|
-
type: options.type,
|
|
46
|
+
isPublic: options.public,
|
|
46
47
|
pin: options.pin,
|
|
47
48
|
articleId: options.articleId,
|
|
48
49
|
});
|
|
@@ -89,6 +90,8 @@ program
|
|
|
89
90
|
.argument("<action>", "action to perform (get|update)")
|
|
90
91
|
.option("--nickname <nickname>", "new nickname")
|
|
91
92
|
.option("--description <description>", "new description")
|
|
93
|
+
.option("--avatar <url>", "new avatar URL")
|
|
94
|
+
.option("--cover <url>", "new cover URL")
|
|
92
95
|
.option("--username <username>", "new username")
|
|
93
96
|
.action(async (action, options) => {
|
|
94
97
|
const client = new RoteClient();
|
|
@@ -100,6 +103,8 @@ program
|
|
|
100
103
|
const profile = await client.updateProfile({
|
|
101
104
|
nickname: options.nickname,
|
|
102
105
|
description: options.description,
|
|
106
|
+
avatar: options.avatar,
|
|
107
|
+
cover: options.cover,
|
|
103
108
|
username: options.username,
|
|
104
109
|
});
|
|
105
110
|
console.log(`Updated profile for: ${profile.username}`);
|
package/dist/mcp.js
CHANGED
|
@@ -15,21 +15,19 @@ export async function startMcpServer() {
|
|
|
15
15
|
content: z.string().min(1).describe("Note content"),
|
|
16
16
|
title: z.string().optional().describe("Optional note title"),
|
|
17
17
|
tags: z.array(z.string()).optional().describe("Optional list of tags"),
|
|
18
|
-
|
|
19
|
-
type: z.string().optional().describe("Note type, default rote"),
|
|
18
|
+
isPublic: z.boolean().optional().describe("Publish as public note"),
|
|
20
19
|
pin: z.boolean().optional().describe("Whether to pin the note"),
|
|
21
20
|
articleId: z
|
|
22
21
|
.string()
|
|
23
22
|
.optional()
|
|
24
23
|
.describe("Optional article ID to bind to"),
|
|
25
24
|
},
|
|
26
|
-
}, async ({ content, title, tags,
|
|
25
|
+
}, async ({ content, title, tags, isPublic, pin, articleId }) => {
|
|
27
26
|
const note = await client.createNote({
|
|
28
27
|
content,
|
|
29
28
|
title,
|
|
30
29
|
tags,
|
|
31
|
-
|
|
32
|
-
type,
|
|
30
|
+
isPublic,
|
|
33
31
|
pin,
|
|
34
32
|
articleId,
|
|
35
33
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export interface RoteNote {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
tags?: string[];
|
|
10
10
|
state?: string;
|
|
11
|
-
type?: string;
|
|
12
11
|
createdAt?: string;
|
|
13
12
|
updatedAt?: string;
|
|
14
13
|
}
|
|
@@ -21,8 +20,7 @@ export interface CreateNoteInput {
|
|
|
21
20
|
content: string;
|
|
22
21
|
title?: string;
|
|
23
22
|
tags?: string[];
|
|
24
|
-
|
|
25
|
-
type?: string;
|
|
23
|
+
isPublic?: boolean;
|
|
26
24
|
pin?: boolean;
|
|
27
25
|
articleId?: string;
|
|
28
26
|
}
|