@walknpm/todo-cli 1.2.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 CHANGED
@@ -2,10 +2,11 @@
2
2
 
3
3
  > **English** | [简体中文](./README.zh-CN.md)
4
4
 
5
- A zero-dependency Node.js CLI todo list manager. Full CRUD, completion toggle,
6
- categories/tags, priority sorting, due dates with overdue highlighting, search,
7
- statistics, and export (JSON / CSV / Markdown). Data persists to
8
- `~/.todo-cli/todos.json`.
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
 
@@ -17,7 +18,7 @@ statistics, and export (JSON / CSV / Markdown). Data persists to
17
18
 
18
19
  ```bash
19
20
  npm install -g @walknpm/todo-cli
20
- todo --version # → todo v1.1.0
21
+ todo --version # → todo v2.0.0
21
22
  ```
22
23
 
23
24
  **Via git:**
@@ -26,188 +27,243 @@ todo --version # → todo v1.1.0
26
27
  git clone https://gitcode.com/hw_aishell_projects/todo_cli.git
27
28
  cd todo_cli
28
29
  npm install -g .
29
- todo --version # → todo v1.1.0
30
+ todo --version # → todo v2.0.0
30
31
  ```
31
32
 
32
- ## Commands
33
-
34
- | Command | Description |
35
- | --------------------- | -------------------------------------------------- |
36
- | `add <title>` | Add a new todo |
37
- | `list` | List todos (default command) |
38
- | `done <id>` | Mark a todo as done (`done --all` = complete all) |
39
- | `toggle <id>` | Toggle done / pending |
40
- | `edit <id>` | Edit a todo |
41
- | `delete <id>` | Delete a todo |
42
- | `search <keyword>` | Search title / tags / category / note |
43
- | `stats` | Show summary statistics |
44
- | `export [json\|csv\|md]` | Export all todos to stdout |
45
- | `archive` | Remove all completed todos |
46
- | `update` | Update todo-cli to latest (`--check` = check only) |
47
- | `clear` | Remove ALL todos |
48
- | `help` | Show help |
49
-
50
- `-h` / `--help` can be appended to **any** command (or used alone) to show help.
51
- `-v` / `--version` prints the version.
52
-
53
- ## Flags
33
+ ## 🚀 Web UI
54
34
 
55
- | Flag | Applies to | Description |
56
- | ----------------------- | ---------------- | ------------------------------------------ |
57
- | `-p, --priority <v>` | add, edit | `high` \| `medium` \| `low` (default: medium) |
58
- | `-t, --tags <v>` | add, edit | Comma-separated tags |
59
- | `-c, --category <v>` | add, edit | Category name |
60
- | `-d, --due <v>` | add, edit | Due date `YYYY-MM-DD` |
61
- | `--note <v>` | add, edit | Longer note / description |
62
- | `--title <v>` | edit | New title |
63
- | `--status <v>` | list | `all` \| `done` \| `pending` |
64
- | `--tag <v>` | list | Filter by tag |
65
- | `--sort <v>` | list | `priority` \| `created` \| `due` \| `id` |
66
- | `--all` | done | Complete all pending |
67
- | `--check` | update | Check for update without installing |
68
- | `--format <v>` | export | `json` \| `csv` \| `md` (default: json) |
69
-
70
- ## Examples
35
+ Start the web server with:
71
36
 
72
37
  ```bash
73
- # Add with due date, priority, tags, category, and note
74
- todo add "Submit tax return" -p high -d 2025-01-31 -c finance -t urgent,monthly --note "Include receipts"
38
+ todo web # default port 3456
39
+ todo web 8080 # custom port
40
+ npm run web # via npm script
41
+ ```
75
42
 
76
- # List & filter
77
- todo list
78
- todo list --status pending --sort due
79
- todo list --category work --priority high
43
+ Then open **http://localhost:3456** in your browser.
80
44
 
81
- # Search
82
- todo search tax
45
+ ### Web UI Features
83
46
 
84
- # Bulk complete & archive
85
- todo done --all
86
- todo archive
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 |
87
60
 
88
- # Statistics
89
- todo stats
61
+ ## Commands
90
62
 
91
- # Auto-update
92
- todo update --check # check for updates
93
- todo update # install latest version
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
94
86
 
95
- # Export
96
- todo export csv > todos.csv
97
- todo export md
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
98
92
  ```
99
93
 
100
- ## Project structure
94
+ ### Recurring Tasks
101
95
 
102
- ```
103
- todo_cli/
104
- ├── bin/
105
- │ └── todo.js # executable entry point (shebang)
106
- ├── src/
107
- │ ├── store.js # JSON file persistence layer
108
- │ ├── todo.js # domain logic (CRUD, search, stats, export, ...)
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
114
- ├── package.json
115
- ├── README.md # English documentation
116
- └── 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
117
102
  ```
118
103
 
119
- ---
104
+ When a recurring todo is completed, a new pending instance is automatically
105
+ created with the due date advanced by the recurrence interval.
120
106
 
121
- ## 🤖 AI 自动部署提示词
107
+ ### Dependencies
122
108
 
123
- > 以下提示词可直接粘贴给 AI 助手(如 Claude、ChatGPT、DeepSeek 等),AI 会自动完成部署。
124
- > 复制对应场景的代码块即可。
109
+ ```bash
110
+ todo dep add <id> <depId> # Add dependency (blocks completion)
111
+ todo dep remove <id> <depId> # Remove dependency
112
+ ```
125
113
 
126
- ### 场景一:从零安装并验证
114
+ ### Time Tracking
127
115
 
128
- ```
129
- 请帮我安装部署 todo-cli 命令行待办工具,步骤如下:
130
-
131
- 1. 全局安装:npm install -g @walknpm/todo-cli
132
- 2. 验证安装:运行 todo --version,确认输出 "todo v1.1.0"
133
- 3. 功能验证:依次执行以下命令并确认每步输出正常:
134
- - todo add "部署测试任务" -p high -t test -c verify
135
- - todo list
136
- - todo done 1
137
- - todo stats
138
- - todo clear
139
- 4. 如果任何步骤报错,请展示完整错误信息并尝试修复。
140
-
141
- 完成后告诉我安装路径和 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
142
121
  ```
143
122
 
144
- ### 场景二:安装 + 导入已有数据
123
+ ### Bulk Operations
145
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
146
131
  ```
147
- 请帮我部署 todo-cli 并导入已有待办数据:
148
132
 
149
- 1. 克隆并安装:
150
- git clone https://gitcode.com/hw_aishell_projects/todo_cli.git
151
- cd todo_cli && npm install -g .
133
+ ## Flags
152
134
 
153
- 2. 确认 todo --version 正常输出。
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) |
154
155
 
155
- 3. 以下是我的待办事项,请逐条用 todo add 命令创建(根据内容自动判断优先级、分类和标签):
156
- - [在此粘贴你的待办列表,每行一条]
156
+ ## Examples
157
157
 
158
- 4. 创建完成后运行 todo list 和 todo stats,把结果展示给我确认。
159
- ```
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
160
161
 
161
- ### 场景三:卸载
162
+ # List & filter
163
+ todo list --status pending --sort due
164
+ todo list --overdue
165
+ todo list --category work --priority high
162
166
 
163
- ```
164
- 请帮我卸载 todo-cli 工具:
167
+ # Subtasks
168
+ todo subtask add 1 "Research options"
169
+ todo subtask add 1 "Write draft"
170
+ todo subtask done 1 1
165
171
 
166
- 1. 运行 npm uninstall -g todo-cli
167
- 2. 删除数据文件:rm -rf ~/.todo-cli
168
- 3. 运行 todo --version 确认已无法找到该命令
169
- 4. 告诉我卸载是否成功。
170
- ```
172
+ # Recurring
173
+ todo recur 3 weekly 1
174
+ todo done 3 # creates a new instance for next week
171
175
 
172
- ### 场景四:更新到最新版本
176
+ # Dependencies
177
+ todo dep add 5 3 # todo #5 is blocked until #3 is done
173
178
 
174
- ```
175
- 请帮我更新 todo-cli 到最新版本:
179
+ # Time tracking
180
+ todo timer start 2
181
+ todo timer stop 2
182
+ todo timer log 2 30
176
183
 
177
- 1. 运行 todo update --check 检查是否有新版本
178
- 2. 如果有更新,运行 todo update 自动安装最新版
179
- 3. 运行 todo --version 确认版本号已更新
180
- 4. 运行 todo list 确认已有数据未丢失
181
- 5. 告诉我更新结果。
182
- ```
184
+ # Pin & duplicate
185
+ todo pin 1
186
+ todo duplicate 3
183
187
 
184
- ### 场景五:完整部署(含数据备份与恢复)
188
+ # Bulk operations
189
+ todo bulk done 1 2 3
190
+ todo bulk priority 1 2 3 -p high
185
191
 
186
- ```
187
- 请帮我完成 todo-cli 的完整部署流程:
192
+ # Web UI
193
+ todo web 8080
188
194
 
189
- 【安装】
190
- 1. git clone https://gitcode.com/hw_aishell_projects/todo_cli.git
191
- 2. cd todo_cli && npm install -g .
192
- 3. 确认 todo --version 输出版本号
195
+ # Statistics
196
+ todo stats
193
197
 
194
- 【备份】(如果 ~/.todo-cli/todos.json 已存在)
195
- 4. 如果存在 ~/.todo-cli/todos.json,先备份到 ~/todo-backup-$(date +%Y%m%d).json
196
- 5. 确认备份文件内容有效
198
+ # Export
199
+ todo export csv > todos.csv
200
+ todo export md
197
201
 
198
- 【验证】
199
- 6. 执行 todo add "验证任务" -p medium 并确认输出
200
- 7. 执行 todo list 确认表格正常显示
201
- 8. 执行 todo delete 1 清理验证数据
202
+ # Auto-update
203
+ todo update --check
204
+ todo update
205
+ ```
202
206
 
203
- 【恢复】(如果有备份)
204
- 9. 如果之前做了备份,将备份文件复制回 ~/.todo-cli/todos.json
205
- 10. 执行 todo list 确认数据已恢复
207
+ ## Project structure
206
208
 
207
- 最后汇总报告:安装状态、版本号、备份/恢复状态。
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
208
231
  ```
209
232
 
210
- ---
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 |
211
267
 
212
268
  ## License
213
269