@zentodo/cli 0.1.1 → 0.1.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/dist/bin.cjs +7929 -0
- package/dist/bin.js +7831 -6
- package/dist/skills/zentodo/SKILL.md +239 -0
- package/dist/skills/zentodo/examples/plan-my-day.md +12 -0
- package/dist/skills/zentodo/examples/sync.md +9 -0
- package/dist/skills/zentodo/references/commands.md +1413 -0
- package/dist/skills/zentodo/references/error-codes.md +62 -0
- package/dist/skills/zentodo/references/mapping.md +115 -0
- package/dist/skills/zentodo/references/tools.json +4008 -0
- package/dist/skills/zentodo/references/tools.md +1346 -0
- package/dist/skills/zentodo/skill.json +15 -0
- package/package.json +8 -11
- package/scripts/postinstall.mjs +1 -0
- package/skills/zentodo/skill.json +8 -8
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# 错误码 & 退出码
|
|
2
|
+
|
|
3
|
+
当 `ok === false` 时,ZenTodo CLI / Skill 返回的 `error` 对象结构统一为:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
{
|
|
7
|
+
"ok": false,
|
|
8
|
+
"data": null,
|
|
9
|
+
"error": {
|
|
10
|
+
"code": "ErrXxx",
|
|
11
|
+
"message": "可读描述",
|
|
12
|
+
"detail": <后端原始负载>,
|
|
13
|
+
"hint": "修复建议"
|
|
14
|
+
},
|
|
15
|
+
"meta": { "requestId": "...", "durationMs": N, "scopeChecked": [...] }
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 错误码
|
|
20
|
+
|
|
21
|
+
| Code | HTTP 来源 | 含义 | 建议处理 |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `ErrUnknown` | 兜底 | 未知错误 | 重试,检查 `detail` |
|
|
24
|
+
| `ErrUsage` | — | CLI 参数错误或工具入参错误 | 查看 `--help` |
|
|
25
|
+
| `ErrConfig` | — | 本地配置异常 | 运行 `zentodo doctor` |
|
|
26
|
+
| `ErrNetwork` | 传输层 | DNS / TLS / socket / 超时 | 稍后重试;检查 `--server` |
|
|
27
|
+
| `ErrOfflineUnsupported` | — | `--local` 但该能力没有离线实现 | 去掉 `--local` 或等待本地模式落地 |
|
|
28
|
+
| `ErrUnauthorized` | 401 | 凭证缺失或无效 | `zentodo auth login-password` |
|
|
29
|
+
| `ErrEnoAuth` | — | 当前 Profile 未登录 | 同上 |
|
|
30
|
+
| `ErrForbidden` | 403 | Token 的 scope 不够 | 重签 scope 更大的 Token |
|
|
31
|
+
| `ErrNotFound` | 404 | 资源不存在 | 核对 key |
|
|
32
|
+
| `ErrConflict` | 409 | 同步冲突 | `zentodo sync conflict resolve ...`(后续版本) |
|
|
33
|
+
| `ErrValidation` | 422 | 后端拒绝入参 | 看 `detail.message` |
|
|
34
|
+
| `ErrRateLimit` | 429 | 服务器要求退避 | 客户端已按 `Retry-After` 自动重试;高频循环请降低 QPS |
|
|
35
|
+
| `ErrServer` | 5xx | 后端错误 | 重试;必要时提单 |
|
|
36
|
+
| `ErrInvalidFlags` | — | 互斥的输出 flag 同时出现 | `--json` / `--ndjson` / `--yaml` 三选一 |
|
|
37
|
+
| `ErrInvalidSetting` | — | 未知的 settings key | `zentodo settings get` 查看已有 key |
|
|
38
|
+
|
|
39
|
+
## 退出码
|
|
40
|
+
|
|
41
|
+
| Exit | Error codes | 含义 |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| 0 | — | 成功 |
|
|
44
|
+
| 1 | `ErrUnknown` 及兜底 | 通用失败 |
|
|
45
|
+
| 2 | `ErrUsage`、`ErrInvalidFlags`、`ErrInvalidSetting` | 调用方用法错误 |
|
|
46
|
+
| 3 | `ErrConfig` | 配置问题 |
|
|
47
|
+
| 4 | `ErrNetwork` | 网络失败 |
|
|
48
|
+
| 5 | `ErrOfflineUnsupported` | 本地模式不支持该操作 |
|
|
49
|
+
| 401 | `ErrUnauthorized`、`ErrEnoAuth` | 认证失败 |
|
|
50
|
+
| 403 | `ErrForbidden` | Scope 不足 |
|
|
51
|
+
| 404 | `ErrNotFound` | 资源不存在 |
|
|
52
|
+
| 409 | `ErrConflict` | 同步冲突 |
|
|
53
|
+
| 422 | `ErrValidation` | 入参被拒绝 |
|
|
54
|
+
| 429 | `ErrRateLimit` | 触发限流 |
|
|
55
|
+
| 500 | `ErrServer` | 后端错误 |
|
|
56
|
+
|
|
57
|
+
在 Shell 脚本中可以这样判断:
|
|
58
|
+
|
|
59
|
+
```pwsh
|
|
60
|
+
zentodo task get --task-key 999
|
|
61
|
+
if ($LASTEXITCODE -eq 404) { echo "未找到" }
|
|
62
|
+
```
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# CLI ↔ Skill ↔ 后端 对照表
|
|
2
|
+
|
|
3
|
+
| 领域 | CLI 命令 | MCP 工具 | 后端端点 | Scope |
|
|
4
|
+
| --- | --- | --- | --- | --- |
|
|
5
|
+
| auth | `zentodo auth login-password` | `zentodo.auth.login-password` | `POST /userController/loginXzbb` | read |
|
|
6
|
+
| auth | `zentodo auth email-code` | `zentodo.auth.email-code` | `POST /userController/sendAuthEmailCode` | read |
|
|
7
|
+
| auth | `zentodo auth register` | `zentodo.auth.register` | `POST /userController/regisiterApp` | write |
|
|
8
|
+
| auth | `zentodo auth find-password` | `zentodo.auth.find-password` | `POST /userController/findPasswordByUsrEmail` | read |
|
|
9
|
+
| auth | `zentodo auth change-password` | `zentodo.auth.change-password` | `POST /userController/updateUserWithoutPhoto` | write |
|
|
10
|
+
| auth | `zentodo auth delete-account` | `zentodo.auth.delete-account` | `POST /userController/deleteUsrByUsrKey` | destructive, admin |
|
|
11
|
+
| auth | `zentodo auth email-exists` | `zentodo.auth.email-exists` | `POST /userController/isEmailExist` | read |
|
|
12
|
+
| auth | `zentodo auth phone-exists` | `zentodo.auth.phone-exists` | `POST /userController/isPhoneExist` | read |
|
|
13
|
+
| user | `zentodo user info` | `zentodo.user.info` | `POST /userController/getUserInfoByUsrKey` | read |
|
|
14
|
+
| user | `zentodo user update` | `zentodo.user.update` | `POST /userController/updateUserWithoutPhoto` | write |
|
|
15
|
+
| user | `zentodo user avatar-get` | `zentodo.user.avatar-get` | `POST /userController/getUserAvatarByUsrKey` | read |
|
|
16
|
+
| user | `zentodo user invite-code` | `zentodo.user.invite-code` | `POST /userController/getInviteCodeByUsrKey` | read |
|
|
17
|
+
| user | `zentodo user reward-coin-get` | `zentodo.user.reward-coin-get` | `POST /userController/getRewardCoinByUsrKey` | read |
|
|
18
|
+
| user | `zentodo user reward-coin-set` | `zentodo.user.reward-coin-set` | `POST /userController/setRewardCoinByUsrKey` | write, destructive |
|
|
19
|
+
| user | `zentodo user vip-set` | `zentodo.user.vip-set` | `POST /userController/setVipEndDate` | write, admin |
|
|
20
|
+
| user | `zentodo user restore-default-label` | `zentodo.user.restore-default-label` | `POST /userController/restoreDefaultLabel` | destructive, write |
|
|
21
|
+
| task | `zentodo task add` | `zentodo.task.add` | `POST /taskController/insertTask` | write |
|
|
22
|
+
| task | `zentodo task update` | `zentodo.task.update` | `POST /taskController/updateTask` | write |
|
|
23
|
+
| task | `zentodo task delete` | `zentodo.task.delete` | `POST /taskController/updateTask` | destructive, write |
|
|
24
|
+
| task | `zentodo task complete` | `zentodo.task.complete` | `POST /taskController/updateTask` | write |
|
|
25
|
+
| task | `zentodo task uncomplete` | `zentodo.task.uncomplete` | `POST /taskController/updateTask` | write |
|
|
26
|
+
| task | `zentodo task mit` | `zentodo.task.mit` | `POST /taskController/updateTask` | write |
|
|
27
|
+
| task | `zentodo task quadrant` | `zentodo.task.quadrant` | `POST /taskController/updateTask` | write |
|
|
28
|
+
| task | `zentodo task completed-today` | `zentodo.task.completed-today` | `POST /taskController/getCompletedTasks` | read |
|
|
29
|
+
| task | `zentodo task mit-list` | `zentodo.task.mit-list` | `POST /taskController/getMitTasks` | read |
|
|
30
|
+
| task | `zentodo task calendar` | `zentodo.task.calendar` | `POST /taskController/getCalendarTaskByDate` | read |
|
|
31
|
+
| task | `zentodo task move` | `zentodo.task.move` | `POST /taskController/updateTaskCreateTime` | write |
|
|
32
|
+
| task | `zentodo task sync-pull` | `zentodo.task.sync-pull` | `POST /taskController/getSyncTaskList` | sync, read |
|
|
33
|
+
| task | `zentodo task sync-push` | `zentodo.task.sync-push` | `POST /taskController/putSyncTask` | sync, write |
|
|
34
|
+
| task | `zentodo task list` | `zentodo.task.list-all` | `POST /taskController/getAllTaskByUserId` | read |
|
|
35
|
+
| subtask | `zentodo subtask upsert` | `zentodo.subtask.sync-push` | `POST /subTaskController/putSyncSubTask` | sync, write |
|
|
36
|
+
| subtask | `zentodo subtask list` | `zentodo.subtask.list-all` | `POST /subTaskController/getAllSubTaskByUserId` | read |
|
|
37
|
+
| subtask | `zentodo subtask sync-pull` | `zentodo.subtask.sync-pull` | `POST /subTaskController/getSyncSubTaskList` | sync, read |
|
|
38
|
+
| project | `zentodo project upsert` | `zentodo.project.sync-push` | `POST /projectController/putSyncProject` | sync, write |
|
|
39
|
+
| project | `zentodo project list` | `zentodo.project.list-all` | `POST /projectController/getAllProjectByUserId` | read |
|
|
40
|
+
| project | `zentodo project sync-pull` | `zentodo.project.sync-pull` | `POST /projectController/getSyncProjectList` | sync, read |
|
|
41
|
+
| subproject | `zentodo subproject upsert` | `zentodo.subproject.sync-push` | `POST /subProjectController/putSyncSubProject` | sync, write |
|
|
42
|
+
| subproject | `zentodo subproject list` | `zentodo.subproject.list-all` | `POST /subProjectController/getAllSubProjectByUserId` | read |
|
|
43
|
+
| subproject | `zentodo subproject sync-pull` | `zentodo.subproject.sync-pull` | `POST /subProjectController/getSyncSubProjectList` | sync, read |
|
|
44
|
+
| scene | `zentodo scene upsert` | `zentodo.scene.sync-push` | `POST /sceneController/putSyncScene` | sync, write |
|
|
45
|
+
| scene | `zentodo scene list` | `zentodo.scene.list-all` | `POST /sceneController/getAllSceneByUserId` | read |
|
|
46
|
+
| scene | `zentodo scene sync-pull` | `zentodo.scene.sync-pull` | `POST /sceneController/getSyncSceneList` | sync, read |
|
|
47
|
+
| target | `zentodo target upsert` | `zentodo.target.sync-push` | `POST /targetController/putSyncTarget` | sync, write |
|
|
48
|
+
| target | `zentodo target list` | `zentodo.target.list-all` | `POST /targetController/getAllTargetByUserId` | read |
|
|
49
|
+
| target | `zentodo target sync-pull` | `zentodo.target.sync-pull` | `POST /targetController/getSyncTargetList` | sync, read |
|
|
50
|
+
| label | `zentodo label upsert` | `zentodo.label.sync-push` | `POST /labelController/putSyncLabel` | sync, write |
|
|
51
|
+
| label | `zentodo label list` | `zentodo.label.list-all` | `POST /labelController/getAllLabelByUserId` | read |
|
|
52
|
+
| label | `zentodo label upload-bg` | `zentodo.label.upload-bg` | `POST /labelController/uploadLabelBkFile` | write |
|
|
53
|
+
| toplabel | `zentodo toplabel upsert` | `zentodo.toplabel.sync-push` | `POST /topLabelController/putSyncTopLabel` | sync, write |
|
|
54
|
+
| toplabel | `zentodo toplabel list` | `zentodo.toplabel.list-all` | `POST /topLabelController/getAllTopLabelByUserId` | read |
|
|
55
|
+
| toplabel | `zentodo toplabel sync-pull` | `zentodo.toplabel.sync-pull` | `POST /topLabelController/getSyncTopLabelList` | sync, read |
|
|
56
|
+
| quadrant | `zentodo quadrant upsert` | `zentodo.quadrant.sync-push` | `POST /quadrantController/putSyncQuadrant` | sync, write |
|
|
57
|
+
| quadrant | `zentodo quadrant list` | `zentodo.quadrant.list-all` | `POST /quadrantController/getAllQuadrantByUserId` | read |
|
|
58
|
+
| quadrant | `zentodo quadrant sync-pull` | `zentodo.quadrant.sync-pull` | `POST /quadrantController/getSyncQuadrantList` | sync, read |
|
|
59
|
+
| timeline | `zentodo timeline upsert` | `zentodo.timeline.sync-push` | `POST /timeLineController/putSyncTimeLine` | sync, write |
|
|
60
|
+
| timeline | `zentodo timeline list` | `zentodo.timeline.list-all` | `POST /timeLineController/getAllTimeLineByUserId` | read |
|
|
61
|
+
| timeline | `zentodo timeline sync-pull` | `zentodo.timeline.sync-pull` | `POST /timeLineController/getSyncTimeLineList` | sync, read |
|
|
62
|
+
| attach | `zentodo attach upload-task` | `zentodo.attach.upload-task` | `POST /attachmentController/uploadTaskAttachmentFile` | write |
|
|
63
|
+
| attach | `zentodo attach upload-thinkmap` | `zentodo.attach.upload-thinkmap` | `POST /attachmentController/uploadThinkMapAttachmentFile` | write |
|
|
64
|
+
| attach | `zentodo attach upload-rewardstore` | `zentodo.attach.upload-rewardstore` | `POST /attachmentController/uploadRewardStoreFile` | write |
|
|
65
|
+
| attach | `zentodo attach list` | `zentodo.attach.list-all` | `POST /attachmentController/getAllAttachmentByUserId` | read |
|
|
66
|
+
| attach | `zentodo attach sync-pull` | `zentodo.attach.sync-pull` | `POST /attachmentController/getSyncAttachmentList` | sync, read |
|
|
67
|
+
| attach | `zentodo attach sync-push` | `zentodo.attach.sync-push` | `POST /attachmentController/putSyncAttchment` | sync, write |
|
|
68
|
+
| pomo | `zentodo pomo start` | `zentodo.pomo.start` | `POST /timerController/startPomodoro` | write |
|
|
69
|
+
| pomo | `zentodo pomo stop` | `zentodo.pomo.stop` | `POST /timerController/stopTimer` | write |
|
|
70
|
+
| pomo | `zentodo pomo history` | `zentodo.pomo.history` | `POST /tomatoWorkerController/getAllTomatoByUserId` | read |
|
|
71
|
+
| pomo | `zentodo pomo sync-pull-worker` | `zentodo.pomo.sync-pull-worker` | `POST /tomatoWorkerController/getSyncTomatoWorkerList` | sync, read |
|
|
72
|
+
| pomo | `zentodo pomo sync-push-worker` | `zentodo.pomo.sync-push-worker` | `POST /tomatoWorkerController/putSyncTomatoWorker` | sync, write |
|
|
73
|
+
| pomo | `zentodo pomo config-get` | `zentodo.pomo.config-get` | `POST /tomatoConfigController/getAllTomatoConfigByUserId` | read |
|
|
74
|
+
| pomo | `zentodo pomo config-set` | `zentodo.pomo.config-set` | `POST /tomatoConfigController/putSyncTomatoConfig` | sync, write |
|
|
75
|
+
| pomo | `zentodo pomo sync-pull-config` | `zentodo.pomo.sync-pull-config` | `POST /tomatoConfigController/getSyncTomatoConfigList` | sync, read |
|
|
76
|
+
| timer | `zentodo timer start-task` | `zentodo.timer.start-task` | `POST /timerController/startTaskTimer` | write |
|
|
77
|
+
| workstate | `zentodo workstate start` | `zentodo.workstate.start` | `POST /workStateController/saveWorkState` | write |
|
|
78
|
+
| workstate | `zentodo workstate stop` | `zentodo.workstate.stop` | `POST /workStateController/stopWorkState` | write |
|
|
79
|
+
| workstate | `zentodo workstate current` | `zentodo.workstate.current` | `POST /workStateController/getCurrentWorkState` | read |
|
|
80
|
+
| workstate | `zentodo workstate update` | `zentodo.workstate.update` | `POST /workStateController/updateWorkState` | write |
|
|
81
|
+
| workstate | `zentodo workstate list` | `zentodo.workstate.list-all` | `POST /workStateController/getAllWorkStateByUserId` | read |
|
|
82
|
+
| workstate | `zentodo workstate sync-pull` | `zentodo.workstate.sync-pull` | `POST /workStateController/getSyncWorkStateList` | sync, read |
|
|
83
|
+
| workstate | `zentodo workstate sync-push` | `zentodo.workstate.sync-push` | `POST /workStateController/putSyncWorkState` | sync, write |
|
|
84
|
+
| diary | `zentodo diary title-list` | `zentodo.diary.title-list` | `POST /mdTitleController/getAllMDTitleByUserId` | read |
|
|
85
|
+
| diary | `zentodo diary title-sync-pull` | `zentodo.diary.title-sync-pull` | `POST /mdTitleController/getSyncMDTitleList` | sync, read |
|
|
86
|
+
| diary | `zentodo diary title-upsert` | `zentodo.diary.title-sync-push` | `POST /mdTitleController/putSyncMDTitle` | sync, write |
|
|
87
|
+
| diary | `zentodo diary content-list` | `zentodo.diary.content-list` | `POST /mdContentController/getAllMdContentByUserId` | read |
|
|
88
|
+
| diary | `zentodo diary content-sync-pull` | `zentodo.diary.content-sync-pull` | `POST /mdContentController/getSyncMdContentList` | sync, read |
|
|
89
|
+
| diary | `zentodo diary content-upsert` | `zentodo.diary.content-sync-push` | `POST /mdContentController/putSyncMdContent` | sync, write |
|
|
90
|
+
| mindmap | `zentodo mindmap upsert` | `zentodo.mindmap.sync-push` | `POST /gdMetaController/putSyncGDMeta` | sync, write |
|
|
91
|
+
| mindmap | `zentodo mindmap list` | `zentodo.mindmap.list-all` | `POST /gdMetaController/getAllGDMetaByUserId` | read |
|
|
92
|
+
| mindmap | `zentodo mindmap sync-pull` | `zentodo.mindmap.sync-pull` | `POST /gdMetaController/getSyncGDMetaList` | sync, read |
|
|
93
|
+
| reward | `zentodo reward store-upsert` | `zentodo.reward.store-sync-push` | `POST /rewardStoreController/putSyncRewardStore` | sync, write |
|
|
94
|
+
| reward | `zentodo reward store-list` | `zentodo.reward.store-list` | `POST /rewardStoreController/getAllRewardStoreByUserId` | read |
|
|
95
|
+
| reward | `zentodo reward store-sync-pull` | `zentodo.reward.store-sync-pull` | `POST /rewardStoreController/getSyncRewardStoreList` | sync, read |
|
|
96
|
+
| reward | `zentodo reward store-update-file` | `zentodo.reward.store-update-file` | `POST /rewardStoreController/updateRewardStoreFile` | write |
|
|
97
|
+
| reward | `zentodo reward record-upsert` | `zentodo.reward.record-sync-push` | `POST /rewardRecordController/putSyncRewardRecord` | sync, write |
|
|
98
|
+
| reward | `zentodo reward record-list` | `zentodo.reward.record-list` | `POST /rewardRecordController/getAllRewardRecordByUserId` | read |
|
|
99
|
+
| reward | `zentodo reward record-sync-pull` | `zentodo.reward.record-sync-pull` | `POST /rewardRecordController/getSyncRewardRecordList` | sync, read |
|
|
100
|
+
| fasttime | `zentodo fasttime upsert` | `zentodo.fasttime.sync-push` | `POST /fastTimeRecordController/putSyncFastTimeRecord` | sync, write |
|
|
101
|
+
| fasttime | `zentodo fasttime list` | `zentodo.fasttime.list-all` | `POST /fastTimeRecordController/getAllFastTimeByUserId` | read |
|
|
102
|
+
| fasttime | `zentodo fasttime sync-pull` | `zentodo.fasttime.sync-pull` | `POST /fastTimeRecordController/getSyncFastTimeRecordList` | sync, read |
|
|
103
|
+
| wheel | `zentodo wheel upsert` | `zentodo.wheel.sync-push` | `POST /wheelViewController/putSyncWheelView` | sync, write |
|
|
104
|
+
| wheel | `zentodo wheel list` | `zentodo.wheel.list-all` | `POST /wheelViewController/getAllWheelByUserId` | read |
|
|
105
|
+
| wheel | `zentodo wheel sync-pull` | `zentodo.wheel.sync-pull` | `POST /wheelViewController/getSyncWheelViewList` | sync, read |
|
|
106
|
+
| invite | `zentodo invite list` | `zentodo.invite.list-all` | `POST /inviteController/getAllInviteByUserId` | read |
|
|
107
|
+
| app | `zentodo app latest-version` | `zentodo.app.latest-version` | `POST /appUpdateController/getLastestVersionCode` | read |
|
|
108
|
+
| app | `zentodo app update-info` | `zentodo.app.update-info` | `POST /appUpdateController/getLastestAppUpdateItem` | read |
|
|
109
|
+
| app | `zentodo app service-time` | `zentodo.app.service-time` | `POST /serviceController/getServiceTime` | read |
|
|
110
|
+
| pay | `zentodo pay price` | `zentodo.pay.price` | `POST /xzbbPriceController/getXzbbPrice` | read |
|
|
111
|
+
| pay | `zentodo pay wechat-order` | `zentodo.pay.wechat-order` | `POST /payController/getWechatOrderInfo` | pay |
|
|
112
|
+
| pay | `zentodo pay alipay-order` | `zentodo.pay.alipay-order` | `POST /payController/getAlipayOrderInfo` | pay |
|
|
113
|
+
| pay | `zentodo pay coupon` | `zentodo.pay.coupon` | `POST /couponController/getCouponByCouponId` | read |
|
|
114
|
+
| sync | `zentodo sync server-version` | `zentodo.sync.server-version` | `POST /tableRecorderController/getTableRecordLatestVersion` | sync, read |
|
|
115
|
+
| sync | `zentodo sync recorder-list` | `zentodo.sync.recorder-list` | `POST /tableRecorderController/getAllTableRecorderByUserId` | sync, read |
|