@walknpm/todo-cli 1.1.0 → 1.2.0
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 +18 -7
- package/README.zh-CN.md +18 -7
- package/package.json +2 -1
- package/skill/CHANGELOG.md +8 -0
- package/skill/README.md +48 -0
- package/skill/SKILL.md +224 -0
package/README.md
CHANGED
|
@@ -13,11 +13,20 @@ statistics, and export (JSON / CSV / Markdown). Data persists to
|
|
|
13
13
|
|
|
14
14
|
## Quick install
|
|
15
15
|
|
|
16
|
+
**Via npm:**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g @walknpm/todo-cli
|
|
20
|
+
todo --version # → todo v1.1.0
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Via git:**
|
|
24
|
+
|
|
16
25
|
```bash
|
|
17
26
|
git clone https://gitcode.com/hw_aishell_projects/todo_cli.git
|
|
18
27
|
cd todo_cli
|
|
19
28
|
npm install -g .
|
|
20
|
-
todo --version # → todo v1.
|
|
29
|
+
todo --version # → todo v1.1.0
|
|
21
30
|
```
|
|
22
31
|
|
|
23
32
|
## Commands
|
|
@@ -98,6 +107,10 @@ todo_cli/
|
|
|
98
107
|
│ ├── store.js # JSON file persistence layer
|
|
99
108
|
│ ├── todo.js # domain logic (CRUD, search, stats, export, ...)
|
|
100
109
|
│ └── cli.js # command parsing, ANSI colours, table output
|
|
110
|
+
├── skill/
|
|
111
|
+
│ ├── SKILL.md # DSH skill instructions
|
|
112
|
+
│ ├── README.md # skill documentation
|
|
113
|
+
│ └── CHANGELOG.md # skill changelog
|
|
101
114
|
├── package.json
|
|
102
115
|
├── README.md # English documentation
|
|
103
116
|
└── README.zh-CN.md # Chinese documentation
|
|
@@ -115,17 +128,15 @@ todo_cli/
|
|
|
115
128
|
```
|
|
116
129
|
请帮我安装部署 todo-cli 命令行待办工具,步骤如下:
|
|
117
130
|
|
|
118
|
-
1.
|
|
119
|
-
2.
|
|
120
|
-
3.
|
|
121
|
-
4. 验证安装:运行 todo --version,确认输出 "todo v1.0.0"
|
|
122
|
-
5. 功能验证:依次执行以下命令并确认每步输出正常:
|
|
131
|
+
1. 全局安装:npm install -g @walknpm/todo-cli
|
|
132
|
+
2. 验证安装:运行 todo --version,确认输出 "todo v1.1.0"
|
|
133
|
+
3. 功能验证:依次执行以下命令并确认每步输出正常:
|
|
123
134
|
- todo add "部署测试任务" -p high -t test -c verify
|
|
124
135
|
- todo list
|
|
125
136
|
- todo done 1
|
|
126
137
|
- todo stats
|
|
127
138
|
- todo clear
|
|
128
|
-
|
|
139
|
+
4. 如果任何步骤报错,请展示完整错误信息并尝试修复。
|
|
129
140
|
|
|
130
141
|
完成后告诉我安装路径和 todo --version 的输出。
|
|
131
142
|
```
|
package/README.zh-CN.md
CHANGED
|
@@ -12,11 +12,20 @@
|
|
|
12
12
|
|
|
13
13
|
## 快速安装
|
|
14
14
|
|
|
15
|
+
**通过 npm:**
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @walknpm/todo-cli
|
|
19
|
+
todo --version # → todo v1.1.0
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**通过 git:**
|
|
23
|
+
|
|
15
24
|
```bash
|
|
16
25
|
git clone https://gitcode.com/hw_aishell_projects/todo_cli.git
|
|
17
26
|
cd todo_cli
|
|
18
27
|
npm install -g .
|
|
19
|
-
todo --version # → todo v1.
|
|
28
|
+
todo --version # → todo v1.1.0
|
|
20
29
|
```
|
|
21
30
|
|
|
22
31
|
## 命令一览
|
|
@@ -97,6 +106,10 @@ todo_cli/
|
|
|
97
106
|
│ ├── store.js # JSON 文件持久化层
|
|
98
107
|
│ ├── todo.js # 领域逻辑(增删改查、搜索、统计、导出等)
|
|
99
108
|
│ └── cli.js # 命令解析、ANSI 彩色、表格输出
|
|
109
|
+
├── skill/
|
|
110
|
+
│ ├── SKILL.md # DSH 技能指令
|
|
111
|
+
│ ├── README.md # 技能文档
|
|
112
|
+
│ └── CHANGELOG.md # 技能变更记录
|
|
100
113
|
├── package.json
|
|
101
114
|
├── README.md # 英文文档
|
|
102
115
|
└── README.zh-CN.md # 中文文档
|
|
@@ -114,17 +127,15 @@ todo_cli/
|
|
|
114
127
|
```
|
|
115
128
|
请帮我安装部署 todo-cli 命令行待办工具,步骤如下:
|
|
116
129
|
|
|
117
|
-
1.
|
|
118
|
-
2.
|
|
119
|
-
3.
|
|
120
|
-
4. 验证安装:运行 todo --version,确认输出 "todo v1.0.0"
|
|
121
|
-
5. 功能验证:依次执行以下命令并确认每步输出正常:
|
|
130
|
+
1. 全局安装:npm install -g @walknpm/todo-cli
|
|
131
|
+
2. 验证安装:运行 todo --version,确认输出 "todo v1.1.0"
|
|
132
|
+
3. 功能验证:依次执行以下命令并确认每步输出正常:
|
|
122
133
|
- todo add "部署测试任务" -p high -t test -c verify
|
|
123
134
|
- todo list
|
|
124
135
|
- todo done 1
|
|
125
136
|
- todo stats
|
|
126
137
|
- todo clear
|
|
127
|
-
|
|
138
|
+
4. 如果任何步骤报错,请展示完整错误信息并尝试修复。
|
|
128
139
|
|
|
129
140
|
完成后告诉我安装路径和 todo --version 的输出。
|
|
130
141
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walknpm/todo-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A zero-dependency Node.js CLI todo list manager with CRUD, due dates, search, stats, export, and auto-update.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/cli.js",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"bin/",
|
|
33
33
|
"src/",
|
|
34
|
+
"skill/",
|
|
34
35
|
"README.md",
|
|
35
36
|
"README.zh-CN.md"
|
|
36
37
|
]
|
package/skill/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# todo-cli-harness
|
|
2
|
+
|
|
3
|
+
通过 `todo-cli` 命令行工具进行任务管理的 DSH Skill。
|
|
4
|
+
|
|
5
|
+
**核心特性**:
|
|
6
|
+
- **全命令覆盖**:增删改查、完成切换、搜索、统计、导出、自动更新
|
|
7
|
+
- **结构化任务管理**:优先级、分类、标签、截止日期、备注
|
|
8
|
+
- **工作流模板**:项目规划、每日回顾、Bug 跟踪、导出汇报
|
|
9
|
+
- **零依赖**:仅需 Node.js >= 18 和 `todo` CLI
|
|
10
|
+
|
|
11
|
+
## 命令一览
|
|
12
|
+
|
|
13
|
+
| 命令 | 说明 |
|
|
14
|
+
|------|------|
|
|
15
|
+
| `add` | 添加任务(支持优先级/标签/分类/截止日期/备注) |
|
|
16
|
+
| `list` | 列出与过滤(按状态/分类/标签/优先级/排序) |
|
|
17
|
+
| `done` | 标记完成(`--all` 批量完成) |
|
|
18
|
+
| `toggle` | 切换完成/待办状态 |
|
|
19
|
+
| `edit` | 编辑任务 |
|
|
20
|
+
| `delete` / `remove` / `rm` | 删除任务 |
|
|
21
|
+
| `search` | 搜索标题/标签/分类/备注 |
|
|
22
|
+
| `stats` | 统计概览 |
|
|
23
|
+
| `export` | 导出 JSON/CSV/Markdown |
|
|
24
|
+
| `archive` | 归档已完成任务 |
|
|
25
|
+
| `update` | 自动更新工具 |
|
|
26
|
+
| `clear` | 清空全部任务 |
|
|
27
|
+
|
|
28
|
+
## 安装
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g @walknpm/todo-cli
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 使用
|
|
35
|
+
|
|
36
|
+
加载本 skill 后,AI Agent 会获得 `todo` CLI 的完整使用指南,包括:
|
|
37
|
+
- 所有命令的语法和示例
|
|
38
|
+
- 4 个常用工作流模板
|
|
39
|
+
- 最佳实践和错误处理指南
|
|
40
|
+
|
|
41
|
+
## 文件结构
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
skill/
|
|
45
|
+
├── SKILL.md # 技能指令(加载后生效)
|
|
46
|
+
├── README.md # 本文档
|
|
47
|
+
└── CHANGELOG.md # 变更记录
|
|
48
|
+
```
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: todo-cli-harness
|
|
3
|
+
description: "通过 todo-cli 命令行工具进行任务管理。支持增删改查、优先级、截止日期、分类标签、搜索、统计、导出与自动更新。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 概述
|
|
7
|
+
|
|
8
|
+
本技能封装 `todo-cli` 命令行工具,为 AI Agent 提供结构化的任务管理能力。
|
|
9
|
+
所有操作通过 `todo` 命令完成,数据持久化到 `~/.todo-cli/todos.json`。
|
|
10
|
+
|
|
11
|
+
### 设计哲学
|
|
12
|
+
|
|
13
|
+
- 所有任务操作通过 `todo` CLI 命令完成,不直接读写 JSON 文件
|
|
14
|
+
- 每次操作后检查退出码,确认执行成功
|
|
15
|
+
- 批量操作优先使用 `--all` 等聚合标志,减少命令轮次
|
|
16
|
+
- 任务创建时主动设置优先级、分类、标签和截止日期,提升可管理性
|
|
17
|
+
|
|
18
|
+
## 前置检查
|
|
19
|
+
|
|
20
|
+
首次使用前,验证 `todo` 命令是否可用:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
todo --version
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
若命令不存在,安装工具:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# 方式一:npm(推荐)
|
|
30
|
+
npm install -g @walknpm/todo-cli
|
|
31
|
+
|
|
32
|
+
# 方式二:git 克隆
|
|
33
|
+
git clone https://gitcode.com/hw_aishell_projects/todo_cli.git /tmp/todo_cli
|
|
34
|
+
cd /tmp/todo_cli && npm install -g .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
安装后再次验证 `todo --version` 输出版本号。
|
|
38
|
+
|
|
39
|
+
## 命令参考
|
|
40
|
+
|
|
41
|
+
### 添加任务
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
todo add "<标题>" [-p high|medium|low] [-t tag1,tag2] [-c 分类] [-d YYYY-MM-DD] [--note "备注"]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**示例:**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
todo add "修复登录页空指针" -p high -c bug -t frontend,urgent -d 2025-02-15 --note "用户点击空按钮时崩溃"
|
|
51
|
+
todo add "编写 API 文档" -p medium -c docs -t api
|
|
52
|
+
todo add "整理周报" -p low -c admin
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 列出与过滤
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
todo list [--status all|done|pending] [--category <分类>] [--tag <标签>] [--priority <优先级>] [--sort priority|created|due|id]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**示例:**
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
todo list # 全部(默认按优先级排序)
|
|
65
|
+
todo list --status pending # 仅待办
|
|
66
|
+
todo list --status pending --sort due # 待办按截止日期排序
|
|
67
|
+
todo list --category bug --priority high # 高优 bug
|
|
68
|
+
todo list --tag urgent # 含 urgent 标签
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 完成与切换
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
todo done <id> # 标记完成
|
|
75
|
+
todo done --all # 全部完成
|
|
76
|
+
todo toggle <id> # 切换完成/待办状态
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 编辑
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
todo edit <id> [--title "新标题"] [-p high|medium|low] [-t tag1,tag2] [-c 分类] [-d YYYY-MM-DD] [--note "备注"]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**示例:**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
todo edit 3 --title "更新后的标题" -p low
|
|
89
|
+
todo edit 5 -d 2025-03-01 --note "延期到三月"
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 删除
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
todo delete <id> # 删除指定任务
|
|
96
|
+
todo remove <id> # 同上(别名)
|
|
97
|
+
todo rm <id> # 同上(别名)
|
|
98
|
+
todo archive # 删除所有已完成任务
|
|
99
|
+
todo clear # 清空全部任务(慎用)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 搜索
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
todo search <关键词> # 搜索标题/标签/分类/备注
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 统计
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
todo stats # 显示总数、完成/待办/逾期、按优先级和分类分组
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 导出
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
todo export json # JSON 格式(默认)
|
|
118
|
+
todo export csv # CSV 格式
|
|
119
|
+
todo export md # Markdown 表格
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
导出到文件:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
todo export csv > todos.csv
|
|
126
|
+
todo export md > todos.md
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 自动更新
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
todo update --check # 检查是否有新版本
|
|
133
|
+
todo update # 安装最新版本
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 帮助与版本
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
todo --help # 显示帮助(任意命令后均可加 --help)
|
|
140
|
+
todo --version # 显示版本
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## 常用工作流
|
|
144
|
+
|
|
145
|
+
### 工作流一:项目任务规划
|
|
146
|
+
|
|
147
|
+
收到项目需求后,将拆解的任务批量创建:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
todo add "搭建项目脚手架" -p high -c setup -d 2025-02-01
|
|
151
|
+
todo add "实现用户认证模块" -p high -c feature -t auth -d 2025-02-05
|
|
152
|
+
todo add "编写单元测试" -p medium -c test -d 2025-02-08
|
|
153
|
+
todo add "编写集成文档" -p low -c docs -d 2025-02-10
|
|
154
|
+
todo list --sort due
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### 工作流二:每日任务回顾
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# 查看待办概览
|
|
161
|
+
todo stats
|
|
162
|
+
|
|
163
|
+
# 查看今日紧急任务
|
|
164
|
+
todo list --status pending --priority high --sort due
|
|
165
|
+
|
|
166
|
+
# 搜索特定任务
|
|
167
|
+
todo search "认证"
|
|
168
|
+
|
|
169
|
+
# 完成任务
|
|
170
|
+
todo done 3
|
|
171
|
+
todo done 5
|
|
172
|
+
|
|
173
|
+
# 归档已完成
|
|
174
|
+
todo archive
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### 工作流三:Bug 跟踪
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# 添加 bug
|
|
181
|
+
todo add "登录接口返回 500" -p high -c bug -t backend,auth --note "生产环境偶发"
|
|
182
|
+
|
|
183
|
+
# 关联修复
|
|
184
|
+
todo add "修复登录接口异常处理" -p high -c fix -t backend -d 2025-02-03
|
|
185
|
+
|
|
186
|
+
# 修复后标记完成
|
|
187
|
+
todo done 2
|
|
188
|
+
|
|
189
|
+
# 查看未修复 bug
|
|
190
|
+
todo list --category bug --status pending
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 工作流四:导出与汇报
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# 导出为 Markdown 用于周报
|
|
197
|
+
todo export md > weekly-todos.md
|
|
198
|
+
|
|
199
|
+
# 导出为 CSV 用于数据分析
|
|
200
|
+
todo export csv > todos.csv
|
|
201
|
+
|
|
202
|
+
# 查看统计概览
|
|
203
|
+
todo stats
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## 最佳实践
|
|
207
|
+
|
|
208
|
+
1. **标题简洁明确**:用动词开头,如「修复」「实现」「编写」
|
|
209
|
+
2. **善用分类**:按工作类型分类(bug / feature / docs / test / admin)
|
|
210
|
+
3. **标签交叉引用**:用标签关联跨分类维度(urgent / frontend / backend)
|
|
211
|
+
4. **设置截止日期**:有明确 deadline 的任务务必加 `-d`,便于按日期排序和逾期追踪
|
|
212
|
+
5. **备注补充上下文**:复杂任务用 `--note` 记录关键信息
|
|
213
|
+
6. **定期归档**:完成的任务用 `todo archive` 清理,保持列表清爽
|
|
214
|
+
7. **批量操作**:`todo done --all` 一次完成所有待办,减少重复命令
|
|
215
|
+
|
|
216
|
+
## 错误处理
|
|
217
|
+
|
|
218
|
+
| 场景 | 处理 |
|
|
219
|
+
|------|------|
|
|
220
|
+
| `todo` 命令不存在 | 执行安装流程(见前置检查) |
|
|
221
|
+
| `✗ No todo with id N` | 先 `todo list` 确认有效 id |
|
|
222
|
+
| `✗ Title is required.` | `add` 命令必须提供标题 |
|
|
223
|
+
| `✗ Invalid due date` | 日期格式必须为 `YYYY-MM-DD` |
|
|
224
|
+
| 退出码非 0 | 检查 stderr 输出的 `✗` 错误信息 |
|