@krodak/clickup-cli 1.19.0 → 1.19.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.
|
@@ -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.19.
|
|
4
|
+
"version": "1.19.1",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Krzysztof Rodak"
|
|
7
7
|
},
|
|
@@ -227,6 +227,9 @@ var ClickUpClient = class {
|
|
|
227
227
|
async getTask(taskId) {
|
|
228
228
|
return this.request(this.taskPath(taskId, "?include_markdown_description=true"));
|
|
229
229
|
}
|
|
230
|
+
async getTimeInStatus(taskId) {
|
|
231
|
+
return this.request(this.taskPath(taskId, "/time_in_status"));
|
|
232
|
+
}
|
|
230
233
|
async createTask(listId, options) {
|
|
231
234
|
return this.request(`/list/${listId}/task`, {
|
|
232
235
|
method: "POST",
|
|
@@ -1283,6 +1286,18 @@ function formatDuration(ms) {
|
|
|
1283
1286
|
if (hours > 0) return `${hours}h`;
|
|
1284
1287
|
return `${minutes}m`;
|
|
1285
1288
|
}
|
|
1289
|
+
function formatLongDuration(ms) {
|
|
1290
|
+
const totalMinutes = Math.round(Math.abs(ms) / 6e4);
|
|
1291
|
+
if (totalMinutes === 0) return "< 1m";
|
|
1292
|
+
const days = Math.floor(totalMinutes / 1440);
|
|
1293
|
+
const hours = Math.floor(totalMinutes % 1440 / 60);
|
|
1294
|
+
const minutes = totalMinutes % 60;
|
|
1295
|
+
const parts = [];
|
|
1296
|
+
if (days > 0) parts.push(`${days}d`);
|
|
1297
|
+
if (hours > 0) parts.push(`${hours}h`);
|
|
1298
|
+
if (minutes > 0) parts.push(`${minutes}m`);
|
|
1299
|
+
return parts.join(" ");
|
|
1300
|
+
}
|
|
1286
1301
|
function formatDateISO(ms) {
|
|
1287
1302
|
const d = new Date(Number(ms));
|
|
1288
1303
|
const year = d.getUTCFullYear();
|
|
@@ -1990,10 +2005,12 @@ export {
|
|
|
1990
2005
|
formatDate,
|
|
1991
2006
|
formatTimestamp,
|
|
1992
2007
|
formatDuration,
|
|
2008
|
+
formatLongDuration,
|
|
1993
2009
|
formatDateISO,
|
|
1994
2010
|
isTTY,
|
|
1995
2011
|
shouldOutputJson,
|
|
1996
2012
|
formatTable,
|
|
2013
|
+
colorStatus,
|
|
1997
2014
|
TASK_COLUMNS,
|
|
1998
2015
|
formatMarkdownTable,
|
|
1999
2016
|
formatCommentsMarkdown,
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
TASK_COLUMNS,
|
|
6
6
|
addProfile,
|
|
7
7
|
buildTypeMap,
|
|
8
|
+
colorStatus,
|
|
8
9
|
deleteFavorite,
|
|
9
10
|
deleteFilter,
|
|
10
11
|
fetchMyTasks,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
formatDuration,
|
|
19
20
|
formatGroupedTasksMarkdown,
|
|
20
21
|
formatListsMarkdown,
|
|
22
|
+
formatLongDuration,
|
|
21
23
|
formatMarkdownTable,
|
|
22
24
|
formatSpacesMarkdown,
|
|
23
25
|
formatTable,
|
|
@@ -47,7 +49,7 @@ import {
|
|
|
47
49
|
showDetailsAndOpen,
|
|
48
50
|
summarize,
|
|
49
51
|
writeConfig
|
|
50
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-3VDSLYDJ.js";
|
|
51
53
|
|
|
52
54
|
// src/index.ts
|
|
53
55
|
import { realpathSync as realpathSync2 } from "fs";
|
|
@@ -1022,6 +1024,83 @@ ${commentsMd}`);
|
|
|
1022
1024
|
}
|
|
1023
1025
|
}
|
|
1024
1026
|
|
|
1027
|
+
// src/commands/time-in-status.ts
|
|
1028
|
+
import chalk5 from "chalk";
|
|
1029
|
+
function transformResponse(taskId, data) {
|
|
1030
|
+
const entries = [];
|
|
1031
|
+
for (const entry of data.status_history ?? []) {
|
|
1032
|
+
const ms = (entry.total_time?.by_minute ?? 0) * 6e4;
|
|
1033
|
+
entries.push({
|
|
1034
|
+
status: entry.status,
|
|
1035
|
+
duration: formatLongDuration(ms),
|
|
1036
|
+
durationMs: ms,
|
|
1037
|
+
current: false
|
|
1038
|
+
});
|
|
1039
|
+
}
|
|
1040
|
+
if (data.current_status) {
|
|
1041
|
+
const ms = (data.current_status.total_time?.by_minute ?? 0) * 6e4;
|
|
1042
|
+
const existing = entries.find((e) => e.status === data.current_status.status);
|
|
1043
|
+
if (existing) {
|
|
1044
|
+
existing.current = true;
|
|
1045
|
+
} else {
|
|
1046
|
+
entries.push({
|
|
1047
|
+
status: data.current_status.status,
|
|
1048
|
+
duration: formatLongDuration(ms),
|
|
1049
|
+
durationMs: ms,
|
|
1050
|
+
current: true
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
const totalMs = entries.reduce((sum, e) => sum + e.durationMs, 0);
|
|
1055
|
+
return { taskId, statuses: entries, totalMs, total: formatLongDuration(totalMs) };
|
|
1056
|
+
}
|
|
1057
|
+
async function fetchTimeInStatus(config, taskId) {
|
|
1058
|
+
const client = new ClickUpClient(config);
|
|
1059
|
+
let data;
|
|
1060
|
+
try {
|
|
1061
|
+
data = await client.getTimeInStatus(taskId);
|
|
1062
|
+
} catch (err) {
|
|
1063
|
+
if (err instanceof Error && /No data for TIS/i.test(err.message)) {
|
|
1064
|
+
throw new Error(
|
|
1065
|
+
'The "Time in Status" ClickApp is not enabled for this workspace.\nEnable it in ClickUp: Space Settings \u2192 ClickApps \u2192 Time in Status'
|
|
1066
|
+
);
|
|
1067
|
+
}
|
|
1068
|
+
throw err;
|
|
1069
|
+
}
|
|
1070
|
+
return transformResponse(taskId, data);
|
|
1071
|
+
}
|
|
1072
|
+
function printTimeInStatus(result, forceJson) {
|
|
1073
|
+
if (shouldOutputJson(forceJson)) {
|
|
1074
|
+
console.log(JSON.stringify(result, null, 2));
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
const rows = result.statuses.map((s) => ({
|
|
1078
|
+
status: s.status,
|
|
1079
|
+
duration: s.duration,
|
|
1080
|
+
current: s.current ? "*" : ""
|
|
1081
|
+
}));
|
|
1082
|
+
if (!isTTY()) {
|
|
1083
|
+
const mdColumns = [
|
|
1084
|
+
{ key: "status", label: "Status" },
|
|
1085
|
+
{ key: "duration", label: "Duration" },
|
|
1086
|
+
{ key: "current", label: "Current" }
|
|
1087
|
+
];
|
|
1088
|
+
const table = formatMarkdownTable(rows, mdColumns);
|
|
1089
|
+
console.log(`${table}
|
|
1090
|
+
|
|
1091
|
+
**Total:** ${result.total}`);
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
const columns = [
|
|
1095
|
+
{ key: "status", label: "STATUS", maxWidth: 25, format: (v) => colorStatus(v) },
|
|
1096
|
+
{ key: "duration", label: "DURATION" },
|
|
1097
|
+
{ key: "current", label: "", format: (v) => v ? chalk5.green("\u25C0") : "" }
|
|
1098
|
+
];
|
|
1099
|
+
console.log(formatTable(rows, columns));
|
|
1100
|
+
console.log("");
|
|
1101
|
+
console.log(`${chalk5.bold("Total:")} ${result.total}`);
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1025
1104
|
// src/commands/metadata.ts
|
|
1026
1105
|
var commandMetadata = [
|
|
1027
1106
|
{
|
|
@@ -1455,6 +1534,18 @@ var commandMetadata = [
|
|
|
1455
1534
|
{ section: "write", usage: "time delete <timeEntryId>", description: "Delete a time entry" }
|
|
1456
1535
|
]
|
|
1457
1536
|
},
|
|
1537
|
+
{
|
|
1538
|
+
name: "time-in-status",
|
|
1539
|
+
description: "Show how long a task has been in each status",
|
|
1540
|
+
flags: ["--json"],
|
|
1541
|
+
quickReference: [
|
|
1542
|
+
{
|
|
1543
|
+
section: "read",
|
|
1544
|
+
usage: "time-in-status <taskId>",
|
|
1545
|
+
description: "Show how long a task has been in each status"
|
|
1546
|
+
}
|
|
1547
|
+
]
|
|
1548
|
+
},
|
|
1458
1549
|
{
|
|
1459
1550
|
name: "docs",
|
|
1460
1551
|
description: "List workspace docs (optionally filter by name)",
|
|
@@ -2924,7 +3015,7 @@ function generateCompletion(shell, name = "cup") {
|
|
|
2924
3015
|
import { readFileSync, realpathSync, mkdirSync, copyFileSync, existsSync } from "fs";
|
|
2925
3016
|
import { join, dirname } from "path";
|
|
2926
3017
|
import { homedir } from "os";
|
|
2927
|
-
import
|
|
3018
|
+
import chalk6 from "chalk";
|
|
2928
3019
|
function skillPath() {
|
|
2929
3020
|
if (!process.argv[1]) {
|
|
2930
3021
|
throw new Error("Cannot determine install path. Run with: cup skill");
|
|
@@ -2962,7 +3053,7 @@ async function installSkillInteractive() {
|
|
|
2962
3053
|
const selected = await checkbox({
|
|
2963
3054
|
message: "Install skill for which agents?",
|
|
2964
3055
|
choices: targets.map((t) => ({
|
|
2965
|
-
name: `${t.name}${t.detected ?
|
|
3056
|
+
name: `${t.name}${t.detected ? chalk6.dim(" (detected)") : ""}`,
|
|
2966
3057
|
value: t.name,
|
|
2967
3058
|
checked: t.detected
|
|
2968
3059
|
}))
|
|
@@ -3280,7 +3371,7 @@ async function manageTags(config, taskId, opts) {
|
|
|
3280
3371
|
}
|
|
3281
3372
|
|
|
3282
3373
|
// src/commands/checklist.ts
|
|
3283
|
-
import
|
|
3374
|
+
import chalk7 from "chalk";
|
|
3284
3375
|
async function viewChecklists(config, taskId) {
|
|
3285
3376
|
const client = new ClickUpClient(config);
|
|
3286
3377
|
const task = await client.getTask(taskId);
|
|
@@ -3313,14 +3404,14 @@ function formatChecklists(checklists) {
|
|
|
3313
3404
|
const lines = [];
|
|
3314
3405
|
for (const cl of checklists) {
|
|
3315
3406
|
const resolved = cl.items.filter((i) => i.resolved).length;
|
|
3316
|
-
lines.push(
|
|
3317
|
-
lines.push(
|
|
3407
|
+
lines.push(chalk7.bold(`${cl.name} (${resolved}/${cl.items.length})`));
|
|
3408
|
+
lines.push(chalk7.dim(` ID: ${cl.id}`));
|
|
3318
3409
|
for (const item of cl.items) {
|
|
3319
|
-
const check = item.resolved ?
|
|
3320
|
-
const name = item.resolved ?
|
|
3321
|
-
const assignee = item.assignee ?
|
|
3410
|
+
const check = item.resolved ? chalk7.green("[x]") : chalk7.dim("[ ]");
|
|
3411
|
+
const name = item.resolved ? chalk7.dim(item.name) : item.name;
|
|
3412
|
+
const assignee = item.assignee ? chalk7.dim(` @${item.assignee.username}`) : "";
|
|
3322
3413
|
lines.push(` ${check} ${name}${assignee}`);
|
|
3323
|
-
lines.push(
|
|
3414
|
+
lines.push(chalk7.dim(` item-id: ${item.id}`));
|
|
3324
3415
|
}
|
|
3325
3416
|
}
|
|
3326
3417
|
return lines.join("\n");
|
|
@@ -3379,7 +3470,7 @@ async function deleteCommentByTaskSelection(config, taskId, options) {
|
|
|
3379
3470
|
}
|
|
3380
3471
|
|
|
3381
3472
|
// src/commands/replies.ts
|
|
3382
|
-
import
|
|
3473
|
+
import chalk8 from "chalk";
|
|
3383
3474
|
async function getReplies(config, commentId) {
|
|
3384
3475
|
const client = new ClickUpClient(config);
|
|
3385
3476
|
return client.getThreadedComments(commentId);
|
|
@@ -3394,7 +3485,7 @@ function formatReplies(replies) {
|
|
|
3394
3485
|
return replies.map((r) => {
|
|
3395
3486
|
const user = r.user?.username ?? "Unknown";
|
|
3396
3487
|
const date = formatTimestamp(Number(r.date));
|
|
3397
|
-
return `${
|
|
3488
|
+
return `${chalk8.bold(user)} ${chalk8.dim(date)}
|
|
3398
3489
|
${r.comment_text}`;
|
|
3399
3490
|
}).join("\n\n");
|
|
3400
3491
|
}
|
|
@@ -3457,7 +3548,7 @@ function formatDocsMarkdown(docs) {
|
|
|
3457
3548
|
}
|
|
3458
3549
|
|
|
3459
3550
|
// src/commands/doc.ts
|
|
3460
|
-
import
|
|
3551
|
+
import chalk9 from "chalk";
|
|
3461
3552
|
async function getDocInfo(config, docId) {
|
|
3462
3553
|
const client = new ClickUpClient(config);
|
|
3463
3554
|
const [doc, pages] = await Promise.all([
|
|
@@ -3469,14 +3560,14 @@ async function getDocInfo(config, docId) {
|
|
|
3469
3560
|
function formatDocInfo(doc, pages, indent = 0) {
|
|
3470
3561
|
const lines = [];
|
|
3471
3562
|
if (indent === 0) {
|
|
3472
|
-
lines.push(`${
|
|
3563
|
+
lines.push(`${chalk9.bold(doc.name)} ${chalk9.dim(doc.id)}`);
|
|
3473
3564
|
if (pages.length === 0) {
|
|
3474
3565
|
lines.push(" (no pages)");
|
|
3475
3566
|
}
|
|
3476
3567
|
}
|
|
3477
3568
|
for (const page of pages) {
|
|
3478
3569
|
const prefix = " ".repeat(indent + 1);
|
|
3479
|
-
lines.push(`${prefix}${page.name} ${
|
|
3570
|
+
lines.push(`${prefix}${page.name} ${chalk9.dim(page.id)}`);
|
|
3480
3571
|
if (page.pages && page.pages.length > 0) {
|
|
3481
3572
|
lines.push(formatDocInfo(doc, page.pages, indent + 1));
|
|
3482
3573
|
}
|
|
@@ -3555,7 +3646,7 @@ async function deleteDocPage(config, docId, pageId) {
|
|
|
3555
3646
|
}
|
|
3556
3647
|
|
|
3557
3648
|
// src/commands/folders.ts
|
|
3558
|
-
import
|
|
3649
|
+
import chalk10 from "chalk";
|
|
3559
3650
|
async function listFolders(config, spaceId, nameFilter) {
|
|
3560
3651
|
const client = new ClickUpClient(config);
|
|
3561
3652
|
const folders = await client.getFolders(spaceId);
|
|
@@ -3574,9 +3665,9 @@ async function listFolders(config, spaceId, nameFilter) {
|
|
|
3574
3665
|
function formatFolders(folders) {
|
|
3575
3666
|
if (folders.length === 0) return "No folders found";
|
|
3576
3667
|
return folders.map((f) => {
|
|
3577
|
-
const header = `${
|
|
3668
|
+
const header = `${chalk10.bold(f.name)} ${chalk10.dim(f.id)}`;
|
|
3578
3669
|
if (f.lists.length === 0) return header;
|
|
3579
|
-
const listLines = f.lists.map((l) => ` ${
|
|
3670
|
+
const listLines = f.lists.map((l) => ` ${chalk10.dim(">")} ${l.name} ${chalk10.dim(l.id)}`);
|
|
3580
3671
|
return [header, ...listLines].join("\n");
|
|
3581
3672
|
}).join("\n\n");
|
|
3582
3673
|
}
|
|
@@ -3591,13 +3682,13 @@ function formatFoldersMarkdown(folders) {
|
|
|
3591
3682
|
}
|
|
3592
3683
|
|
|
3593
3684
|
// src/commands/time.ts
|
|
3594
|
-
import
|
|
3685
|
+
import chalk11 from "chalk";
|
|
3595
3686
|
var TIME_COLUMNS = [
|
|
3596
3687
|
{ key: "task", label: "Task", maxWidth: 35 },
|
|
3597
3688
|
{ key: "duration", label: "Duration", maxWidth: 10 },
|
|
3598
3689
|
{ key: "date", label: "Date", maxWidth: 20 },
|
|
3599
3690
|
{ key: "description", label: "Description", maxWidth: 30 },
|
|
3600
|
-
{ key: "status", label: "", maxWidth: 10, format: (v) => v === "RUNNING" ?
|
|
3691
|
+
{ key: "status", label: "", maxWidth: 10, format: (v) => v === "RUNNING" ? chalk11.green(v) : "" }
|
|
3601
3692
|
];
|
|
3602
3693
|
async function startTimer(config, taskId, description) {
|
|
3603
3694
|
const client = new ClickUpClient(config);
|
|
@@ -3693,7 +3784,7 @@ function formatTimeEntriesMarkdown(entries) {
|
|
|
3693
3784
|
}
|
|
3694
3785
|
|
|
3695
3786
|
// src/commands/tags.ts
|
|
3696
|
-
import
|
|
3787
|
+
import chalk12 from "chalk";
|
|
3697
3788
|
var TAG_COLUMNS = [
|
|
3698
3789
|
{ key: "name", label: "Name", maxWidth: 40 },
|
|
3699
3790
|
{ key: "fg", label: "FG", maxWidth: 10 },
|
|
@@ -3726,13 +3817,13 @@ function formatTags(tags) {
|
|
|
3726
3817
|
if (tags.length === 0) return "No tags found";
|
|
3727
3818
|
if (isTTY()) {
|
|
3728
3819
|
const rows = tags.map((t) => ({
|
|
3729
|
-
name: t.tag_bg ?
|
|
3820
|
+
name: t.tag_bg ? chalk12.bgHex(t.tag_bg).hex(t.tag_fg || "#ffffff")(` ${t.name} `) : chalk12.bold(t.name),
|
|
3730
3821
|
fg: t.tag_fg || "",
|
|
3731
3822
|
bg: t.tag_bg || ""
|
|
3732
3823
|
}));
|
|
3733
3824
|
return formatTable(rows, TAG_COLUMNS);
|
|
3734
3825
|
}
|
|
3735
|
-
return tags.map((t) =>
|
|
3826
|
+
return tags.map((t) => chalk12.bold(t.name)).join(", ");
|
|
3736
3827
|
}
|
|
3737
3828
|
function formatTagsMarkdown(tags) {
|
|
3738
3829
|
if (tags.length === 0) return "No tags found";
|
|
@@ -3767,7 +3858,7 @@ function formatMembersMarkdown(members) {
|
|
|
3767
3858
|
}
|
|
3768
3859
|
|
|
3769
3860
|
// src/commands/fields.ts
|
|
3770
|
-
import
|
|
3861
|
+
import chalk13 from "chalk";
|
|
3771
3862
|
var FIELD_COLUMNS = [
|
|
3772
3863
|
{ key: "id", label: "ID", maxWidth: 20 },
|
|
3773
3864
|
{ key: "name", label: "Name", maxWidth: 30 },
|
|
@@ -3776,7 +3867,7 @@ var FIELD_COLUMNS = [
|
|
|
3776
3867
|
key: "required",
|
|
3777
3868
|
label: "Required",
|
|
3778
3869
|
maxWidth: 10,
|
|
3779
|
-
format: (v) => v === "yes" ?
|
|
3870
|
+
format: (v) => v === "yes" ? chalk13.yellow(v) : chalk13.dim(v)
|
|
3780
3871
|
},
|
|
3781
3872
|
{ key: "options", label: "Options", maxWidth: 40 }
|
|
3782
3873
|
];
|
|
@@ -3883,13 +3974,13 @@ async function bulkTag(config, tagName, taskIds, action) {
|
|
|
3883
3974
|
}
|
|
3884
3975
|
|
|
3885
3976
|
// src/commands/goals.ts
|
|
3886
|
-
import
|
|
3977
|
+
import chalk14 from "chalk";
|
|
3887
3978
|
function colorProgress(value) {
|
|
3888
3979
|
const num = parseInt(value, 10);
|
|
3889
3980
|
if (isNaN(num)) return value;
|
|
3890
|
-
if (num >= 75) return
|
|
3891
|
-
if (num >= 25) return
|
|
3892
|
-
return
|
|
3981
|
+
if (num >= 75) return chalk14.green(value);
|
|
3982
|
+
if (num >= 25) return chalk14.yellow(value);
|
|
3983
|
+
return chalk14.red(value);
|
|
3893
3984
|
}
|
|
3894
3985
|
var GOAL_COLUMNS = [
|
|
3895
3986
|
{ key: "id", label: "ID", maxWidth: 15 },
|
|
@@ -3983,14 +4074,14 @@ function formatKeyResultsMarkdown(keyResults) {
|
|
|
3983
4074
|
}
|
|
3984
4075
|
|
|
3985
4076
|
// src/commands/task-types.ts
|
|
3986
|
-
import
|
|
4077
|
+
import chalk15 from "chalk";
|
|
3987
4078
|
async function listTaskTypes(config) {
|
|
3988
4079
|
const client = new ClickUpClient(config);
|
|
3989
4080
|
return client.getCustomTaskTypes(config.teamId);
|
|
3990
4081
|
}
|
|
3991
4082
|
function formatTaskTypes(types) {
|
|
3992
4083
|
if (types.length === 0) return "No custom task types";
|
|
3993
|
-
return types.map((t) => `${
|
|
4084
|
+
return types.map((t) => `${chalk15.bold(t.name)} ${chalk15.dim(`(${t.id})`)}`).join("\n");
|
|
3994
4085
|
}
|
|
3995
4086
|
function formatTaskTypesMarkdown(types) {
|
|
3996
4087
|
if (types.length === 0) return "No custom task types";
|
|
@@ -3998,14 +4089,14 @@ function formatTaskTypesMarkdown(types) {
|
|
|
3998
4089
|
}
|
|
3999
4090
|
|
|
4000
4091
|
// src/commands/templates.ts
|
|
4001
|
-
import
|
|
4092
|
+
import chalk16 from "chalk";
|
|
4002
4093
|
async function listTemplates(config) {
|
|
4003
4094
|
const client = new ClickUpClient(config);
|
|
4004
4095
|
return client.getTaskTemplates(config.teamId);
|
|
4005
4096
|
}
|
|
4006
4097
|
function formatTemplates(templates) {
|
|
4007
4098
|
if (templates.length === 0) return "No task templates";
|
|
4008
|
-
return templates.map((t) => `${
|
|
4099
|
+
return templates.map((t) => `${chalk16.bold(t.name)} ${chalk16.dim(`(${t.id})`)}`).join("\n");
|
|
4009
4100
|
}
|
|
4010
4101
|
function formatTemplatesMarkdown(templates) {
|
|
4011
4102
|
if (templates.length === 0) return "No task templates";
|
|
@@ -4013,14 +4104,14 @@ function formatTemplatesMarkdown(templates) {
|
|
|
4013
4104
|
}
|
|
4014
4105
|
|
|
4015
4106
|
// src/commands/list-templates.ts
|
|
4016
|
-
import
|
|
4107
|
+
import chalk17 from "chalk";
|
|
4017
4108
|
async function listListTemplates(config) {
|
|
4018
4109
|
const client = new ClickUpClient(config);
|
|
4019
4110
|
return client.getListTemplates(config.teamId);
|
|
4020
4111
|
}
|
|
4021
4112
|
function formatListTemplates(templates) {
|
|
4022
4113
|
if (templates.length === 0) return "No list templates";
|
|
4023
|
-
return templates.map((t) => `${
|
|
4114
|
+
return templates.map((t) => `${chalk17.bold(t.name)} ${chalk17.dim(`(${t.id})`)}`).join("\n");
|
|
4024
4115
|
}
|
|
4025
4116
|
function formatListTemplatesMarkdown(templates) {
|
|
4026
4117
|
if (templates.length === 0) return "No list templates";
|
|
@@ -4028,14 +4119,14 @@ function formatListTemplatesMarkdown(templates) {
|
|
|
4028
4119
|
}
|
|
4029
4120
|
|
|
4030
4121
|
// src/commands/folder-templates.ts
|
|
4031
|
-
import
|
|
4122
|
+
import chalk18 from "chalk";
|
|
4032
4123
|
async function listFolderTemplates(config) {
|
|
4033
4124
|
const client = new ClickUpClient(config);
|
|
4034
4125
|
return client.getFolderTemplates(config.teamId);
|
|
4035
4126
|
}
|
|
4036
4127
|
function formatFolderTemplates(templates) {
|
|
4037
4128
|
if (templates.length === 0) return "No folder templates";
|
|
4038
|
-
return templates.map((t) => `${
|
|
4129
|
+
return templates.map((t) => `${chalk18.bold(t.name)} ${chalk18.dim(`(${t.id})`)}`).join("\n");
|
|
4039
4130
|
}
|
|
4040
4131
|
function formatFolderTemplatesMarkdown(templates) {
|
|
4041
4132
|
if (templates.length === 0) return "No folder templates";
|
|
@@ -4058,7 +4149,7 @@ async function createListFromTemplate(config, name, opts) {
|
|
|
4058
4149
|
}
|
|
4059
4150
|
|
|
4060
4151
|
// src/commands/views.ts
|
|
4061
|
-
import
|
|
4152
|
+
import chalk19 from "chalk";
|
|
4062
4153
|
async function listViews(config, id, container = "list") {
|
|
4063
4154
|
const client = new ClickUpClient(config);
|
|
4064
4155
|
if (container === "space") return client.getSpaceViews(id);
|
|
@@ -4069,7 +4160,7 @@ async function listViews(config, id, container = "list") {
|
|
|
4069
4160
|
}
|
|
4070
4161
|
function formatViews(views) {
|
|
4071
4162
|
if (views.length === 0) return "No views";
|
|
4072
|
-
return views.map((v) => `${
|
|
4163
|
+
return views.map((v) => `${chalk19.bold(v.name)} ${chalk19.dim(`(${v.id})`)} ${chalk19.dim(v.type)}`).join("\n");
|
|
4073
4164
|
}
|
|
4074
4165
|
function formatViewsMarkdown(views) {
|
|
4075
4166
|
if (views.length === 0) return "No views";
|
|
@@ -4077,20 +4168,20 @@ function formatViewsMarkdown(views) {
|
|
|
4077
4168
|
}
|
|
4078
4169
|
|
|
4079
4170
|
// src/commands/view.ts
|
|
4080
|
-
import
|
|
4171
|
+
import chalk20 from "chalk";
|
|
4081
4172
|
async function getView(config, viewId) {
|
|
4082
4173
|
const client = new ClickUpClient(config);
|
|
4083
4174
|
return client.getView(viewId);
|
|
4084
4175
|
}
|
|
4085
4176
|
function formatView(view) {
|
|
4086
4177
|
const lines = [];
|
|
4087
|
-
lines.push(
|
|
4178
|
+
lines.push(chalk20.bold.underline(view.name));
|
|
4088
4179
|
lines.push("");
|
|
4089
|
-
lines.push(` ${
|
|
4090
|
-
lines.push(` ${
|
|
4091
|
-
if (view.visibility) lines.push(` ${
|
|
4092
|
-
if (view.date_created) lines.push(` ${
|
|
4093
|
-
if (view.protected !== void 0) lines.push(` ${
|
|
4180
|
+
lines.push(` ${chalk20.bold("ID")} ${view.id}`);
|
|
4181
|
+
lines.push(` ${chalk20.bold("Type")} ${view.type}`);
|
|
4182
|
+
if (view.visibility) lines.push(` ${chalk20.bold("Visibility")} ${view.visibility}`);
|
|
4183
|
+
if (view.date_created) lines.push(` ${chalk20.bold("Created")} ${formatDate(view.date_created)}`);
|
|
4184
|
+
if (view.protected !== void 0) lines.push(` ${chalk20.bold("Protected")} ${view.protected}`);
|
|
4094
4185
|
return lines.join("\n");
|
|
4095
4186
|
}
|
|
4096
4187
|
function formatViewMarkdown(view) {
|
|
@@ -4528,7 +4619,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4528
4619
|
wrapAction(async (opts) => {
|
|
4529
4620
|
const config = loadConfig(getProfileName());
|
|
4530
4621
|
if (opts.list === "sprint:current") {
|
|
4531
|
-
const { resolveActiveSprintListId } = await import("./sprint-
|
|
4622
|
+
const { resolveActiveSprintListId } = await import("./sprint-5VYRQK6Z.js");
|
|
4532
4623
|
opts.list = await resolveActiveSprintListId(config);
|
|
4533
4624
|
}
|
|
4534
4625
|
if (opts.assignee === "me") {
|
|
@@ -4661,6 +4752,13 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4661
4752
|
printActivity(result, opts.json ?? false);
|
|
4662
4753
|
})
|
|
4663
4754
|
);
|
|
4755
|
+
program.command("time-in-status <taskId>").description("Show how long a task has been in each status").option("--json", "Force JSON output even in terminal").action(
|
|
4756
|
+
wrapAction(async (taskId, opts) => {
|
|
4757
|
+
const config = loadConfig(getProfileName());
|
|
4758
|
+
const result = await fetchTimeInStatus(config, taskId);
|
|
4759
|
+
printTimeInStatus(result, opts.json ?? false);
|
|
4760
|
+
})
|
|
4761
|
+
);
|
|
4664
4762
|
program.command("lists <spaceId>").description("List all lists in a space (including lists inside folders)").option("--name <partial>", "Filter by name (case-insensitive contains)").option("--json", "Force JSON output even in terminal").action(
|
|
4665
4763
|
wrapAction(async (spaceId, opts) => {
|
|
4666
4764
|
const config = loadConfig(getProfileName());
|
|
@@ -4842,7 +4940,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
4842
4940
|
wrapAction(async (taskId, opts) => {
|
|
4843
4941
|
const config = loadConfig(getProfileName());
|
|
4844
4942
|
if (opts.to === "sprint:current") {
|
|
4845
|
-
const { resolveActiveSprintListId } = await import("./sprint-
|
|
4943
|
+
const { resolveActiveSprintListId } = await import("./sprint-5VYRQK6Z.js");
|
|
4846
4944
|
opts.to = await resolveActiveSprintListId(config);
|
|
4847
4945
|
}
|
|
4848
4946
|
const message = await moveTask(config, taskId, opts);
|