@krodak/clickup-cli 1.13.0 → 1.14.1
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/.claude-plugin/plugin.json +1 -1
- package/dist/index.js +153 -66
- package/package.json +1 -1
- package/skills/clickup-cli/SKILL.md +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clickup-cli",
|
|
3
3
|
"description": "ClickUp CLI skills for managing tasks, sprints, comments, checklists, custom fields, tags, and time tracking via the cup command",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.14.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Krzysztof Rodak"
|
|
7
7
|
},
|
package/dist/index.js
CHANGED
|
@@ -1708,6 +1708,9 @@ function parseTimeEstimate(value) {
|
|
|
1708
1708
|
);
|
|
1709
1709
|
}
|
|
1710
1710
|
function buildUpdatePayload(opts) {
|
|
1711
|
+
if (opts.archive && opts.unarchive) {
|
|
1712
|
+
throw new Error("Cannot use --archive and --unarchive together");
|
|
1713
|
+
}
|
|
1711
1714
|
const payload = {};
|
|
1712
1715
|
if (opts.name !== void 0) {
|
|
1713
1716
|
if (!opts.name.trim()) throw new Error("Task name cannot be empty");
|
|
@@ -1727,10 +1730,12 @@ function buildUpdatePayload(opts) {
|
|
|
1727
1730
|
payload.time_estimate = parseTimeEstimate(opts.timeEstimate);
|
|
1728
1731
|
}
|
|
1729
1732
|
if (opts.parent !== void 0) payload.parent = opts.parent;
|
|
1733
|
+
if (opts.archive) payload.archived = true;
|
|
1734
|
+
if (opts.unarchive) payload.archived = false;
|
|
1730
1735
|
return payload;
|
|
1731
1736
|
}
|
|
1732
1737
|
function hasUpdateFields(options) {
|
|
1733
|
-
return options.name !== void 0 || options.description !== void 0 || options.markdown_content !== void 0 || options.status !== void 0 || options.priority !== void 0 || options.due_date !== void 0 || options.time_estimate !== void 0 || options.assignees !== void 0 || options.parent !== void 0;
|
|
1738
|
+
return options.name !== void 0 || options.description !== void 0 || options.markdown_content !== void 0 || options.status !== void 0 || options.priority !== void 0 || options.due_date !== void 0 || options.time_estimate !== void 0 || options.assignees !== void 0 || options.parent !== void 0 || options.archived !== void 0;
|
|
1734
1739
|
}
|
|
1735
1740
|
async function resolveStatus(client, taskId, statusInput) {
|
|
1736
1741
|
const task = await client.getTask(taskId);
|
|
@@ -1749,7 +1754,7 @@ async function resolveStatus(client, taskId, statusInput) {
|
|
|
1749
1754
|
async function updateTask(config, taskId, options) {
|
|
1750
1755
|
if (!hasUpdateFields(options))
|
|
1751
1756
|
throw new Error(
|
|
1752
|
-
"Provide at least one of: --name, --description, --status, --priority, --due-date, --time-estimate, --assignee, --parent"
|
|
1757
|
+
"Provide at least one of: --name, --description, --status, --priority, --due-date, --time-estimate, --assignee, --parent, --archive, --unarchive"
|
|
1753
1758
|
);
|
|
1754
1759
|
const client = new ClickUpClient(config);
|
|
1755
1760
|
if (options.status !== void 0) {
|
|
@@ -2491,6 +2496,7 @@ async function openTask(config, query, opts = {}) {
|
|
|
2491
2496
|
}
|
|
2492
2497
|
|
|
2493
2498
|
// src/commands/summary.ts
|
|
2499
|
+
import chalk5 from "chalk";
|
|
2494
2500
|
var IN_PROGRESS_PATTERNS = ["in progress", "in review", "code review", "doing"];
|
|
2495
2501
|
function isCompletedRecently(task, cutoff) {
|
|
2496
2502
|
if (!isDoneStatus(task.status.status)) return false;
|
|
@@ -2526,9 +2532,16 @@ function categorizeTasks(tasks, hoursBack, typeMap) {
|
|
|
2526
2532
|
}
|
|
2527
2533
|
return { completed, inProgress, overdue };
|
|
2528
2534
|
}
|
|
2535
|
+
function colorSectionLabel(label) {
|
|
2536
|
+
const lower = label.toLowerCase();
|
|
2537
|
+
if (lower.includes("completed")) return chalk5.green(label);
|
|
2538
|
+
if (lower.includes("progress")) return chalk5.yellow(label);
|
|
2539
|
+
if (lower.includes("overdue")) return chalk5.red(label);
|
|
2540
|
+
return label;
|
|
2541
|
+
}
|
|
2529
2542
|
function printSection(label, tasks) {
|
|
2530
2543
|
console.log(`
|
|
2531
|
-
${label} (${tasks.length})`);
|
|
2544
|
+
${colorSectionLabel(label)} (${tasks.length})`);
|
|
2532
2545
|
if (tasks.length === 0) {
|
|
2533
2546
|
console.log(" None");
|
|
2534
2547
|
} else {
|
|
@@ -2648,7 +2661,7 @@ async function assignTask(config, taskId, opts) {
|
|
|
2648
2661
|
}
|
|
2649
2662
|
|
|
2650
2663
|
// src/commands/activity.ts
|
|
2651
|
-
import
|
|
2664
|
+
import chalk6 from "chalk";
|
|
2652
2665
|
async function fetchActivity(config, taskId) {
|
|
2653
2666
|
const client = new ClickUpClient(config);
|
|
2654
2667
|
const [task, rawComments] = await Promise.all([
|
|
@@ -2680,8 +2693,8 @@ ${commentsMd}`);
|
|
|
2680
2693
|
}
|
|
2681
2694
|
console.log(formatTaskDetail(result.task));
|
|
2682
2695
|
console.log("");
|
|
2683
|
-
console.log(
|
|
2684
|
-
console.log(
|
|
2696
|
+
console.log(chalk6.bold("Comments"));
|
|
2697
|
+
console.log(chalk6.dim("-".repeat(60)));
|
|
2685
2698
|
if (result.comments.length === 0) {
|
|
2686
2699
|
console.log("No comments.");
|
|
2687
2700
|
return;
|
|
@@ -2690,9 +2703,9 @@ ${commentsMd}`);
|
|
|
2690
2703
|
const c = result.comments[i];
|
|
2691
2704
|
if (i > 0) {
|
|
2692
2705
|
console.log("");
|
|
2693
|
-
console.log(
|
|
2706
|
+
console.log(chalk6.dim("-".repeat(60)));
|
|
2694
2707
|
}
|
|
2695
|
-
console.log(`${
|
|
2708
|
+
console.log(`${chalk6.bold(c.user)} ${chalk6.dim(formatTimestamp(c.date))}`);
|
|
2696
2709
|
console.log(c.text);
|
|
2697
2710
|
}
|
|
2698
2711
|
}
|
|
@@ -2750,6 +2763,8 @@ var commandMetadata = [
|
|
|
2750
2763
|
"--time-estimate",
|
|
2751
2764
|
"--assignee",
|
|
2752
2765
|
"--parent",
|
|
2766
|
+
"--archive",
|
|
2767
|
+
"--unarchive",
|
|
2753
2768
|
"--field",
|
|
2754
2769
|
"--json"
|
|
2755
2770
|
],
|
|
@@ -3663,6 +3678,9 @@ ${renderZshTopLevelCommands(name)}
|
|
|
3663
3678
|
'--time-estimate[Time estimate]:duration:' \\
|
|
3664
3679
|
'--assignee[Add assignee]:user_id:' \\
|
|
3665
3680
|
'--parent[Set parent task]:task_id:' \\
|
|
3681
|
+
'--archive[Archive the task]' \\
|
|
3682
|
+
'--unarchive[Unarchive the task]' \\
|
|
3683
|
+
'--field[Set custom field]:field_name_and_value:' \\
|
|
3666
3684
|
'--json[Force JSON output]'
|
|
3667
3685
|
;;
|
|
3668
3686
|
create)
|
|
@@ -4595,7 +4613,7 @@ async function manageTags(config, taskId, opts) {
|
|
|
4595
4613
|
}
|
|
4596
4614
|
|
|
4597
4615
|
// src/commands/checklist.ts
|
|
4598
|
-
import
|
|
4616
|
+
import chalk7 from "chalk";
|
|
4599
4617
|
async function viewChecklists(config, taskId) {
|
|
4600
4618
|
const client = new ClickUpClient(config);
|
|
4601
4619
|
const task = await client.getTask(taskId);
|
|
@@ -4628,13 +4646,14 @@ function formatChecklists(checklists) {
|
|
|
4628
4646
|
const lines = [];
|
|
4629
4647
|
for (const cl of checklists) {
|
|
4630
4648
|
const resolved = cl.items.filter((i) => i.resolved).length;
|
|
4631
|
-
lines.push(
|
|
4632
|
-
lines.push(
|
|
4649
|
+
lines.push(chalk7.bold(`${cl.name} (${resolved}/${cl.items.length})`));
|
|
4650
|
+
lines.push(chalk7.dim(` ID: ${cl.id}`));
|
|
4633
4651
|
for (const item of cl.items) {
|
|
4634
|
-
const check = item.resolved ?
|
|
4635
|
-
const
|
|
4636
|
-
|
|
4637
|
-
lines.push(
|
|
4652
|
+
const check = item.resolved ? chalk7.green("[x]") : chalk7.dim("[ ]");
|
|
4653
|
+
const name = item.resolved ? chalk7.dim(item.name) : item.name;
|
|
4654
|
+
const assignee = item.assignee ? chalk7.dim(` @${item.assignee.username}`) : "";
|
|
4655
|
+
lines.push(` ${check} ${name}${assignee}`);
|
|
4656
|
+
lines.push(chalk7.dim(` item-id: ${item.id}`));
|
|
4638
4657
|
}
|
|
4639
4658
|
}
|
|
4640
4659
|
return lines.join("\n");
|
|
@@ -4665,7 +4684,7 @@ async function deleteComment(config, commentId) {
|
|
|
4665
4684
|
}
|
|
4666
4685
|
|
|
4667
4686
|
// src/commands/replies.ts
|
|
4668
|
-
import
|
|
4687
|
+
import chalk8 from "chalk";
|
|
4669
4688
|
async function getReplies(config, commentId) {
|
|
4670
4689
|
const client = new ClickUpClient(config);
|
|
4671
4690
|
return client.getThreadedComments(commentId);
|
|
@@ -4680,7 +4699,7 @@ function formatReplies(replies) {
|
|
|
4680
4699
|
return replies.map((r) => {
|
|
4681
4700
|
const user = r.user?.username ?? "Unknown";
|
|
4682
4701
|
const date = formatTimestamp(Number(r.date));
|
|
4683
|
-
return `${
|
|
4702
|
+
return `${chalk8.bold(user)} ${chalk8.dim(date)}
|
|
4684
4703
|
${r.comment_text}`;
|
|
4685
4704
|
}).join("\n\n");
|
|
4686
4705
|
}
|
|
@@ -4719,7 +4738,10 @@ async function attachFile(config, taskId, filePath) {
|
|
|
4719
4738
|
}
|
|
4720
4739
|
|
|
4721
4740
|
// src/commands/docs.ts
|
|
4722
|
-
|
|
4741
|
+
var DOC_COLUMNS = [
|
|
4742
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
4743
|
+
{ key: "name", label: "Name", maxWidth: 60 }
|
|
4744
|
+
];
|
|
4723
4745
|
async function listDocs(config, query) {
|
|
4724
4746
|
const client = new ClickUpClient(config);
|
|
4725
4747
|
const docs = await client.getDocs(config.teamId);
|
|
@@ -4731,7 +4753,8 @@ async function listDocs(config, query) {
|
|
|
4731
4753
|
}
|
|
4732
4754
|
function formatDocs(docs) {
|
|
4733
4755
|
if (docs.length === 0) return "No docs found";
|
|
4734
|
-
|
|
4756
|
+
const rows = docs.map((d) => ({ name: d.name, id: d.id }));
|
|
4757
|
+
return formatTable(rows, DOC_COLUMNS);
|
|
4735
4758
|
}
|
|
4736
4759
|
function formatDocsMarkdown(docs) {
|
|
4737
4760
|
if (docs.length === 0) return "No docs found";
|
|
@@ -4858,7 +4881,7 @@ function formatFolders(folders) {
|
|
|
4858
4881
|
return folders.map((f) => {
|
|
4859
4882
|
const header = `${chalk10.bold(f.name)} ${chalk10.dim(f.id)}`;
|
|
4860
4883
|
if (f.lists.length === 0) return header;
|
|
4861
|
-
const listLines = f.lists.map((l) => ` ${l.name} ${chalk10.dim(l.id)}`);
|
|
4884
|
+
const listLines = f.lists.map((l) => ` ${chalk10.dim(">")} ${l.name} ${chalk10.dim(l.id)}`);
|
|
4862
4885
|
return [header, ...listLines].join("\n");
|
|
4863
4886
|
}).join("\n\n");
|
|
4864
4887
|
}
|
|
@@ -4874,6 +4897,13 @@ function formatFoldersMarkdown(folders) {
|
|
|
4874
4897
|
|
|
4875
4898
|
// src/commands/time.ts
|
|
4876
4899
|
import chalk11 from "chalk";
|
|
4900
|
+
var TIME_COLUMNS = [
|
|
4901
|
+
{ key: "task", label: "Task", maxWidth: 35 },
|
|
4902
|
+
{ key: "duration", label: "Duration", maxWidth: 10 },
|
|
4903
|
+
{ key: "date", label: "Date", maxWidth: 20 },
|
|
4904
|
+
{ key: "description", label: "Description", maxWidth: 30 },
|
|
4905
|
+
{ key: "status", label: "", maxWidth: 10, format: (v) => v === "RUNNING" ? chalk11.green(v) : "" }
|
|
4906
|
+
];
|
|
4877
4907
|
async function startTimer(config, taskId, description) {
|
|
4878
4908
|
const client = new ClickUpClient(config);
|
|
4879
4909
|
return client.startTimeEntry(config.teamId, taskId, description);
|
|
@@ -4917,22 +4947,33 @@ async function deleteTimeEntry(config, timeEntryId) {
|
|
|
4917
4947
|
await client.deleteTimeEntry(config.teamId, timeEntryId);
|
|
4918
4948
|
}
|
|
4919
4949
|
function formatTimeEntry(entry) {
|
|
4920
|
-
const lines = [];
|
|
4921
4950
|
const taskName = entry.task?.name ?? "No task";
|
|
4922
|
-
const taskId = entry.task?.id ?? "";
|
|
4923
4951
|
const isRunning = entry.duration < 0;
|
|
4924
4952
|
const elapsed = isRunning ? Date.now() - Number(entry.start) : entry.duration;
|
|
4925
|
-
const
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4953
|
+
const row = {
|
|
4954
|
+
task: taskName,
|
|
4955
|
+
duration: formatDuration(elapsed),
|
|
4956
|
+
date: formatTimestamp(entry.start),
|
|
4957
|
+
description: entry.description ?? "",
|
|
4958
|
+
status: isRunning ? "RUNNING" : ""
|
|
4959
|
+
};
|
|
4960
|
+
return formatTable([row], TIME_COLUMNS);
|
|
4932
4961
|
}
|
|
4933
4962
|
function formatTimeEntries(entries) {
|
|
4934
4963
|
if (entries.length === 0) return "No time entries";
|
|
4935
|
-
|
|
4964
|
+
const rows = entries.map((entry) => {
|
|
4965
|
+
const taskName = entry.task?.name ?? "No task";
|
|
4966
|
+
const isRunning = entry.duration < 0;
|
|
4967
|
+
const elapsed = isRunning ? Date.now() - Number(entry.start) : entry.duration;
|
|
4968
|
+
return {
|
|
4969
|
+
task: taskName,
|
|
4970
|
+
duration: formatDuration(elapsed),
|
|
4971
|
+
date: formatTimestamp(entry.start),
|
|
4972
|
+
description: entry.description ?? "",
|
|
4973
|
+
status: isRunning ? "RUNNING" : ""
|
|
4974
|
+
};
|
|
4975
|
+
});
|
|
4976
|
+
return formatTable(rows, TIME_COLUMNS);
|
|
4936
4977
|
}
|
|
4937
4978
|
function formatTimeEntryMarkdown(entry) {
|
|
4938
4979
|
const taskName = entry.task?.name ?? "No task";
|
|
@@ -4980,14 +5021,23 @@ function formatTagsMarkdown(tags) {
|
|
|
4980
5021
|
}
|
|
4981
5022
|
|
|
4982
5023
|
// src/commands/members.ts
|
|
4983
|
-
|
|
5024
|
+
var MEMBER_COLUMNS = [
|
|
5025
|
+
{ key: "username", label: "Username", maxWidth: 25 },
|
|
5026
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
5027
|
+
{ key: "email", label: "Email", maxWidth: 40 }
|
|
5028
|
+
];
|
|
4984
5029
|
async function listMembers(config) {
|
|
4985
5030
|
const client = new ClickUpClient(config);
|
|
4986
5031
|
return client.getWorkspaceMembers(config.teamId);
|
|
4987
5032
|
}
|
|
4988
5033
|
function formatMembers(members) {
|
|
4989
5034
|
if (members.length === 0) return "No members found";
|
|
4990
|
-
|
|
5035
|
+
const rows = members.map((m) => ({
|
|
5036
|
+
username: m.username,
|
|
5037
|
+
id: String(m.id),
|
|
5038
|
+
email: m.email
|
|
5039
|
+
}));
|
|
5040
|
+
return formatTable(rows, MEMBER_COLUMNS);
|
|
4991
5041
|
}
|
|
4992
5042
|
function formatMembersMarkdown(members) {
|
|
4993
5043
|
if (members.length === 0) return "No members found";
|
|
@@ -4995,18 +5045,31 @@ function formatMembersMarkdown(members) {
|
|
|
4995
5045
|
}
|
|
4996
5046
|
|
|
4997
5047
|
// src/commands/fields.ts
|
|
4998
|
-
import
|
|
5048
|
+
import chalk13 from "chalk";
|
|
5049
|
+
var FIELD_COLUMNS = [
|
|
5050
|
+
{ key: "name", label: "Name", maxWidth: 30 },
|
|
5051
|
+
{ key: "type", label: "Type", maxWidth: 15 },
|
|
5052
|
+
{
|
|
5053
|
+
key: "required",
|
|
5054
|
+
label: "Required",
|
|
5055
|
+
maxWidth: 10,
|
|
5056
|
+
format: (v) => v === "yes" ? chalk13.yellow(v) : chalk13.dim(v)
|
|
5057
|
+
},
|
|
5058
|
+
{ key: "options", label: "Options", maxWidth: 40 }
|
|
5059
|
+
];
|
|
4999
5060
|
async function listFields(config, listId) {
|
|
5000
5061
|
const client = new ClickUpClient(config);
|
|
5001
5062
|
return client.getListCustomFields(listId);
|
|
5002
5063
|
}
|
|
5003
5064
|
function formatFields(fields) {
|
|
5004
5065
|
if (fields.length === 0) return "No custom fields";
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5066
|
+
const rows = fields.map((f) => ({
|
|
5067
|
+
name: f.name,
|
|
5068
|
+
type: f.type,
|
|
5069
|
+
required: f.required ? "yes" : "no",
|
|
5070
|
+
options: f.type_config?.options?.map((o) => o.name).join(", ") ?? ""
|
|
5071
|
+
}));
|
|
5072
|
+
return formatTable(rows, FIELD_COLUMNS);
|
|
5010
5073
|
}
|
|
5011
5074
|
function formatFieldsMarkdown(fields) {
|
|
5012
5075
|
if (fields.length === 0) return "No custom fields";
|
|
@@ -5049,7 +5112,26 @@ async function bulkUpdateStatus(config, taskIds, status) {
|
|
|
5049
5112
|
}
|
|
5050
5113
|
|
|
5051
5114
|
// src/commands/goals.ts
|
|
5052
|
-
import
|
|
5115
|
+
import chalk14 from "chalk";
|
|
5116
|
+
function colorProgress(value) {
|
|
5117
|
+
const num = parseInt(value, 10);
|
|
5118
|
+
if (isNaN(num)) return value;
|
|
5119
|
+
if (num >= 75) return chalk14.green(value);
|
|
5120
|
+
if (num >= 25) return chalk14.yellow(value);
|
|
5121
|
+
return chalk14.red(value);
|
|
5122
|
+
}
|
|
5123
|
+
var GOAL_COLUMNS = [
|
|
5124
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
5125
|
+
{ key: "name", label: "Name", maxWidth: 40 },
|
|
5126
|
+
{ key: "progress", label: "Progress", maxWidth: 10, format: (v) => colorProgress(v) },
|
|
5127
|
+
{ key: "owner", label: "Owner", maxWidth: 20 }
|
|
5128
|
+
];
|
|
5129
|
+
var KEY_RESULT_COLUMNS = [
|
|
5130
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
5131
|
+
{ key: "name", label: "Name", maxWidth: 40 },
|
|
5132
|
+
{ key: "progress", label: "Progress", maxWidth: 10, format: (v) => colorProgress(v) },
|
|
5133
|
+
{ key: "current", label: "Current/Target", maxWidth: 15 }
|
|
5134
|
+
];
|
|
5053
5135
|
async function listGoals(config) {
|
|
5054
5136
|
const client = new ClickUpClient(config);
|
|
5055
5137
|
return client.getGoals(config.teamId);
|
|
@@ -5087,11 +5169,13 @@ async function updateKeyResult(config, keyResultId, updates) {
|
|
|
5087
5169
|
}
|
|
5088
5170
|
function formatGoals(goals) {
|
|
5089
5171
|
if (goals.length === 0) return "No goals found";
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5172
|
+
const rows = goals.map((g) => ({
|
|
5173
|
+
name: g.name,
|
|
5174
|
+
id: g.id,
|
|
5175
|
+
progress: `${Math.round(g.percent_completed * 100)}%`,
|
|
5176
|
+
owner: g.owner ? `@${g.owner.username}` : ""
|
|
5177
|
+
}));
|
|
5178
|
+
return formatTable(rows, GOAL_COLUMNS);
|
|
5095
5179
|
}
|
|
5096
5180
|
function formatGoalsMarkdown(goals) {
|
|
5097
5181
|
if (goals.length === 0) return "No goals found";
|
|
@@ -5103,10 +5187,13 @@ function formatGoalsMarkdown(goals) {
|
|
|
5103
5187
|
}
|
|
5104
5188
|
function formatKeyResults(keyResults) {
|
|
5105
5189
|
if (keyResults.length === 0) return "No key results found";
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5190
|
+
const rows = keyResults.map((kr) => ({
|
|
5191
|
+
name: kr.name,
|
|
5192
|
+
id: kr.id,
|
|
5193
|
+
progress: `${Math.round(kr.percent_completed * 100)}%`,
|
|
5194
|
+
current: `${kr.steps_current}/${kr.steps_end}`
|
|
5195
|
+
}));
|
|
5196
|
+
return formatTable(rows, KEY_RESULT_COLUMNS);
|
|
5110
5197
|
}
|
|
5111
5198
|
function formatKeyResultsMarkdown(keyResults) {
|
|
5112
5199
|
if (keyResults.length === 0) return "No key results found";
|
|
@@ -5117,14 +5204,14 @@ function formatKeyResultsMarkdown(keyResults) {
|
|
|
5117
5204
|
}
|
|
5118
5205
|
|
|
5119
5206
|
// src/commands/task-types.ts
|
|
5120
|
-
import
|
|
5207
|
+
import chalk15 from "chalk";
|
|
5121
5208
|
async function listTaskTypes(config) {
|
|
5122
5209
|
const client = new ClickUpClient(config);
|
|
5123
5210
|
return client.getCustomTaskTypes(config.teamId);
|
|
5124
5211
|
}
|
|
5125
5212
|
function formatTaskTypes(types) {
|
|
5126
5213
|
if (types.length === 0) return "No custom task types";
|
|
5127
|
-
return types.map((t) => `${
|
|
5214
|
+
return types.map((t) => `${chalk15.bold(t.name)} ${chalk15.dim(`(${t.id})`)}`).join("\n");
|
|
5128
5215
|
}
|
|
5129
5216
|
function formatTaskTypesMarkdown(types) {
|
|
5130
5217
|
if (types.length === 0) return "No custom task types";
|
|
@@ -5132,14 +5219,14 @@ function formatTaskTypesMarkdown(types) {
|
|
|
5132
5219
|
}
|
|
5133
5220
|
|
|
5134
5221
|
// src/commands/templates.ts
|
|
5135
|
-
import
|
|
5222
|
+
import chalk16 from "chalk";
|
|
5136
5223
|
async function listTemplates(config) {
|
|
5137
5224
|
const client = new ClickUpClient(config);
|
|
5138
5225
|
return client.getTaskTemplates(config.teamId);
|
|
5139
5226
|
}
|
|
5140
5227
|
function formatTemplates(templates) {
|
|
5141
5228
|
if (templates.length === 0) return "No task templates";
|
|
5142
|
-
return templates.map((t) => `${
|
|
5229
|
+
return templates.map((t) => `${chalk16.bold(t.name)} ${chalk16.dim(`(${t.id})`)}`).join("\n");
|
|
5143
5230
|
}
|
|
5144
5231
|
function formatTemplatesMarkdown(templates) {
|
|
5145
5232
|
if (templates.length === 0) return "No task templates";
|
|
@@ -5147,14 +5234,14 @@ function formatTemplatesMarkdown(templates) {
|
|
|
5147
5234
|
}
|
|
5148
5235
|
|
|
5149
5236
|
// src/commands/list-templates.ts
|
|
5150
|
-
import
|
|
5237
|
+
import chalk17 from "chalk";
|
|
5151
5238
|
async function listListTemplates(config) {
|
|
5152
5239
|
const client = new ClickUpClient(config);
|
|
5153
5240
|
return client.getListTemplates(config.teamId);
|
|
5154
5241
|
}
|
|
5155
5242
|
function formatListTemplates(templates) {
|
|
5156
5243
|
if (templates.length === 0) return "No list templates";
|
|
5157
|
-
return templates.map((t) => `${
|
|
5244
|
+
return templates.map((t) => `${chalk17.bold(t.name)} ${chalk17.dim(`(${t.id})`)}`).join("\n");
|
|
5158
5245
|
}
|
|
5159
5246
|
function formatListTemplatesMarkdown(templates) {
|
|
5160
5247
|
if (templates.length === 0) return "No list templates";
|
|
@@ -5162,14 +5249,14 @@ function formatListTemplatesMarkdown(templates) {
|
|
|
5162
5249
|
}
|
|
5163
5250
|
|
|
5164
5251
|
// src/commands/folder-templates.ts
|
|
5165
|
-
import
|
|
5252
|
+
import chalk18 from "chalk";
|
|
5166
5253
|
async function listFolderTemplates(config) {
|
|
5167
5254
|
const client = new ClickUpClient(config);
|
|
5168
5255
|
return client.getFolderTemplates(config.teamId);
|
|
5169
5256
|
}
|
|
5170
5257
|
function formatFolderTemplates(templates) {
|
|
5171
5258
|
if (templates.length === 0) return "No folder templates";
|
|
5172
|
-
return templates.map((t) => `${
|
|
5259
|
+
return templates.map((t) => `${chalk18.bold(t.name)} ${chalk18.dim(`(${t.id})`)}`).join("\n");
|
|
5173
5260
|
}
|
|
5174
5261
|
function formatFolderTemplatesMarkdown(templates) {
|
|
5175
5262
|
if (templates.length === 0) return "No folder templates";
|
|
@@ -5192,7 +5279,7 @@ async function createListFromTemplate(config, name, opts) {
|
|
|
5192
5279
|
}
|
|
5193
5280
|
|
|
5194
5281
|
// src/commands/views.ts
|
|
5195
|
-
import
|
|
5282
|
+
import chalk19 from "chalk";
|
|
5196
5283
|
async function listViews(config, listId) {
|
|
5197
5284
|
const client = new ClickUpClient(config);
|
|
5198
5285
|
const data = await client.getListViews(listId);
|
|
@@ -5200,7 +5287,7 @@ async function listViews(config, listId) {
|
|
|
5200
5287
|
}
|
|
5201
5288
|
function formatViews(views) {
|
|
5202
5289
|
if (views.length === 0) return "No views";
|
|
5203
|
-
return views.map((v) => `${
|
|
5290
|
+
return views.map((v) => `${chalk19.bold(v.name)} ${chalk19.dim(`(${v.id})`)} ${chalk19.dim(v.type)}`).join("\n");
|
|
5204
5291
|
}
|
|
5205
5292
|
function formatViewsMarkdown(views) {
|
|
5206
5293
|
if (views.length === 0) return "No views";
|
|
@@ -5208,20 +5295,20 @@ function formatViewsMarkdown(views) {
|
|
|
5208
5295
|
}
|
|
5209
5296
|
|
|
5210
5297
|
// src/commands/view.ts
|
|
5211
|
-
import
|
|
5298
|
+
import chalk20 from "chalk";
|
|
5212
5299
|
async function getView(config, viewId) {
|
|
5213
5300
|
const client = new ClickUpClient(config);
|
|
5214
5301
|
return client.getView(viewId);
|
|
5215
5302
|
}
|
|
5216
5303
|
function formatView(view) {
|
|
5217
5304
|
const lines = [];
|
|
5218
|
-
lines.push(
|
|
5305
|
+
lines.push(chalk20.bold.underline(view.name));
|
|
5219
5306
|
lines.push("");
|
|
5220
|
-
lines.push(` ${
|
|
5221
|
-
lines.push(` ${
|
|
5222
|
-
if (view.visibility) lines.push(` ${
|
|
5223
|
-
if (view.date_created) lines.push(` ${
|
|
5224
|
-
if (view.protected !== void 0) lines.push(` ${
|
|
5307
|
+
lines.push(` ${chalk20.bold("ID")} ${view.id}`);
|
|
5308
|
+
lines.push(` ${chalk20.bold("Type")} ${view.type}`);
|
|
5309
|
+
if (view.visibility) lines.push(` ${chalk20.bold("Visibility")} ${view.visibility}`);
|
|
5310
|
+
if (view.date_created) lines.push(` ${chalk20.bold("Created")} ${formatDate(view.date_created)}`);
|
|
5311
|
+
if (view.protected !== void 0) lines.push(` ${chalk20.bold("Protected")} ${view.protected}`);
|
|
5225
5312
|
return lines.join("\n");
|
|
5226
5313
|
}
|
|
5227
5314
|
function formatViewMarkdown(view) {
|
|
@@ -5388,7 +5475,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
5388
5475
|
}
|
|
5389
5476
|
})
|
|
5390
5477
|
);
|
|
5391
|
-
program.command("update <taskId>").description("Update a task").option("-n, --name <text>", "New task name").option("-d, --description <text>", "New description (markdown supported)").option("-s, --status <status>", 'New status (e.g. "in progress", "done")').option("--priority <level>", "Priority: urgent, high, normal, low (or 1-4)").option("--due-date <date>", "Due date (YYYY-MM-DD)").option("--time-estimate <duration>", 'Time estimate (e.g. "2h", "30m", "1h30m")').option("--assignee <userId>", 'Add assignee by user ID or "me"').option("--parent <taskId>", "Set parent task (makes this a subtask)").option("--field <nameAndValue...>", 'Set custom field: --field "Name" value').option("--json", "Force JSON output even in terminal").action(
|
|
5478
|
+
program.command("update <taskId>").description("Update a task").option("-n, --name <text>", "New task name").option("-d, --description <text>", "New description (markdown supported)").option("-s, --status <status>", 'New status (e.g. "in progress", "done")').option("--priority <level>", "Priority: urgent, high, normal, low (or 1-4)").option("--due-date <date>", "Due date (YYYY-MM-DD)").option("--time-estimate <duration>", 'Time estimate (e.g. "2h", "30m", "1h30m")').option("--assignee <userId>", 'Add assignee by user ID or "me"').option("--parent <taskId>", "Set parent task (makes this a subtask)").option("--archive", "Archive the task").option("--unarchive", "Unarchive the task").option("--field <nameAndValue...>", 'Set custom field: --field "Name" value').option("--json", "Force JSON output even in terminal").action(
|
|
5392
5479
|
wrapAction(
|
|
5393
5480
|
async (taskId, opts) => {
|
|
5394
5481
|
const config = loadConfig(getProfileName());
|
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ All commands support `--help` for full flag details. All commands support `--jso
|
|
|
72
72
|
| Command | What it does |
|
|
73
73
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------- |
|
|
74
74
|
| `cup 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] [--template id]` | Create task |
|
|
75
|
-
| `cup update <id> [-n name] [-d desc] [-s status] [--priority p] [--due-date d] [--time-estimate t] [--assignee id\|me] [--parent id] [--field "Name" val]`
|
|
75
|
+
| `cup update <id> [-n name] [-d desc] [-s status] [--priority p] [--due-date d] [--time-estimate t] [--assignee id\|me] [--parent id] [--archive] [--unarchive] [--field "Name" val]` | Update task fields (including custom fields) |
|
|
76
76
|
| `cup comment <id> -m text [--notify-all]` | Post comment on task |
|
|
77
77
|
| `cup comment-edit <commentId> -m text [--resolved] [--unresolved]` | Edit a comment |
|
|
78
78
|
| `cup comment-delete <commentId>` | Delete a comment |
|