@zentodo/cli 0.1.1 → 0.1.3

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.
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "zentodo",
3
+ "version": "0.1.0",
4
+ "entry": "SKILL.md",
5
+ "files": [
6
+ "/examples/plan-my-day.md",
7
+ "/examples/sync.md",
8
+ "/references/commands.md",
9
+ "/references/error-codes.md",
10
+ "/references/mapping.md",
11
+ "/references/tools.json",
12
+ "/references/tools.md",
13
+ "/SKILL.md"
14
+ ]
15
+ }
package/package.json CHANGED
@@ -1,21 +1,18 @@
1
1
  {
2
2
  "name": "@zentodo/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "ZenTodo 命令行工具 — 为 AI Agent 和开发者设计,覆盖任务、项目、番茄钟、日记、同步等全部能力。安装后自动配置 Claude Agent Skill。",
5
5
  "type": "module",
6
6
  "bin": {
7
- "zentodo": "./dist/bin.js"
7
+ "zentodo": "./dist/bin.cjs"
8
8
  },
9
- "main": "./dist/index.js",
10
- "types": "./dist/index.d.ts",
11
9
  "files": [
12
10
  "dist/",
13
11
  "skills/",
14
- "scripts/postinstall.mjs",
15
- "README.md"
12
+ "scripts/postinstall.mjs"
16
13
  ],
17
14
  "scripts": {
18
- "build": "tsc -p tsconfig.json",
15
+ "build": "node build.mjs",
19
16
  "typecheck": "tsc -p tsconfig.json --noEmit",
20
17
  "test": "vitest run",
21
18
  "clean": "rimraf dist *.tsbuildinfo skills/",
@@ -33,12 +30,12 @@
33
30
  "skill",
34
31
  "claude"
35
32
  ],
36
- "dependencies": {
37
- "@zentodo/core": "*",
38
- "commander": "^12.1.0"
39
- },
33
+ "dependencies": {},
40
34
  "devDependencies": {
35
+ "@zentodo/core": "*",
41
36
  "@types/node": "^22.5.0",
37
+ "commander": "^12.1.0",
38
+ "esbuild": "^0.24.0",
42
39
  "rimraf": "^5.0.10",
43
40
  "typescript": "^5.5.4",
44
41
  "vitest": "^2.0.5"
@@ -16,6 +16,7 @@ import { dirname, join } from 'node:path';
16
16
  import { fileURLToPath } from 'node:url';
17
17
 
18
18
  const PKG_DIR = dirname(fileURLToPath(import.meta.url));
19
+ // scripts/postinstall.mjs -> scripts -> cli package root
19
20
  const CLI_ROOT = join(PKG_DIR, '..');
20
21
  const SKILL_SRC = join(CLI_ROOT, 'skills', 'zentodo');
21
22
 
@@ -44,6 +44,16 @@ description: Manage the user's ZenTodo productivity workspace — tasks, subtask
44
44
 
45
45
  2. **登录 ZenTodo**(一次性):
46
46
 
47
+ **推荐:邮箱验证码登录(与 App 端一致)**
48
+ ```bash
49
+ # 第一步:发送验证码到邮箱
50
+ zentodo auth email-code --email 你的邮箱
51
+
52
+ # 第二步:收到验证码后登录(验证码会在后台自动校验)
53
+ zentodo auth login-email --email 你的邮箱
54
+ ```
55
+
56
+ **或者:邮箱 + 密码登录**
47
57
  ```bash
48
58
  zentodo auth login-password --email 你的邮箱 --password 你的密码
49
59
  ```
@@ -126,7 +126,7 @@
126
126
 
127
127
  ### `zentodo auth login-password` _(幂等)_
128
128
 
129
- 邮箱 + 密码登录。
129
+ 邮箱 + 密码登录(PC 端接口)。
130
130
 
131
131
  - **后端端点**:`POST /userController/loginXzbb`
132
132
  - **所需 scope**:`read`
@@ -143,6 +143,26 @@
143
143
  zentodo auth login-password --email a@b.com --password ****
144
144
  ```
145
145
 
146
+ ### `zentodo auth login-email` _(幂等)_
147
+
148
+ 邮箱验证码登录(App 端接口,推荐)。
149
+
150
+ - **后端端点**:`POST /userController/emailLogin`
151
+ - **所需 scope**:`read`
152
+ - **对应 Skill 工具**:`zentodo.auth.login-email`
153
+
154
+ | 参数 | 类型 | 必填 | 说明 |
155
+ | --- | --- | --- | --- |
156
+ | `email` | string | 是 | 账号邮箱。 |
157
+ | `invite_code` | string | 否 | 邀请码(可选)。 |
158
+ | `password` | string | 否 | 密码(传空字符串即可)。 |
159
+
160
+ **示例:**
161
+
162
+ ```
163
+ zentodo auth login-email --email a@b.com
164
+ ```
165
+
146
166
  ### `zentodo auth email-code`
147
167
 
148
168
  发送邮箱登录验证码。
@@ -3,6 +3,7 @@
3
3
  | 领域 | CLI 命令 | MCP 工具 | 后端端点 | Scope |
4
4
  | --- | --- | --- | --- | --- |
5
5
  | auth | `zentodo auth login-password` | `zentodo.auth.login-password` | `POST /userController/loginXzbb` | read |
6
+ | auth | `zentodo auth login-email` | `zentodo.auth.login-email` | `POST /userController/emailLogin` | read |
6
7
  | auth | `zentodo auth email-code` | `zentodo.auth.email-code` | `POST /userController/sendAuthEmailCode` | read |
7
8
  | auth | `zentodo auth register` | `zentodo.auth.register` | `POST /userController/regisiterApp` | write |
8
9
  | auth | `zentodo auth find-password` | `zentodo.auth.find-password` | `POST /userController/findPasswordByUsrEmail` | read |
@@ -37,6 +37,50 @@
37
37
  "shape": "object"
38
38
  }
39
39
  },
40
+ {
41
+ "name": "zentodo.auth.login-email",
42
+ "domain": "auth",
43
+ "action": "login-email",
44
+ "description": "调用 /userController/emailLogin,只需邮箱,配合 email-code 命令先发验证码。返回 usrKey(Long)。",
45
+ "http": {
46
+ "method": "POST",
47
+ "path": "/userController/emailLogin"
48
+ },
49
+ "scopes": [
50
+ "read"
51
+ ],
52
+ "annotations": {
53
+ "readOnly": false,
54
+ "idempotent": true,
55
+ "destructive": false
56
+ },
57
+ "params": [
58
+ {
59
+ "name": "email",
60
+ "backendName": "usrEmail",
61
+ "type": "string",
62
+ "required": true,
63
+ "description": "账号邮箱。"
64
+ },
65
+ {
66
+ "name": "invite_code",
67
+ "backendName": "inviteCode",
68
+ "type": "string",
69
+ "description": "邀请码(可选)。"
70
+ },
71
+ {
72
+ "name": "password",
73
+ "backendName": "usrPwd",
74
+ "type": "string",
75
+ "default": "",
76
+ "sendEmpty": true,
77
+ "description": "密码(传空字符串即可)。"
78
+ }
79
+ ],
80
+ "output": {
81
+ "shape": "scalar"
82
+ }
83
+ },
40
84
  {
41
85
  "name": "zentodo.auth.email-code",
42
86
  "domain": "auth",
@@ -26,6 +26,20 @@
26
26
  | `email` | string | 是 | 账号邮箱。 |
27
27
  | `password` | string | 是 | 账号密码。 |
28
28
 
29
+ ## `zentodo.auth.login-email`
30
+
31
+ 调用 /userController/emailLogin,只需邮箱,配合 email-code 命令先发验证码。返回 usrKey(Long)。
32
+
33
+ - **后端端点**:`POST /userController/emailLogin`
34
+ - **所需 scope**:`read`
35
+ - **标注**:只读=false,幂等=true,破坏性=false
36
+
37
+ | 参数 | 类型 | 必填 | 说明 |
38
+ | --- | --- | --- | --- |
39
+ | `email` | string | 是 | 账号邮箱。 |
40
+ | `invite_code` | string | 否 | 邀请码(可选)。 |
41
+ | `password` | string | 否 | 密码(传空字符串即可)。 |
42
+
29
43
  ## `zentodo.auth.email-code`
30
44
 
31
45
  调用 /userController/sendAuthEmailCode 向指定邮箱发送验证码。
@@ -3,13 +3,13 @@
3
3
  "version": "0.1.0",
4
4
  "entry": "SKILL.md",
5
5
  "files": [
6
- "examples/plan-my-day.md",
7
- "examples/sync.md",
8
- "references/commands.md",
9
- "references/error-codes.md",
10
- "references/mapping.md",
11
- "references/tools.json",
12
- "references/tools.md",
13
- "SKILL.md"
6
+ "/examples/plan-my-day.md",
7
+ "/examples/sync.md",
8
+ "/references/commands.md",
9
+ "/references/error-codes.md",
10
+ "/references/mapping.md",
11
+ "/references/tools.json",
12
+ "/references/tools.md",
13
+ "/SKILL.md"
14
14
  ]
15
15
  }