@walknpm/todo-cli 1.1.0 → 2.0.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 +208 -141
- package/README.zh-CN.md +158 -150
- package/package.json +20 -6
- package/skill/CHANGELOG.md +8 -0
- package/skill/README.md +48 -0
- package/skill/SKILL.md +224 -0
- package/src/cli.js +396 -24
- package/src/server.js +422 -0
- package/src/todo.js +544 -35
- package/web/css/style.css +804 -0
- package/web/index.html +216 -0
- package/web/js/app.js +934 -0
package/README.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> **English** | [简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
A zero-dependency Node.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
A zero-dependency Node.js todo list manager with **CLI + Web UI**. Full CRUD,
|
|
6
|
+
subtasks, recurring tasks, dependencies, time tracking, pinning, bulk operations,
|
|
7
|
+
categories/tags, priority sorting, due dates, search, statistics, kanban board,
|
|
8
|
+
calendar view, timeline, export (JSON / CSV / Markdown), and auto-update.
|
|
9
|
+
Data persists to `~/.todo-cli/todos.json`.
|
|
9
10
|
|
|
10
11
|
## Requirements
|
|
11
12
|
|
|
@@ -13,190 +14,256 @@ statistics, and export (JSON / CSV / Markdown). Data persists to
|
|
|
13
14
|
|
|
14
15
|
## Quick install
|
|
15
16
|
|
|
17
|
+
**Via npm:**
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g @walknpm/todo-cli
|
|
21
|
+
todo --version # → todo v2.0.0
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Via git:**
|
|
25
|
+
|
|
16
26
|
```bash
|
|
17
27
|
git clone https://gitcode.com/hw_aishell_projects/todo_cli.git
|
|
18
28
|
cd todo_cli
|
|
19
29
|
npm install -g .
|
|
20
|
-
todo --version # → todo
|
|
30
|
+
todo --version # → todo v2.0.0
|
|
21
31
|
```
|
|
22
32
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
| Command | Description |
|
|
26
|
-
| --------------------- | -------------------------------------------------- |
|
|
27
|
-
| `add <title>` | Add a new todo |
|
|
28
|
-
| `list` | List todos (default command) |
|
|
29
|
-
| `done <id>` | Mark a todo as done (`done --all` = complete all) |
|
|
30
|
-
| `toggle <id>` | Toggle done / pending |
|
|
31
|
-
| `edit <id>` | Edit a todo |
|
|
32
|
-
| `delete <id>` | Delete a todo |
|
|
33
|
-
| `search <keyword>` | Search title / tags / category / note |
|
|
34
|
-
| `stats` | Show summary statistics |
|
|
35
|
-
| `export [json\|csv\|md]` | Export all todos to stdout |
|
|
36
|
-
| `archive` | Remove all completed todos |
|
|
37
|
-
| `update` | Update todo-cli to latest (`--check` = check only) |
|
|
38
|
-
| `clear` | Remove ALL todos |
|
|
39
|
-
| `help` | Show help |
|
|
40
|
-
|
|
41
|
-
`-h` / `--help` can be appended to **any** command (or used alone) to show help.
|
|
42
|
-
`-v` / `--version` prints the version.
|
|
33
|
+
## 🚀 Web UI
|
|
43
34
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| Flag | Applies to | Description |
|
|
47
|
-
| ----------------------- | ---------------- | ------------------------------------------ |
|
|
48
|
-
| `-p, --priority <v>` | add, edit | `high` \| `medium` \| `low` (default: medium) |
|
|
49
|
-
| `-t, --tags <v>` | add, edit | Comma-separated tags |
|
|
50
|
-
| `-c, --category <v>` | add, edit | Category name |
|
|
51
|
-
| `-d, --due <v>` | add, edit | Due date `YYYY-MM-DD` |
|
|
52
|
-
| `--note <v>` | add, edit | Longer note / description |
|
|
53
|
-
| `--title <v>` | edit | New title |
|
|
54
|
-
| `--status <v>` | list | `all` \| `done` \| `pending` |
|
|
55
|
-
| `--tag <v>` | list | Filter by tag |
|
|
56
|
-
| `--sort <v>` | list | `priority` \| `created` \| `due` \| `id` |
|
|
57
|
-
| `--all` | done | Complete all pending |
|
|
58
|
-
| `--check` | update | Check for update without installing |
|
|
59
|
-
| `--format <v>` | export | `json` \| `csv` \| `md` (default: json) |
|
|
60
|
-
|
|
61
|
-
## Examples
|
|
35
|
+
Start the web server with:
|
|
62
36
|
|
|
63
37
|
```bash
|
|
64
|
-
#
|
|
65
|
-
todo
|
|
38
|
+
todo web # default port 3456
|
|
39
|
+
todo web 8080 # custom port
|
|
40
|
+
npm run web # via npm script
|
|
41
|
+
```
|
|
66
42
|
|
|
67
|
-
|
|
68
|
-
todo list
|
|
69
|
-
todo list --status pending --sort due
|
|
70
|
-
todo list --category work --priority high
|
|
43
|
+
Then open **http://localhost:3456** in your browser.
|
|
71
44
|
|
|
72
|
-
|
|
73
|
-
todo search tax
|
|
45
|
+
### Web UI Features
|
|
74
46
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
47
|
+
| Feature | Description |
|
|
48
|
+
| ------- | ----------- |
|
|
49
|
+
| **Dashboard** | Stats cards, completion rate, recent todos, upcoming deadlines |
|
|
50
|
+
| **List View** | Full todo list with inline actions, filtering, sorting, search |
|
|
51
|
+
| **Kanban Board** | Drag-and-drop between Pending and Done columns |
|
|
52
|
+
| **Calendar** | Monthly calendar with todos mapped to due dates |
|
|
53
|
+
| **Timeline** | Chronological activity feed of all todos |
|
|
54
|
+
| **Add/Edit Modal** | Full form with all fields including recurrence and pinning |
|
|
55
|
+
| **Detail View** | Subtask management, dependencies, timestamps, quick actions |
|
|
56
|
+
| **Time Tracking** | Start/stop timers with floating timer widget |
|
|
57
|
+
| **Dark/Light Theme** | Toggle with persistence via localStorage |
|
|
58
|
+
| **Responsive** | Works on desktop, tablet, and mobile |
|
|
59
|
+
| **Keyboard Shortcuts** | `n` = new todo, `/` = search, `Esc` = close modal |
|
|
78
60
|
|
|
79
|
-
|
|
80
|
-
todo stats
|
|
61
|
+
## Commands
|
|
81
62
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
63
|
+
### Core Commands
|
|
64
|
+
|
|
65
|
+
| Command | Description |
|
|
66
|
+
| ------- | ----------- |
|
|
67
|
+
| `add <title>` | Add a new todo |
|
|
68
|
+
| `list` | List todos (default command) |
|
|
69
|
+
| `show <id>` | Show detailed info for a todo |
|
|
70
|
+
| `done <id>` | Mark a todo as done (`done --all` = complete all) |
|
|
71
|
+
| `toggle <id>` | Toggle done / pending |
|
|
72
|
+
| `edit <id>` | Edit a todo |
|
|
73
|
+
| `delete <id>` | Delete a todo (alias: `rm`, `remove`) |
|
|
74
|
+
| `duplicate <id>` | Clone a todo (alias: `dup`) |
|
|
75
|
+
| `pin <id>` | Toggle pin status |
|
|
76
|
+
| `search <keyword>` | Search title / tags / category / note / assignee |
|
|
77
|
+
| `stats` | Show summary statistics |
|
|
78
|
+
| `export [json\|csv\|md]` | Export all todos to stdout |
|
|
79
|
+
| `archive` | Remove all completed todos |
|
|
80
|
+
| `clear` | Remove ALL todos |
|
|
81
|
+
| `web [port]` | Start the web UI server (default: 3456) |
|
|
82
|
+
| `update` | Update todo-cli to latest (`--check` = check only) |
|
|
83
|
+
| `help` | Show help |
|
|
84
|
+
|
|
85
|
+
### Subtasks
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
todo
|
|
88
|
-
todo
|
|
87
|
+
```bash
|
|
88
|
+
todo subtask add <id> <title> # Add a subtask
|
|
89
|
+
todo subtask done <id> <sid> # Toggle subtask done
|
|
90
|
+
todo subtask edit <id> <sid> <title> # Edit subtask title
|
|
91
|
+
todo subtask delete <id> <sid> # Delete a subtask
|
|
89
92
|
```
|
|
90
93
|
|
|
91
|
-
|
|
94
|
+
### Recurring Tasks
|
|
92
95
|
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
│ ├── todo.js # domain logic (CRUD, search, stats, export, ...)
|
|
100
|
-
│ └── cli.js # command parsing, ANSI colours, table output
|
|
101
|
-
├── package.json
|
|
102
|
-
├── README.md # English documentation
|
|
103
|
-
└── README.zh-CN.md # Chinese documentation
|
|
96
|
+
```bash
|
|
97
|
+
todo recur <id> daily [interval] # Repeat every N days
|
|
98
|
+
todo recur <id> weekly [interval] # Repeat every N weeks
|
|
99
|
+
todo recur <id> monthly [interval] # Repeat every N months
|
|
100
|
+
todo recur <id> yearly [interval] # Repeat every N years
|
|
101
|
+
todo recur <id> off # Remove recurrence
|
|
104
102
|
```
|
|
105
103
|
|
|
106
|
-
|
|
104
|
+
When a recurring todo is completed, a new pending instance is automatically
|
|
105
|
+
created with the due date advanced by the recurrence interval.
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
### Dependencies
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
>
|
|
109
|
+
```bash
|
|
110
|
+
todo dep add <id> <depId> # Add dependency (blocks completion)
|
|
111
|
+
todo dep remove <id> <depId> # Remove dependency
|
|
112
|
+
```
|
|
112
113
|
|
|
113
|
-
###
|
|
114
|
+
### Time Tracking
|
|
114
115
|
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
3. 全局安装:npm install -g .
|
|
121
|
-
4. 验证安装:运行 todo --version,确认输出 "todo v1.0.0"
|
|
122
|
-
5. 功能验证:依次执行以下命令并确认每步输出正常:
|
|
123
|
-
- todo add "部署测试任务" -p high -t test -c verify
|
|
124
|
-
- todo list
|
|
125
|
-
- todo done 1
|
|
126
|
-
- todo stats
|
|
127
|
-
- todo clear
|
|
128
|
-
6. 如果任何步骤报错,请展示完整错误信息并尝试修复。
|
|
129
|
-
|
|
130
|
-
完成后告诉我安装路径和 todo --version 的输出。
|
|
116
|
+
```bash
|
|
117
|
+
todo timer start <id> # Start timer (stops any other running timer)
|
|
118
|
+
todo timer stop <id> # Stop timer and log elapsed time
|
|
119
|
+
todo timer log <id> <minutes> # Manually log time
|
|
120
|
+
todo timer # Show active timer
|
|
131
121
|
```
|
|
132
122
|
|
|
133
|
-
###
|
|
123
|
+
### Bulk Operations
|
|
134
124
|
|
|
125
|
+
```bash
|
|
126
|
+
todo bulk done <ids...> # Complete multiple todos
|
|
127
|
+
todo bulk delete <ids...> # Delete multiple todos
|
|
128
|
+
todo bulk priority <ids...> -p <val> # Set priority on multiple todos
|
|
129
|
+
todo bulk category <ids...> -c <val> # Set category on multiple todos
|
|
130
|
+
todo bulk assign <ids...> --assignee <val> # Set assignee on multiple todos
|
|
135
131
|
```
|
|
136
|
-
请帮我部署 todo-cli 并导入已有待办数据:
|
|
137
132
|
|
|
138
|
-
|
|
139
|
-
git clone https://gitcode.com/hw_aishell_projects/todo_cli.git
|
|
140
|
-
cd todo_cli && npm install -g .
|
|
133
|
+
## Flags
|
|
141
134
|
|
|
142
|
-
|
|
135
|
+
| Flag | Applies to | Description |
|
|
136
|
+
| ---- | ---------- | ----------- |
|
|
137
|
+
| `-p, --priority <v>` | add, edit | `high` \| `medium` \| `low` (default: medium) |
|
|
138
|
+
| `-t, --tags <v>` | add, edit | Comma-separated tags |
|
|
139
|
+
| `-c, --category <v>` | add, edit | Category name |
|
|
140
|
+
| `-d, --due <v>` | add, edit | Due date `YYYY-MM-DD` |
|
|
141
|
+
| `--note <v>` | add, edit | Longer note / description |
|
|
142
|
+
| `--title <v>` | edit | New title |
|
|
143
|
+
| `--assignee <v>` | add, edit | Assign to a person |
|
|
144
|
+
| `--estimate <v>` | add, edit | Estimated minutes to complete |
|
|
145
|
+
| `--color <v>` | add, edit | Custom color label |
|
|
146
|
+
| `--status <v>` | list | `all` \| `done` \| `pending` |
|
|
147
|
+
| `--tag <v>` | list | Filter by tag |
|
|
148
|
+
| `--sort <v>` | list | `priority` \| `created` \| `due` \| `id` \| `title` \| `updated` \| `order` |
|
|
149
|
+
| `--pinned` | add | Pin the new todo |
|
|
150
|
+
| `--overdue` | list | Show only overdue items |
|
|
151
|
+
| `--due-today` | list | Show only items due today |
|
|
152
|
+
| `--all` | done | Complete all pending |
|
|
153
|
+
| `--check` | update | Check for update without installing |
|
|
154
|
+
| `--format <v>` | export | `json` \| `csv` \| `md` (default: json) |
|
|
143
155
|
|
|
144
|
-
|
|
145
|
-
- [在此粘贴你的待办列表,每行一条]
|
|
156
|
+
## Examples
|
|
146
157
|
|
|
147
|
-
|
|
148
|
-
|
|
158
|
+
```bash
|
|
159
|
+
# Add with all fields
|
|
160
|
+
todo add "Submit tax return" -p high -d 2025-01-31 -c finance -t urgent,monthly --note "Include receipts" --estimate 120 --assignee bob
|
|
149
161
|
|
|
150
|
-
|
|
162
|
+
# List & filter
|
|
163
|
+
todo list --status pending --sort due
|
|
164
|
+
todo list --overdue
|
|
165
|
+
todo list --category work --priority high
|
|
151
166
|
|
|
152
|
-
|
|
153
|
-
|
|
167
|
+
# Subtasks
|
|
168
|
+
todo subtask add 1 "Research options"
|
|
169
|
+
todo subtask add 1 "Write draft"
|
|
170
|
+
todo subtask done 1 1
|
|
154
171
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
3
|
|
158
|
-
4. 告诉我卸载是否成功。
|
|
159
|
-
```
|
|
172
|
+
# Recurring
|
|
173
|
+
todo recur 3 weekly 1
|
|
174
|
+
todo done 3 # creates a new instance for next week
|
|
160
175
|
|
|
161
|
-
|
|
176
|
+
# Dependencies
|
|
177
|
+
todo dep add 5 3 # todo #5 is blocked until #3 is done
|
|
162
178
|
|
|
163
|
-
|
|
164
|
-
|
|
179
|
+
# Time tracking
|
|
180
|
+
todo timer start 2
|
|
181
|
+
todo timer stop 2
|
|
182
|
+
todo timer log 2 30
|
|
165
183
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
4. 运行 todo list 确认已有数据未丢失
|
|
170
|
-
5. 告诉我更新结果。
|
|
171
|
-
```
|
|
184
|
+
# Pin & duplicate
|
|
185
|
+
todo pin 1
|
|
186
|
+
todo duplicate 3
|
|
172
187
|
|
|
173
|
-
|
|
188
|
+
# Bulk operations
|
|
189
|
+
todo bulk done 1 2 3
|
|
190
|
+
todo bulk priority 1 2 3 -p high
|
|
174
191
|
|
|
175
|
-
|
|
176
|
-
|
|
192
|
+
# Web UI
|
|
193
|
+
todo web 8080
|
|
177
194
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
2. cd todo_cli && npm install -g .
|
|
181
|
-
3. 确认 todo --version 输出版本号
|
|
195
|
+
# Statistics
|
|
196
|
+
todo stats
|
|
182
197
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
198
|
+
# Export
|
|
199
|
+
todo export csv > todos.csv
|
|
200
|
+
todo export md
|
|
186
201
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
202
|
+
# Auto-update
|
|
203
|
+
todo update --check
|
|
204
|
+
todo update
|
|
205
|
+
```
|
|
191
206
|
|
|
192
|
-
|
|
193
|
-
9. 如果之前做了备份,将备份文件复制回 ~/.todo-cli/todos.json
|
|
194
|
-
10. 执行 todo list 确认数据已恢复
|
|
207
|
+
## Project structure
|
|
195
208
|
|
|
196
|
-
|
|
209
|
+
```
|
|
210
|
+
todo_cli/
|
|
211
|
+
├── bin/
|
|
212
|
+
│ └── todo.js # executable entry point (shebang)
|
|
213
|
+
├── src/
|
|
214
|
+
│ ├── store.js # JSON file persistence layer
|
|
215
|
+
│ ├── todo.js # domain logic (CRUD, subtasks, recurring, deps, timer, bulk, ...)
|
|
216
|
+
│ ├── cli.js # command parsing, ANSI colours, table output
|
|
217
|
+
│ └── server.js # zero-dependency HTTP server (REST API + static files)
|
|
218
|
+
├── web/
|
|
219
|
+
│ ├── index.html # SPA shell
|
|
220
|
+
│ ├── css/
|
|
221
|
+
│ │ └── style.css # modern responsive design (dark/light themes)
|
|
222
|
+
│ └── js/
|
|
223
|
+
│ └── app.js # SPA application logic (dashboard, list, kanban, calendar, timeline)
|
|
224
|
+
├── skill/
|
|
225
|
+
│ ├── SKILL.md # DSH skill instructions
|
|
226
|
+
│ ├── README.md # skill documentation
|
|
227
|
+
│ └── CHANGELOG.md # skill changelog
|
|
228
|
+
├── package.json
|
|
229
|
+
├── README.md # English documentation
|
|
230
|
+
└── README.zh-CN.md # Chinese documentation
|
|
197
231
|
```
|
|
198
232
|
|
|
199
|
-
|
|
233
|
+
## REST API
|
|
234
|
+
|
|
235
|
+
The web server exposes a REST API at `/api/`:
|
|
236
|
+
|
|
237
|
+
| Method | Endpoint | Description |
|
|
238
|
+
| ------ | -------- | ----------- |
|
|
239
|
+
| GET | `/api/todos` | List all todos (supports query filters) |
|
|
240
|
+
| POST | `/api/todos` | Create a new todo |
|
|
241
|
+
| GET | `/api/todos/:id` | Get a single todo |
|
|
242
|
+
| PATCH | `/api/todos/:id` | Edit a todo |
|
|
243
|
+
| DELETE | `/api/todos/:id` | Delete a todo |
|
|
244
|
+
| POST | `/api/todos/:id/toggle` | Toggle done status |
|
|
245
|
+
| POST | `/api/todos/:id/complete` | Mark as done |
|
|
246
|
+
| POST | `/api/todos/:id/pin` | Toggle pin |
|
|
247
|
+
| POST | `/api/todos/:id/duplicate` | Duplicate a todo |
|
|
248
|
+
| POST | `/api/todos/:id/reorder` | Reorder a todo |
|
|
249
|
+
| POST | `/api/todos/:id/subtasks` | Add a subtask |
|
|
250
|
+
| POST | `/api/todos/:id/subtasks/:sid/toggle` | Toggle subtask |
|
|
251
|
+
| PATCH | `/api/todos/:id/subtasks/:sid` | Edit subtask |
|
|
252
|
+
| DELETE | `/api/todos/:id/subtasks/:sid` | Delete subtask |
|
|
253
|
+
| POST | `/api/todos/:id/recurring` | Set/remove recurrence |
|
|
254
|
+
| POST | `/api/todos/:id/dependencies` | Add dependency |
|
|
255
|
+
| DELETE | `/api/todos/:id/dependencies/:depId` | Remove dependency |
|
|
256
|
+
| POST | `/api/todos/:id/timer/start` | Start timer |
|
|
257
|
+
| POST | `/api/todos/:id/timer/stop` | Stop timer |
|
|
258
|
+
| POST | `/api/todos/:id/timer/log` | Log time manually |
|
|
259
|
+
| GET | `/api/stats` | Get statistics |
|
|
260
|
+
| GET | `/api/search?q=<keyword>` | Search todos |
|
|
261
|
+
| GET | `/api/timer` | Get active timer |
|
|
262
|
+
| POST | `/api/bulk` | Bulk operations |
|
|
263
|
+
| POST | `/api/complete-all` | Complete all pending |
|
|
264
|
+
| POST | `/api/archive` | Archive completed |
|
|
265
|
+
| POST | `/api/clear` | Clear all |
|
|
266
|
+
| GET | `/api/export?format=<fmt>` | Export todos |
|
|
200
267
|
|
|
201
268
|
## License
|
|
202
269
|
|