@krodak/clickup-cli 0.13.2 → 0.14.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 +46 -2
- package/dist/index.js +296 -1
- package/package.json +1 -1
- package/skills/clickup-cli/SKILL.md +16 -2
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ When output is piped (no TTY), all commands output **Markdown** by default - opt
|
|
|
98
98
|
|
|
99
99
|
## Commands
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
31 commands total. All support `--help` for full flag details.
|
|
102
102
|
|
|
103
103
|
### `cu init`
|
|
104
104
|
|
|
@@ -170,7 +170,7 @@ cu inbox --json
|
|
|
170
170
|
|
|
171
171
|
### `cu task <id>`
|
|
172
172
|
|
|
173
|
-
Get task details including custom fields. Pretty summary in terminal, JSON when piped.
|
|
173
|
+
Get task details including custom fields and checklists. Pretty summary in terminal, JSON when piped.
|
|
174
174
|
|
|
175
175
|
```bash
|
|
176
176
|
cu task abc123
|
|
@@ -311,6 +311,24 @@ cu comments abc123
|
|
|
311
311
|
cu comments abc123 --json
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
+
### `cu comment-edit <commentId>`
|
|
315
|
+
|
|
316
|
+
Edit an existing comment on a task.
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
cu comment-edit <commentId> -m "Updated text"
|
|
320
|
+
cu comment-edit <commentId> -m "Fixed" --resolved
|
|
321
|
+
cu comment-edit <commentId> -m "Reopening" --unresolved
|
|
322
|
+
cu comment-edit <commentId> -m "Updated" --json
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
| Flag | Required | Description |
|
|
326
|
+
| --------------- | -------- | -------------------------- |
|
|
327
|
+
| `-m, --message` | yes | New comment text |
|
|
328
|
+
| `--resolved` | no | Mark comment as resolved |
|
|
329
|
+
| `--unresolved` | no | Mark comment as unresolved |
|
|
330
|
+
| `--json` | no | Force JSON output |
|
|
331
|
+
|
|
314
332
|
### `cu activity <id>`
|
|
315
333
|
|
|
316
334
|
View task details and comment history together. Combines `cu task` and `cu comments` into a single view.
|
|
@@ -473,6 +491,32 @@ cu tag abc123 --add "bug" --json
|
|
|
473
491
|
| `--remove <tags>` | Comma-separated tag names to remove |
|
|
474
492
|
| `--json` | Force JSON output |
|
|
475
493
|
|
|
494
|
+
### `cu checklist`
|
|
495
|
+
|
|
496
|
+
Manage checklists on tasks. Six subcommands for full CRUD operations.
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
cu checklist view abc123 # view all checklists on a task
|
|
500
|
+
cu checklist create abc123 "QA Checklist" # add a checklist
|
|
501
|
+
cu checklist delete <checklistId> # remove a checklist
|
|
502
|
+
cu checklist add-item <checklistId> "Run tests" # add an item
|
|
503
|
+
cu checklist edit-item <clId> <itemId> --resolved # mark item done
|
|
504
|
+
cu checklist delete-item <clId> <itemId> # remove an item
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
| Subcommand | Arguments | Description |
|
|
508
|
+
| ------------- | -------------------------------- | --------------------- |
|
|
509
|
+
| `view` | `<taskId>` | Show all checklists |
|
|
510
|
+
| `create` | `<taskId> <name>` | Create a checklist |
|
|
511
|
+
| `delete` | `<checklistId>` | Delete a checklist |
|
|
512
|
+
| `add-item` | `<checklistId> <name>` | Add checklist item |
|
|
513
|
+
| `edit-item` | `<checklistId> <itemId> [flags]` | Edit checklist item |
|
|
514
|
+
| `delete-item` | `<checklistId> <itemId>` | Delete checklist item |
|
|
515
|
+
|
|
516
|
+
`edit-item` flags: `--name <text>`, `--resolved`, `--unresolved`, `--assignee <userId>`. All subcommands support `--json`.
|
|
517
|
+
|
|
518
|
+
Checklists are also shown inline in `cu task <id>` detail view.
|
|
519
|
+
|
|
476
520
|
### `cu auth`
|
|
477
521
|
|
|
478
522
|
Check authentication status. Validates your API token and shows your user info.
|
package/dist/index.js
CHANGED
|
@@ -193,6 +193,48 @@ var ClickUpClient = class {
|
|
|
193
193
|
method: "DELETE"
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
+
async updateComment(commentId, text, resolved) {
|
|
197
|
+
const body = { comment_text: text };
|
|
198
|
+
if (resolved !== void 0) body.resolved = resolved;
|
|
199
|
+
await this.request(`/comment/${commentId}`, {
|
|
200
|
+
method: "PUT",
|
|
201
|
+
body: JSON.stringify(body)
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
async getListCustomFields(listId) {
|
|
205
|
+
const data = await this.request(`/list/${listId}/field`);
|
|
206
|
+
return data.fields ?? [];
|
|
207
|
+
}
|
|
208
|
+
async createChecklist(taskId, name) {
|
|
209
|
+
const data = await this.request(`/task/${taskId}/checklist`, {
|
|
210
|
+
method: "POST",
|
|
211
|
+
body: JSON.stringify({ name })
|
|
212
|
+
});
|
|
213
|
+
return data.checklist;
|
|
214
|
+
}
|
|
215
|
+
async deleteChecklist(checklistId) {
|
|
216
|
+
await this.request(`/checklist/${checklistId}`, { method: "DELETE" });
|
|
217
|
+
}
|
|
218
|
+
async createChecklistItem(checklistId, name) {
|
|
219
|
+
const data = await this.request(
|
|
220
|
+
`/checklist/${checklistId}/checklist_item`,
|
|
221
|
+
{ method: "POST", body: JSON.stringify({ name }) }
|
|
222
|
+
);
|
|
223
|
+
return data.checklist;
|
|
224
|
+
}
|
|
225
|
+
async editChecklistItem(checklistId, checklistItemId, updates) {
|
|
226
|
+
const data = await this.request(
|
|
227
|
+
`/checklist/${checklistId}/checklist_item/${checklistItemId}`,
|
|
228
|
+
{ method: "PUT", body: JSON.stringify(updates) }
|
|
229
|
+
);
|
|
230
|
+
return data.checklist;
|
|
231
|
+
}
|
|
232
|
+
async deleteChecklistItem(checklistId, checklistItemId) {
|
|
233
|
+
await this.request(
|
|
234
|
+
`/checklist/${checklistId}/checklist_item/${checklistItemId}`,
|
|
235
|
+
{ method: "DELETE" }
|
|
236
|
+
);
|
|
237
|
+
}
|
|
196
238
|
};
|
|
197
239
|
|
|
198
240
|
// src/config.ts
|
|
@@ -414,6 +456,17 @@ function formatTaskDetailMarkdown(task) {
|
|
|
414
456
|
if (descriptionContent) {
|
|
415
457
|
lines.push("", "## Description", "", descriptionContent);
|
|
416
458
|
}
|
|
459
|
+
if (task.checklists?.length) {
|
|
460
|
+
lines.push("", "## Checklists", "");
|
|
461
|
+
for (const cl of task.checklists) {
|
|
462
|
+
const resolved = cl.items.filter((i) => i.resolved).length;
|
|
463
|
+
lines.push(`### ${cl.name} (${resolved}/${cl.items.length})`, "");
|
|
464
|
+
for (const item of cl.items) {
|
|
465
|
+
lines.push(`- [${item.resolved ? "x" : " "}] ${item.name}`);
|
|
466
|
+
}
|
|
467
|
+
lines.push("");
|
|
468
|
+
}
|
|
469
|
+
}
|
|
417
470
|
return lines.join("\n");
|
|
418
471
|
}
|
|
419
472
|
function formatUpdateConfirmation(id, name) {
|
|
@@ -548,6 +601,18 @@ function formatTaskDetail(task) {
|
|
|
548
601
|
}
|
|
549
602
|
}
|
|
550
603
|
}
|
|
604
|
+
if (task.checklists?.length) {
|
|
605
|
+
lines.push("");
|
|
606
|
+
lines.push(chalk2.bold("Checklists"));
|
|
607
|
+
for (const cl of task.checklists) {
|
|
608
|
+
const resolved = cl.items.filter((i) => i.resolved).length;
|
|
609
|
+
lines.push(` ${chalk2.bold(cl.name)} (${resolved}/${cl.items.length})`);
|
|
610
|
+
for (const item of cl.items) {
|
|
611
|
+
const check = item.resolved ? chalk2.green("[x]") : chalk2.dim("[ ]");
|
|
612
|
+
lines.push(` ${check} ${item.name}`);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
551
616
|
if (task.text_content?.trim()) {
|
|
552
617
|
lines.push("");
|
|
553
618
|
lines.push(descriptionPreview(task.text_content));
|
|
@@ -1684,7 +1749,7 @@ function bashCompletion() {
|
|
|
1684
1749
|
cword=$COMP_CWORD
|
|
1685
1750
|
fi
|
|
1686
1751
|
|
|
1687
|
-
local commands="init auth tasks task update create sprint sprints subtasks comment comments activity lists spaces inbox assigned open search summary overdue assign depend move field delete tag config completion"
|
|
1752
|
+
local commands="init auth tasks task update create sprint sprints subtasks comment comment-edit comments activity lists spaces inbox assigned open search summary overdue assign depend move field delete tag checklist config completion"
|
|
1688
1753
|
|
|
1689
1754
|
if [[ $cword -eq 1 ]]; then
|
|
1690
1755
|
COMPREPLY=($(compgen -W "$commands --help --version" -- "$cur"))
|
|
@@ -1780,6 +1845,14 @@ function bashCompletion() {
|
|
|
1780
1845
|
tag)
|
|
1781
1846
|
COMPREPLY=($(compgen -W "--add --remove --json" -- "$cur"))
|
|
1782
1847
|
;;
|
|
1848
|
+
checklist)
|
|
1849
|
+
if [[ $cword -eq 2 ]]; then
|
|
1850
|
+
COMPREPLY=($(compgen -W "view create delete add-item edit-item delete-item" -- "$cur"))
|
|
1851
|
+
fi
|
|
1852
|
+
;;
|
|
1853
|
+
comment-edit)
|
|
1854
|
+
COMPREPLY=($(compgen -W "-m --message --resolved --unresolved --json" -- "$cur"))
|
|
1855
|
+
;;
|
|
1783
1856
|
config)
|
|
1784
1857
|
if [[ $cword -eq 2 ]]; then
|
|
1785
1858
|
COMPREPLY=($(compgen -W "get set path" -- "$cur"))
|
|
@@ -1832,6 +1905,8 @@ _cu() {
|
|
|
1832
1905
|
'field:Set or remove a custom field value on a task'
|
|
1833
1906
|
'delete:Delete a task'
|
|
1834
1907
|
'tag:Add or remove tags from a task'
|
|
1908
|
+
'checklist:Manage checklists on a task'
|
|
1909
|
+
'comment-edit:Edit an existing comment'
|
|
1835
1910
|
'config:Manage CLI configuration'
|
|
1836
1911
|
'completion:Output shell completion script'
|
|
1837
1912
|
)
|
|
@@ -2019,6 +2094,62 @@ _cu() {
|
|
|
2019
2094
|
'--remove[Comma-separated tag names to remove]:tags:' \\
|
|
2020
2095
|
'--json[Force JSON output]'
|
|
2021
2096
|
;;
|
|
2097
|
+
checklist)
|
|
2098
|
+
local -a checklist_cmds
|
|
2099
|
+
checklist_cmds=(
|
|
2100
|
+
'view:View checklists on a task'
|
|
2101
|
+
'create:Create a checklist on a task'
|
|
2102
|
+
'delete:Delete a checklist'
|
|
2103
|
+
'add-item:Add an item to a checklist'
|
|
2104
|
+
'edit-item:Edit a checklist item'
|
|
2105
|
+
'delete-item:Delete a checklist item'
|
|
2106
|
+
)
|
|
2107
|
+
_arguments -C \\
|
|
2108
|
+
'1:checklist command:->checklist_cmd' \\
|
|
2109
|
+
'*::checklist_arg:->checklist_args'
|
|
2110
|
+
case $state in
|
|
2111
|
+
checklist_cmd)
|
|
2112
|
+
_describe 'checklist command' checklist_cmds
|
|
2113
|
+
;;
|
|
2114
|
+
checklist_args)
|
|
2115
|
+
case $words[1] in
|
|
2116
|
+
view)
|
|
2117
|
+
_arguments '1:task_id:' '--json[Force JSON output]'
|
|
2118
|
+
;;
|
|
2119
|
+
create)
|
|
2120
|
+
_arguments '1:task_id:' '2:name:' '--json[Force JSON output]'
|
|
2121
|
+
;;
|
|
2122
|
+
delete)
|
|
2123
|
+
_arguments '1:checklist_id:' '--json[Force JSON output]'
|
|
2124
|
+
;;
|
|
2125
|
+
add-item)
|
|
2126
|
+
_arguments '1:checklist_id:' '2:name:' '--json[Force JSON output]'
|
|
2127
|
+
;;
|
|
2128
|
+
edit-item)
|
|
2129
|
+
_arguments \\
|
|
2130
|
+
'1:checklist_id:' \\
|
|
2131
|
+
'2:checklist_item_id:' \\
|
|
2132
|
+
'--name[New item name]:name:' \\
|
|
2133
|
+
'--resolved[Mark item as resolved]' \\
|
|
2134
|
+
'--unresolved[Mark item as unresolved]' \\
|
|
2135
|
+
'--assignee[Assign user by ID]:user_id:' \\
|
|
2136
|
+
'--json[Force JSON output]'
|
|
2137
|
+
;;
|
|
2138
|
+
delete-item)
|
|
2139
|
+
_arguments '1:checklist_id:' '2:checklist_item_id:' '--json[Force JSON output]'
|
|
2140
|
+
;;
|
|
2141
|
+
esac
|
|
2142
|
+
;;
|
|
2143
|
+
esac
|
|
2144
|
+
;;
|
|
2145
|
+
comment-edit)
|
|
2146
|
+
_arguments \\
|
|
2147
|
+
'1:comment_id:' \\
|
|
2148
|
+
'(-m --message)'{-m,--message}'[New comment text]:text:' \\
|
|
2149
|
+
'--resolved[Mark comment as resolved]' \\
|
|
2150
|
+
'--unresolved[Mark comment as unresolved]' \\
|
|
2151
|
+
'--json[Force JSON output]'
|
|
2152
|
+
;;
|
|
2022
2153
|
config)
|
|
2023
2154
|
local -a config_cmds
|
|
2024
2155
|
config_cmds=(
|
|
@@ -2085,6 +2216,8 @@ complete -c cu -n __fish_use_subcommand -a move -d 'Add or remove a task from a
|
|
|
2085
2216
|
complete -c cu -n __fish_use_subcommand -a field -d 'Set or remove a custom field value on a task'
|
|
2086
2217
|
complete -c cu -n __fish_use_subcommand -a delete -d 'Delete a task'
|
|
2087
2218
|
complete -c cu -n __fish_use_subcommand -a tag -d 'Add or remove tags from a task'
|
|
2219
|
+
complete -c cu -n __fish_use_subcommand -a checklist -d 'Manage checklists on a task'
|
|
2220
|
+
complete -c cu -n __fish_use_subcommand -a comment-edit -d 'Edit an existing comment'
|
|
2088
2221
|
complete -c cu -n __fish_use_subcommand -a config -d 'Manage CLI configuration'
|
|
2089
2222
|
complete -c cu -n __fish_use_subcommand -a completion -d 'Output shell completion script'
|
|
2090
2223
|
|
|
@@ -2194,6 +2327,23 @@ complete -c cu -n '__fish_seen_subcommand_from tag' -l add -d 'Comma-separated t
|
|
|
2194
2327
|
complete -c cu -n '__fish_seen_subcommand_from tag' -l remove -d 'Comma-separated tag names to remove'
|
|
2195
2328
|
complete -c cu -n '__fish_seen_subcommand_from tag' -l json -d 'Force JSON output'
|
|
2196
2329
|
|
|
2330
|
+
complete -c cu -n '__fish_seen_subcommand_from checklist; and not __fish_seen_subcommand_from view create delete add-item edit-item delete-item' -a view -d 'View checklists on a task'
|
|
2331
|
+
complete -c cu -n '__fish_seen_subcommand_from checklist; and not __fish_seen_subcommand_from view create delete add-item edit-item delete-item' -a create -d 'Create a checklist on a task'
|
|
2332
|
+
complete -c cu -n '__fish_seen_subcommand_from checklist; and not __fish_seen_subcommand_from view create delete add-item edit-item delete-item' -a delete -d 'Delete a checklist'
|
|
2333
|
+
complete -c cu -n '__fish_seen_subcommand_from checklist; and not __fish_seen_subcommand_from view create delete add-item edit-item delete-item' -a add-item -d 'Add an item to a checklist'
|
|
2334
|
+
complete -c cu -n '__fish_seen_subcommand_from checklist; and not __fish_seen_subcommand_from view create delete add-item edit-item delete-item' -a edit-item -d 'Edit a checklist item'
|
|
2335
|
+
complete -c cu -n '__fish_seen_subcommand_from checklist; and not __fish_seen_subcommand_from view create delete add-item edit-item delete-item' -a delete-item -d 'Delete a checklist item'
|
|
2336
|
+
complete -c cu -n '__fish_seen_subcommand_from view create delete add-item edit-item delete-item' -l json -d 'Force JSON output'
|
|
2337
|
+
complete -c cu -n '__fish_seen_subcommand_from edit-item' -l name -d 'New item name'
|
|
2338
|
+
complete -c cu -n '__fish_seen_subcommand_from edit-item' -l resolved -d 'Mark item as resolved'
|
|
2339
|
+
complete -c cu -n '__fish_seen_subcommand_from edit-item' -l unresolved -d 'Mark item as unresolved'
|
|
2340
|
+
complete -c cu -n '__fish_seen_subcommand_from edit-item' -l assignee -d 'Assign user by ID'
|
|
2341
|
+
|
|
2342
|
+
complete -c cu -n '__fish_seen_subcommand_from comment-edit' -s m -l message -d 'New comment text'
|
|
2343
|
+
complete -c cu -n '__fish_seen_subcommand_from comment-edit' -l resolved -d 'Mark comment as resolved'
|
|
2344
|
+
complete -c cu -n '__fish_seen_subcommand_from comment-edit' -l unresolved -d 'Mark comment as unresolved'
|
|
2345
|
+
complete -c cu -n '__fish_seen_subcommand_from comment-edit' -l json -d 'Force JSON output'
|
|
2346
|
+
|
|
2197
2347
|
complete -c cu -n '__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set path' -a get -d 'Print a config value'
|
|
2198
2348
|
complete -c cu -n '__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set path' -a set -d 'Set a config value'
|
|
2199
2349
|
complete -c cu -n '__fish_seen_subcommand_from config; and not __fish_seen_subcommand_from get set path' -a path -d 'Print config file path'
|
|
@@ -2448,6 +2598,59 @@ async function manageTags(config, taskId, opts) {
|
|
|
2448
2598
|
return { taskId, added, removed };
|
|
2449
2599
|
}
|
|
2450
2600
|
|
|
2601
|
+
// src/commands/checklist.ts
|
|
2602
|
+
import chalk5 from "chalk";
|
|
2603
|
+
async function viewChecklists(config, taskId) {
|
|
2604
|
+
const client = new ClickUpClient(config);
|
|
2605
|
+
const task = await client.getTask(taskId);
|
|
2606
|
+
return task.checklists ?? [];
|
|
2607
|
+
}
|
|
2608
|
+
async function createChecklist(config, taskId, name) {
|
|
2609
|
+
const client = new ClickUpClient(config);
|
|
2610
|
+
return client.createChecklist(taskId, name);
|
|
2611
|
+
}
|
|
2612
|
+
async function deleteChecklist(config, checklistId) {
|
|
2613
|
+
const client = new ClickUpClient(config);
|
|
2614
|
+
await client.deleteChecklist(checklistId);
|
|
2615
|
+
return { checklistId };
|
|
2616
|
+
}
|
|
2617
|
+
async function addChecklistItem(config, checklistId, name) {
|
|
2618
|
+
const client = new ClickUpClient(config);
|
|
2619
|
+
return client.createChecklistItem(checklistId, name);
|
|
2620
|
+
}
|
|
2621
|
+
async function editChecklistItem(config, checklistId, checklistItemId, updates) {
|
|
2622
|
+
const client = new ClickUpClient(config);
|
|
2623
|
+
return client.editChecklistItem(checklistId, checklistItemId, updates);
|
|
2624
|
+
}
|
|
2625
|
+
async function deleteChecklistItem(config, checklistId, checklistItemId) {
|
|
2626
|
+
const client = new ClickUpClient(config);
|
|
2627
|
+
await client.deleteChecklistItem(checklistId, checklistItemId);
|
|
2628
|
+
return { checklistId, checklistItemId };
|
|
2629
|
+
}
|
|
2630
|
+
function formatChecklists(checklists) {
|
|
2631
|
+
if (checklists.length === 0) return "No checklists";
|
|
2632
|
+
const lines = [];
|
|
2633
|
+
for (const cl of checklists) {
|
|
2634
|
+
const resolved = cl.items.filter((i) => i.resolved).length;
|
|
2635
|
+
lines.push(chalk5.bold(`${cl.name} (${resolved}/${cl.items.length})`));
|
|
2636
|
+
lines.push(chalk5.dim(` ID: ${cl.id}`));
|
|
2637
|
+
for (const item of cl.items) {
|
|
2638
|
+
const check = item.resolved ? chalk5.green("[x]") : chalk5.dim("[ ]");
|
|
2639
|
+
const assignee = item.assignee ? chalk5.dim(` @${item.assignee.username}`) : "";
|
|
2640
|
+
lines.push(` ${check} ${item.name}${assignee}`);
|
|
2641
|
+
lines.push(chalk5.dim(` item-id: ${item.id}`));
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
return lines.join("\n");
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
// src/commands/comment-edit.ts
|
|
2648
|
+
async function editComment(config, commentId, text, resolved) {
|
|
2649
|
+
if (!text.trim()) throw new Error("Comment text cannot be empty");
|
|
2650
|
+
const client = new ClickUpClient(config);
|
|
2651
|
+
await client.updateComment(commentId, text, resolved);
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2451
2654
|
// src/index.ts
|
|
2452
2655
|
var require2 = createRequire(import.meta.url);
|
|
2453
2656
|
var { version } = require2("../package.json");
|
|
@@ -2589,6 +2792,22 @@ program.command("comments <taskId>").description("List comments on a task").opti
|
|
|
2589
2792
|
printComments(comments, opts.json ?? false);
|
|
2590
2793
|
})
|
|
2591
2794
|
);
|
|
2795
|
+
program.command("comment-edit <commentId>").description("Edit an existing comment").requiredOption("-m, --message <text>", "New comment text").option("--resolved", "Mark comment as resolved").option("--unresolved", "Mark comment as unresolved").option("--json", "Force JSON output even in terminal").action(
|
|
2796
|
+
wrapAction(
|
|
2797
|
+
async (commentId, opts) => {
|
|
2798
|
+
const config = loadConfig();
|
|
2799
|
+
let resolved;
|
|
2800
|
+
if (opts.resolved) resolved = true;
|
|
2801
|
+
if (opts.unresolved) resolved = false;
|
|
2802
|
+
await editComment(config, commentId, opts.message, resolved);
|
|
2803
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
2804
|
+
console.log(JSON.stringify({ success: true, commentId }, null, 2));
|
|
2805
|
+
} else {
|
|
2806
|
+
console.log(`Comment ${commentId} updated`);
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
)
|
|
2810
|
+
);
|
|
2592
2811
|
program.command("activity <taskId>").description("Show task details and comments combined").option("--json", "Force JSON output even in terminal").action(
|
|
2593
2812
|
wrapAction(async (taskId, opts) => {
|
|
2594
2813
|
const config = loadConfig();
|
|
@@ -2754,6 +2973,82 @@ program.command("tag <taskId>").description("Add or remove tags from a task").op
|
|
|
2754
2973
|
}
|
|
2755
2974
|
})
|
|
2756
2975
|
);
|
|
2976
|
+
var checklistCmd = program.command("checklist").description("Manage checklists on a task");
|
|
2977
|
+
checklistCmd.command("view <taskId>").description("View checklists on a task").option("--json", "Force JSON output even in terminal").action(
|
|
2978
|
+
wrapAction(async (taskId, opts) => {
|
|
2979
|
+
const config = loadConfig();
|
|
2980
|
+
const checklists = await viewChecklists(config, taskId);
|
|
2981
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
2982
|
+
console.log(JSON.stringify(checklists, null, 2));
|
|
2983
|
+
} else {
|
|
2984
|
+
console.log(formatChecklists(checklists));
|
|
2985
|
+
}
|
|
2986
|
+
})
|
|
2987
|
+
);
|
|
2988
|
+
checklistCmd.command("create <taskId> <name>").description("Create a checklist on a task").option("--json", "Force JSON output even in terminal").action(
|
|
2989
|
+
wrapAction(async (taskId, name, opts) => {
|
|
2990
|
+
const config = loadConfig();
|
|
2991
|
+
const result = await createChecklist(config, taskId, name);
|
|
2992
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
2993
|
+
console.log(JSON.stringify(result, null, 2));
|
|
2994
|
+
} else {
|
|
2995
|
+
console.log(`Created checklist "${result.name}" (id: ${result.id})`);
|
|
2996
|
+
}
|
|
2997
|
+
})
|
|
2998
|
+
);
|
|
2999
|
+
checklistCmd.command("delete <checklistId>").description("Delete a checklist").option("--json", "Force JSON output even in terminal").action(
|
|
3000
|
+
wrapAction(async (checklistId, opts) => {
|
|
3001
|
+
const config = loadConfig();
|
|
3002
|
+
const result = await deleteChecklist(config, checklistId);
|
|
3003
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
3004
|
+
console.log(JSON.stringify(result, null, 2));
|
|
3005
|
+
} else {
|
|
3006
|
+
console.log(`Deleted checklist ${result.checklistId}`);
|
|
3007
|
+
}
|
|
3008
|
+
})
|
|
3009
|
+
);
|
|
3010
|
+
checklistCmd.command("add-item <checklistId> <name>").description("Add an item to a checklist").option("--json", "Force JSON output even in terminal").action(
|
|
3011
|
+
wrapAction(async (checklistId, name, opts) => {
|
|
3012
|
+
const config = loadConfig();
|
|
3013
|
+
const result = await addChecklistItem(config, checklistId, name);
|
|
3014
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
3015
|
+
console.log(JSON.stringify(result, null, 2));
|
|
3016
|
+
} else {
|
|
3017
|
+
console.log(`Added item "${name}" to checklist ${checklistId}`);
|
|
3018
|
+
}
|
|
3019
|
+
})
|
|
3020
|
+
);
|
|
3021
|
+
checklistCmd.command("edit-item <checklistId> <checklistItemId>").description("Edit a checklist item").option("--name <name>", "New item name").option("--resolved", "Mark item as resolved").option("--unresolved", "Mark item as unresolved").option("--assignee <userId>", 'Assign user by ID (use "null" to unassign)').option("--json", "Force JSON output even in terminal").action(
|
|
3022
|
+
wrapAction(
|
|
3023
|
+
async (checklistId, checklistItemId, opts) => {
|
|
3024
|
+
const config = loadConfig();
|
|
3025
|
+
const updates = {};
|
|
3026
|
+
if (opts.name) updates.name = opts.name;
|
|
3027
|
+
if (opts.resolved) updates.resolved = true;
|
|
3028
|
+
if (opts.unresolved) updates.resolved = false;
|
|
3029
|
+
if (opts.assignee !== void 0) {
|
|
3030
|
+
updates.assignee = opts.assignee === "null" ? null : Number(opts.assignee);
|
|
3031
|
+
}
|
|
3032
|
+
const result = await editChecklistItem(config, checklistId, checklistItemId, updates);
|
|
3033
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
3034
|
+
console.log(JSON.stringify(result, null, 2));
|
|
3035
|
+
} else {
|
|
3036
|
+
console.log(`Updated checklist item ${checklistItemId}`);
|
|
3037
|
+
}
|
|
3038
|
+
}
|
|
3039
|
+
)
|
|
3040
|
+
);
|
|
3041
|
+
checklistCmd.command("delete-item <checklistId> <checklistItemId>").description("Delete a checklist item").option("--json", "Force JSON output even in terminal").action(
|
|
3042
|
+
wrapAction(async (checklistId, checklistItemId, opts) => {
|
|
3043
|
+
const config = loadConfig();
|
|
3044
|
+
const result = await deleteChecklistItem(config, checklistId, checklistItemId);
|
|
3045
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
3046
|
+
console.log(JSON.stringify(result, null, 2));
|
|
3047
|
+
} else {
|
|
3048
|
+
console.log(`Deleted checklist item ${result.checklistItemId}`);
|
|
3049
|
+
}
|
|
3050
|
+
})
|
|
3051
|
+
);
|
|
2757
3052
|
var configCmd = program.command("config").description("Manage CLI configuration");
|
|
2758
3053
|
configCmd.command("get <key>").description("Print a config value").action(
|
|
2759
3054
|
wrapAction(async (key) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: clickup
|
|
3
|
-
description: 'Use when managing ClickUp tasks, sprints, or comments via the `cu` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, standup summaries, searching tasks, checking overdue items, assigning tasks, listing spaces and lists, opening tasks in browser, checking auth or config, setting custom fields, deleting tasks, managing tags.'
|
|
3
|
+
description: 'Use when managing ClickUp tasks, sprints, or comments via the `cu` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, standup summaries, searching tasks, checking overdue items, assigning tasks, listing spaces and lists, opening tasks in browser, checking auth or config, setting custom fields, deleting tasks, managing tags, managing checklists, editing comments.'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ClickUp CLI (`cu`)
|
|
@@ -60,12 +60,19 @@ All commands support `--help` for full flag details.
|
|
|
60
60
|
| `cu update <id> [-n name] [-d desc] [-s status] [--priority p] [--due-date d] [--time-estimate t] [--assignee id\|me] [--parent id] [--json]` | Update task fields (desc supports markdown) |
|
|
61
61
|
| `cu create -n name [-l listId] [-p parentId] [-d desc] [-s status] [--priority p] [--due-date d] [--time-estimate t] [--assignee id\|me] [--tags t] [--custom-item-id n] [--json]` | Create task (desc supports markdown) |
|
|
62
62
|
| `cu comment <id> -m text [--json]` | Post comment on task |
|
|
63
|
+
| `cu comment-edit <commentId> -m text [--resolved] [--unresolved] [--json]` | Edit an existing comment |
|
|
63
64
|
| `cu assign <id> [--to userId\|me] [--remove userId\|me] [--json]` | Assign/unassign users |
|
|
64
65
|
| `cu depend <id> [--on taskId] [--blocks taskId] [--remove] [--json]` | Add/remove task dependencies |
|
|
65
66
|
| `cu move <id> [--to listId] [--remove listId] [--json]` | Add/remove task from lists |
|
|
66
67
|
| `cu field <id> [--set "Name" value] [--remove "Name"] [--json]` | Set/remove custom field values |
|
|
67
68
|
| `cu delete <id> [--confirm] [--json]` | Delete a task (DESTRUCTIVE, irreversible) |
|
|
68
69
|
| `cu tag <id> [--add tags] [--remove tags] [--json]` | Add/remove tags on a task |
|
|
70
|
+
| `cu checklist view <id> [--json]` | View checklists on a task |
|
|
71
|
+
| `cu checklist create <id> <name> [--json]` | Create a checklist |
|
|
72
|
+
| `cu checklist delete <checklistId> [--json]` | Delete a checklist |
|
|
73
|
+
| `cu checklist add-item <checklistId> <name> [--json]` | Add item to a checklist |
|
|
74
|
+
| `cu checklist edit-item <checklistId> <itemId> [--name n] [--resolved] [--unresolved] [--assignee id] [--json]` | Edit a checklist item |
|
|
75
|
+
| `cu checklist delete-item <checklistId> <itemId> [--json]` | Delete a checklist item |
|
|
69
76
|
| `cu config get <key>` / `cu config set <key> <value>` / `cu config path` | Manage CLI config |
|
|
70
77
|
| `cu completion <shell>` | Shell completions (bash/zsh/fish) |
|
|
71
78
|
|
|
@@ -98,7 +105,9 @@ All commands support `--help` for full flag details.
|
|
|
98
105
|
| `cu summary` | Categories: completed (done/complete/closed within N hours), in progress, overdue |
|
|
99
106
|
| `cu overdue` | Excludes closed tasks, sorted most overdue first |
|
|
100
107
|
| `cu open` | Tries task ID first, falls back to name search |
|
|
101
|
-
| `cu
|
|
108
|
+
| `cu checklist` | Full CRUD for task checklists: view, create, delete, add-item, edit-item, delete-item |
|
|
109
|
+
| `cu comment-edit` | Edit comment text and resolution status |
|
|
110
|
+
| `cu task` | Shows custom fields and checklists in detail view |
|
|
102
111
|
| `cu lists` | Discovers list IDs needed for `--list` and `cu create -l` |
|
|
103
112
|
| Errors | stderr with exit code 1 |
|
|
104
113
|
| Parsing | Strict - excess/unknown arguments rejected |
|
|
@@ -150,6 +159,11 @@ cu field abc123def --set "Category" "Bug Fix"
|
|
|
150
159
|
cu field abc123def --remove "Old Field"
|
|
151
160
|
cu tag abc123def --add "bug,frontend"
|
|
152
161
|
cu tag abc123def --remove "triage"
|
|
162
|
+
cu checklist view abc123def # view checklists
|
|
163
|
+
cu checklist create abc123def "QA Steps" # add checklist
|
|
164
|
+
cu checklist add-item <clId> "Run unit tests" # add item
|
|
165
|
+
cu checklist edit-item <clId> <itemId> --resolved # check off item
|
|
166
|
+
cu comment-edit <commentId> -m "Updated findings" # edit a comment
|
|
153
167
|
cu delete abc123def --confirm # irreversible!
|
|
154
168
|
```
|
|
155
169
|
|