@krodak/clickup-cli 1.13.0 → 1.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/.claude-plugin/plugin.json +1 -1
- package/dist/index.js +140 -63
- package/package.json +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.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Krzysztof Rodak"
|
|
7
7
|
},
|
package/dist/index.js
CHANGED
|
@@ -2491,6 +2491,7 @@ async function openTask(config, query, opts = {}) {
|
|
|
2491
2491
|
}
|
|
2492
2492
|
|
|
2493
2493
|
// src/commands/summary.ts
|
|
2494
|
+
import chalk5 from "chalk";
|
|
2494
2495
|
var IN_PROGRESS_PATTERNS = ["in progress", "in review", "code review", "doing"];
|
|
2495
2496
|
function isCompletedRecently(task, cutoff) {
|
|
2496
2497
|
if (!isDoneStatus(task.status.status)) return false;
|
|
@@ -2526,9 +2527,16 @@ function categorizeTasks(tasks, hoursBack, typeMap) {
|
|
|
2526
2527
|
}
|
|
2527
2528
|
return { completed, inProgress, overdue };
|
|
2528
2529
|
}
|
|
2530
|
+
function colorSectionLabel(label) {
|
|
2531
|
+
const lower = label.toLowerCase();
|
|
2532
|
+
if (lower.includes("completed")) return chalk5.green(label);
|
|
2533
|
+
if (lower.includes("progress")) return chalk5.yellow(label);
|
|
2534
|
+
if (lower.includes("overdue")) return chalk5.red(label);
|
|
2535
|
+
return label;
|
|
2536
|
+
}
|
|
2529
2537
|
function printSection(label, tasks) {
|
|
2530
2538
|
console.log(`
|
|
2531
|
-
${label} (${tasks.length})`);
|
|
2539
|
+
${colorSectionLabel(label)} (${tasks.length})`);
|
|
2532
2540
|
if (tasks.length === 0) {
|
|
2533
2541
|
console.log(" None");
|
|
2534
2542
|
} else {
|
|
@@ -2648,7 +2656,7 @@ async function assignTask(config, taskId, opts) {
|
|
|
2648
2656
|
}
|
|
2649
2657
|
|
|
2650
2658
|
// src/commands/activity.ts
|
|
2651
|
-
import
|
|
2659
|
+
import chalk6 from "chalk";
|
|
2652
2660
|
async function fetchActivity(config, taskId) {
|
|
2653
2661
|
const client = new ClickUpClient(config);
|
|
2654
2662
|
const [task, rawComments] = await Promise.all([
|
|
@@ -2680,8 +2688,8 @@ ${commentsMd}`);
|
|
|
2680
2688
|
}
|
|
2681
2689
|
console.log(formatTaskDetail(result.task));
|
|
2682
2690
|
console.log("");
|
|
2683
|
-
console.log(
|
|
2684
|
-
console.log(
|
|
2691
|
+
console.log(chalk6.bold("Comments"));
|
|
2692
|
+
console.log(chalk6.dim("-".repeat(60)));
|
|
2685
2693
|
if (result.comments.length === 0) {
|
|
2686
2694
|
console.log("No comments.");
|
|
2687
2695
|
return;
|
|
@@ -2690,9 +2698,9 @@ ${commentsMd}`);
|
|
|
2690
2698
|
const c = result.comments[i];
|
|
2691
2699
|
if (i > 0) {
|
|
2692
2700
|
console.log("");
|
|
2693
|
-
console.log(
|
|
2701
|
+
console.log(chalk6.dim("-".repeat(60)));
|
|
2694
2702
|
}
|
|
2695
|
-
console.log(`${
|
|
2703
|
+
console.log(`${chalk6.bold(c.user)} ${chalk6.dim(formatTimestamp(c.date))}`);
|
|
2696
2704
|
console.log(c.text);
|
|
2697
2705
|
}
|
|
2698
2706
|
}
|
|
@@ -4595,7 +4603,7 @@ async function manageTags(config, taskId, opts) {
|
|
|
4595
4603
|
}
|
|
4596
4604
|
|
|
4597
4605
|
// src/commands/checklist.ts
|
|
4598
|
-
import
|
|
4606
|
+
import chalk7 from "chalk";
|
|
4599
4607
|
async function viewChecklists(config, taskId) {
|
|
4600
4608
|
const client = new ClickUpClient(config);
|
|
4601
4609
|
const task = await client.getTask(taskId);
|
|
@@ -4628,13 +4636,14 @@ function formatChecklists(checklists) {
|
|
|
4628
4636
|
const lines = [];
|
|
4629
4637
|
for (const cl of checklists) {
|
|
4630
4638
|
const resolved = cl.items.filter((i) => i.resolved).length;
|
|
4631
|
-
lines.push(
|
|
4632
|
-
lines.push(
|
|
4639
|
+
lines.push(chalk7.bold(`${cl.name} (${resolved}/${cl.items.length})`));
|
|
4640
|
+
lines.push(chalk7.dim(` ID: ${cl.id}`));
|
|
4633
4641
|
for (const item of cl.items) {
|
|
4634
|
-
const check = item.resolved ?
|
|
4635
|
-
const
|
|
4636
|
-
|
|
4637
|
-
lines.push(
|
|
4642
|
+
const check = item.resolved ? chalk7.green("[x]") : chalk7.dim("[ ]");
|
|
4643
|
+
const name = item.resolved ? chalk7.dim(item.name) : item.name;
|
|
4644
|
+
const assignee = item.assignee ? chalk7.dim(` @${item.assignee.username}`) : "";
|
|
4645
|
+
lines.push(` ${check} ${name}${assignee}`);
|
|
4646
|
+
lines.push(chalk7.dim(` item-id: ${item.id}`));
|
|
4638
4647
|
}
|
|
4639
4648
|
}
|
|
4640
4649
|
return lines.join("\n");
|
|
@@ -4665,7 +4674,7 @@ async function deleteComment(config, commentId) {
|
|
|
4665
4674
|
}
|
|
4666
4675
|
|
|
4667
4676
|
// src/commands/replies.ts
|
|
4668
|
-
import
|
|
4677
|
+
import chalk8 from "chalk";
|
|
4669
4678
|
async function getReplies(config, commentId) {
|
|
4670
4679
|
const client = new ClickUpClient(config);
|
|
4671
4680
|
return client.getThreadedComments(commentId);
|
|
@@ -4680,7 +4689,7 @@ function formatReplies(replies) {
|
|
|
4680
4689
|
return replies.map((r) => {
|
|
4681
4690
|
const user = r.user?.username ?? "Unknown";
|
|
4682
4691
|
const date = formatTimestamp(Number(r.date));
|
|
4683
|
-
return `${
|
|
4692
|
+
return `${chalk8.bold(user)} ${chalk8.dim(date)}
|
|
4684
4693
|
${r.comment_text}`;
|
|
4685
4694
|
}).join("\n\n");
|
|
4686
4695
|
}
|
|
@@ -4719,7 +4728,10 @@ async function attachFile(config, taskId, filePath) {
|
|
|
4719
4728
|
}
|
|
4720
4729
|
|
|
4721
4730
|
// src/commands/docs.ts
|
|
4722
|
-
|
|
4731
|
+
var DOC_COLUMNS = [
|
|
4732
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
4733
|
+
{ key: "name", label: "Name", maxWidth: 60 }
|
|
4734
|
+
];
|
|
4723
4735
|
async function listDocs(config, query) {
|
|
4724
4736
|
const client = new ClickUpClient(config);
|
|
4725
4737
|
const docs = await client.getDocs(config.teamId);
|
|
@@ -4731,7 +4743,8 @@ async function listDocs(config, query) {
|
|
|
4731
4743
|
}
|
|
4732
4744
|
function formatDocs(docs) {
|
|
4733
4745
|
if (docs.length === 0) return "No docs found";
|
|
4734
|
-
|
|
4746
|
+
const rows = docs.map((d) => ({ name: d.name, id: d.id }));
|
|
4747
|
+
return formatTable(rows, DOC_COLUMNS);
|
|
4735
4748
|
}
|
|
4736
4749
|
function formatDocsMarkdown(docs) {
|
|
4737
4750
|
if (docs.length === 0) return "No docs found";
|
|
@@ -4858,7 +4871,7 @@ function formatFolders(folders) {
|
|
|
4858
4871
|
return folders.map((f) => {
|
|
4859
4872
|
const header = `${chalk10.bold(f.name)} ${chalk10.dim(f.id)}`;
|
|
4860
4873
|
if (f.lists.length === 0) return header;
|
|
4861
|
-
const listLines = f.lists.map((l) => ` ${l.name} ${chalk10.dim(l.id)}`);
|
|
4874
|
+
const listLines = f.lists.map((l) => ` ${chalk10.dim(">")} ${l.name} ${chalk10.dim(l.id)}`);
|
|
4862
4875
|
return [header, ...listLines].join("\n");
|
|
4863
4876
|
}).join("\n\n");
|
|
4864
4877
|
}
|
|
@@ -4874,6 +4887,13 @@ function formatFoldersMarkdown(folders) {
|
|
|
4874
4887
|
|
|
4875
4888
|
// src/commands/time.ts
|
|
4876
4889
|
import chalk11 from "chalk";
|
|
4890
|
+
var TIME_COLUMNS = [
|
|
4891
|
+
{ key: "task", label: "Task", maxWidth: 35 },
|
|
4892
|
+
{ key: "duration", label: "Duration", maxWidth: 10 },
|
|
4893
|
+
{ key: "date", label: "Date", maxWidth: 20 },
|
|
4894
|
+
{ key: "description", label: "Description", maxWidth: 30 },
|
|
4895
|
+
{ key: "status", label: "", maxWidth: 10, format: (v) => v === "RUNNING" ? chalk11.green(v) : "" }
|
|
4896
|
+
];
|
|
4877
4897
|
async function startTimer(config, taskId, description) {
|
|
4878
4898
|
const client = new ClickUpClient(config);
|
|
4879
4899
|
return client.startTimeEntry(config.teamId, taskId, description);
|
|
@@ -4917,22 +4937,33 @@ async function deleteTimeEntry(config, timeEntryId) {
|
|
|
4917
4937
|
await client.deleteTimeEntry(config.teamId, timeEntryId);
|
|
4918
4938
|
}
|
|
4919
4939
|
function formatTimeEntry(entry) {
|
|
4920
|
-
const lines = [];
|
|
4921
4940
|
const taskName = entry.task?.name ?? "No task";
|
|
4922
|
-
const taskId = entry.task?.id ?? "";
|
|
4923
4941
|
const isRunning = entry.duration < 0;
|
|
4924
4942
|
const elapsed = isRunning ? Date.now() - Number(entry.start) : entry.duration;
|
|
4925
|
-
const
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4943
|
+
const row = {
|
|
4944
|
+
task: taskName,
|
|
4945
|
+
duration: formatDuration(elapsed),
|
|
4946
|
+
date: formatTimestamp(entry.start),
|
|
4947
|
+
description: entry.description ?? "",
|
|
4948
|
+
status: isRunning ? "RUNNING" : ""
|
|
4949
|
+
};
|
|
4950
|
+
return formatTable([row], TIME_COLUMNS);
|
|
4932
4951
|
}
|
|
4933
4952
|
function formatTimeEntries(entries) {
|
|
4934
4953
|
if (entries.length === 0) return "No time entries";
|
|
4935
|
-
|
|
4954
|
+
const rows = entries.map((entry) => {
|
|
4955
|
+
const taskName = entry.task?.name ?? "No task";
|
|
4956
|
+
const isRunning = entry.duration < 0;
|
|
4957
|
+
const elapsed = isRunning ? Date.now() - Number(entry.start) : entry.duration;
|
|
4958
|
+
return {
|
|
4959
|
+
task: taskName,
|
|
4960
|
+
duration: formatDuration(elapsed),
|
|
4961
|
+
date: formatTimestamp(entry.start),
|
|
4962
|
+
description: entry.description ?? "",
|
|
4963
|
+
status: isRunning ? "RUNNING" : ""
|
|
4964
|
+
};
|
|
4965
|
+
});
|
|
4966
|
+
return formatTable(rows, TIME_COLUMNS);
|
|
4936
4967
|
}
|
|
4937
4968
|
function formatTimeEntryMarkdown(entry) {
|
|
4938
4969
|
const taskName = entry.task?.name ?? "No task";
|
|
@@ -4980,14 +5011,23 @@ function formatTagsMarkdown(tags) {
|
|
|
4980
5011
|
}
|
|
4981
5012
|
|
|
4982
5013
|
// src/commands/members.ts
|
|
4983
|
-
|
|
5014
|
+
var MEMBER_COLUMNS = [
|
|
5015
|
+
{ key: "username", label: "Username", maxWidth: 25 },
|
|
5016
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
5017
|
+
{ key: "email", label: "Email", maxWidth: 40 }
|
|
5018
|
+
];
|
|
4984
5019
|
async function listMembers(config) {
|
|
4985
5020
|
const client = new ClickUpClient(config);
|
|
4986
5021
|
return client.getWorkspaceMembers(config.teamId);
|
|
4987
5022
|
}
|
|
4988
5023
|
function formatMembers(members) {
|
|
4989
5024
|
if (members.length === 0) return "No members found";
|
|
4990
|
-
|
|
5025
|
+
const rows = members.map((m) => ({
|
|
5026
|
+
username: m.username,
|
|
5027
|
+
id: String(m.id),
|
|
5028
|
+
email: m.email
|
|
5029
|
+
}));
|
|
5030
|
+
return formatTable(rows, MEMBER_COLUMNS);
|
|
4991
5031
|
}
|
|
4992
5032
|
function formatMembersMarkdown(members) {
|
|
4993
5033
|
if (members.length === 0) return "No members found";
|
|
@@ -4995,18 +5035,31 @@ function formatMembersMarkdown(members) {
|
|
|
4995
5035
|
}
|
|
4996
5036
|
|
|
4997
5037
|
// src/commands/fields.ts
|
|
4998
|
-
import
|
|
5038
|
+
import chalk13 from "chalk";
|
|
5039
|
+
var FIELD_COLUMNS = [
|
|
5040
|
+
{ key: "name", label: "Name", maxWidth: 30 },
|
|
5041
|
+
{ key: "type", label: "Type", maxWidth: 15 },
|
|
5042
|
+
{
|
|
5043
|
+
key: "required",
|
|
5044
|
+
label: "Required",
|
|
5045
|
+
maxWidth: 10,
|
|
5046
|
+
format: (v) => v === "yes" ? chalk13.yellow(v) : chalk13.dim(v)
|
|
5047
|
+
},
|
|
5048
|
+
{ key: "options", label: "Options", maxWidth: 40 }
|
|
5049
|
+
];
|
|
4999
5050
|
async function listFields(config, listId) {
|
|
5000
5051
|
const client = new ClickUpClient(config);
|
|
5001
5052
|
return client.getListCustomFields(listId);
|
|
5002
5053
|
}
|
|
5003
5054
|
function formatFields(fields) {
|
|
5004
5055
|
if (fields.length === 0) return "No custom fields";
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5056
|
+
const rows = fields.map((f) => ({
|
|
5057
|
+
name: f.name,
|
|
5058
|
+
type: f.type,
|
|
5059
|
+
required: f.required ? "yes" : "no",
|
|
5060
|
+
options: f.type_config?.options?.map((o) => o.name).join(", ") ?? ""
|
|
5061
|
+
}));
|
|
5062
|
+
return formatTable(rows, FIELD_COLUMNS);
|
|
5010
5063
|
}
|
|
5011
5064
|
function formatFieldsMarkdown(fields) {
|
|
5012
5065
|
if (fields.length === 0) return "No custom fields";
|
|
@@ -5049,7 +5102,26 @@ async function bulkUpdateStatus(config, taskIds, status) {
|
|
|
5049
5102
|
}
|
|
5050
5103
|
|
|
5051
5104
|
// src/commands/goals.ts
|
|
5052
|
-
import
|
|
5105
|
+
import chalk14 from "chalk";
|
|
5106
|
+
function colorProgress(value) {
|
|
5107
|
+
const num = parseInt(value, 10);
|
|
5108
|
+
if (isNaN(num)) return value;
|
|
5109
|
+
if (num >= 75) return chalk14.green(value);
|
|
5110
|
+
if (num >= 25) return chalk14.yellow(value);
|
|
5111
|
+
return chalk14.red(value);
|
|
5112
|
+
}
|
|
5113
|
+
var GOAL_COLUMNS = [
|
|
5114
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
5115
|
+
{ key: "name", label: "Name", maxWidth: 40 },
|
|
5116
|
+
{ key: "progress", label: "Progress", maxWidth: 10, format: (v) => colorProgress(v) },
|
|
5117
|
+
{ key: "owner", label: "Owner", maxWidth: 20 }
|
|
5118
|
+
];
|
|
5119
|
+
var KEY_RESULT_COLUMNS = [
|
|
5120
|
+
{ key: "id", label: "ID", maxWidth: 15 },
|
|
5121
|
+
{ key: "name", label: "Name", maxWidth: 40 },
|
|
5122
|
+
{ key: "progress", label: "Progress", maxWidth: 10, format: (v) => colorProgress(v) },
|
|
5123
|
+
{ key: "current", label: "Current/Target", maxWidth: 15 }
|
|
5124
|
+
];
|
|
5053
5125
|
async function listGoals(config) {
|
|
5054
5126
|
const client = new ClickUpClient(config);
|
|
5055
5127
|
return client.getGoals(config.teamId);
|
|
@@ -5087,11 +5159,13 @@ async function updateKeyResult(config, keyResultId, updates) {
|
|
|
5087
5159
|
}
|
|
5088
5160
|
function formatGoals(goals) {
|
|
5089
5161
|
if (goals.length === 0) return "No goals found";
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5162
|
+
const rows = goals.map((g) => ({
|
|
5163
|
+
name: g.name,
|
|
5164
|
+
id: g.id,
|
|
5165
|
+
progress: `${Math.round(g.percent_completed * 100)}%`,
|
|
5166
|
+
owner: g.owner ? `@${g.owner.username}` : ""
|
|
5167
|
+
}));
|
|
5168
|
+
return formatTable(rows, GOAL_COLUMNS);
|
|
5095
5169
|
}
|
|
5096
5170
|
function formatGoalsMarkdown(goals) {
|
|
5097
5171
|
if (goals.length === 0) return "No goals found";
|
|
@@ -5103,10 +5177,13 @@ function formatGoalsMarkdown(goals) {
|
|
|
5103
5177
|
}
|
|
5104
5178
|
function formatKeyResults(keyResults) {
|
|
5105
5179
|
if (keyResults.length === 0) return "No key results found";
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5180
|
+
const rows = keyResults.map((kr) => ({
|
|
5181
|
+
name: kr.name,
|
|
5182
|
+
id: kr.id,
|
|
5183
|
+
progress: `${Math.round(kr.percent_completed * 100)}%`,
|
|
5184
|
+
current: `${kr.steps_current}/${kr.steps_end}`
|
|
5185
|
+
}));
|
|
5186
|
+
return formatTable(rows, KEY_RESULT_COLUMNS);
|
|
5110
5187
|
}
|
|
5111
5188
|
function formatKeyResultsMarkdown(keyResults) {
|
|
5112
5189
|
if (keyResults.length === 0) return "No key results found";
|
|
@@ -5117,14 +5194,14 @@ function formatKeyResultsMarkdown(keyResults) {
|
|
|
5117
5194
|
}
|
|
5118
5195
|
|
|
5119
5196
|
// src/commands/task-types.ts
|
|
5120
|
-
import
|
|
5197
|
+
import chalk15 from "chalk";
|
|
5121
5198
|
async function listTaskTypes(config) {
|
|
5122
5199
|
const client = new ClickUpClient(config);
|
|
5123
5200
|
return client.getCustomTaskTypes(config.teamId);
|
|
5124
5201
|
}
|
|
5125
5202
|
function formatTaskTypes(types) {
|
|
5126
5203
|
if (types.length === 0) return "No custom task types";
|
|
5127
|
-
return types.map((t) => `${
|
|
5204
|
+
return types.map((t) => `${chalk15.bold(t.name)} ${chalk15.dim(`(${t.id})`)}`).join("\n");
|
|
5128
5205
|
}
|
|
5129
5206
|
function formatTaskTypesMarkdown(types) {
|
|
5130
5207
|
if (types.length === 0) return "No custom task types";
|
|
@@ -5132,14 +5209,14 @@ function formatTaskTypesMarkdown(types) {
|
|
|
5132
5209
|
}
|
|
5133
5210
|
|
|
5134
5211
|
// src/commands/templates.ts
|
|
5135
|
-
import
|
|
5212
|
+
import chalk16 from "chalk";
|
|
5136
5213
|
async function listTemplates(config) {
|
|
5137
5214
|
const client = new ClickUpClient(config);
|
|
5138
5215
|
return client.getTaskTemplates(config.teamId);
|
|
5139
5216
|
}
|
|
5140
5217
|
function formatTemplates(templates) {
|
|
5141
5218
|
if (templates.length === 0) return "No task templates";
|
|
5142
|
-
return templates.map((t) => `${
|
|
5219
|
+
return templates.map((t) => `${chalk16.bold(t.name)} ${chalk16.dim(`(${t.id})`)}`).join("\n");
|
|
5143
5220
|
}
|
|
5144
5221
|
function formatTemplatesMarkdown(templates) {
|
|
5145
5222
|
if (templates.length === 0) return "No task templates";
|
|
@@ -5147,14 +5224,14 @@ function formatTemplatesMarkdown(templates) {
|
|
|
5147
5224
|
}
|
|
5148
5225
|
|
|
5149
5226
|
// src/commands/list-templates.ts
|
|
5150
|
-
import
|
|
5227
|
+
import chalk17 from "chalk";
|
|
5151
5228
|
async function listListTemplates(config) {
|
|
5152
5229
|
const client = new ClickUpClient(config);
|
|
5153
5230
|
return client.getListTemplates(config.teamId);
|
|
5154
5231
|
}
|
|
5155
5232
|
function formatListTemplates(templates) {
|
|
5156
5233
|
if (templates.length === 0) return "No list templates";
|
|
5157
|
-
return templates.map((t) => `${
|
|
5234
|
+
return templates.map((t) => `${chalk17.bold(t.name)} ${chalk17.dim(`(${t.id})`)}`).join("\n");
|
|
5158
5235
|
}
|
|
5159
5236
|
function formatListTemplatesMarkdown(templates) {
|
|
5160
5237
|
if (templates.length === 0) return "No list templates";
|
|
@@ -5162,14 +5239,14 @@ function formatListTemplatesMarkdown(templates) {
|
|
|
5162
5239
|
}
|
|
5163
5240
|
|
|
5164
5241
|
// src/commands/folder-templates.ts
|
|
5165
|
-
import
|
|
5242
|
+
import chalk18 from "chalk";
|
|
5166
5243
|
async function listFolderTemplates(config) {
|
|
5167
5244
|
const client = new ClickUpClient(config);
|
|
5168
5245
|
return client.getFolderTemplates(config.teamId);
|
|
5169
5246
|
}
|
|
5170
5247
|
function formatFolderTemplates(templates) {
|
|
5171
5248
|
if (templates.length === 0) return "No folder templates";
|
|
5172
|
-
return templates.map((t) => `${
|
|
5249
|
+
return templates.map((t) => `${chalk18.bold(t.name)} ${chalk18.dim(`(${t.id})`)}`).join("\n");
|
|
5173
5250
|
}
|
|
5174
5251
|
function formatFolderTemplatesMarkdown(templates) {
|
|
5175
5252
|
if (templates.length === 0) return "No folder templates";
|
|
@@ -5192,7 +5269,7 @@ async function createListFromTemplate(config, name, opts) {
|
|
|
5192
5269
|
}
|
|
5193
5270
|
|
|
5194
5271
|
// src/commands/views.ts
|
|
5195
|
-
import
|
|
5272
|
+
import chalk19 from "chalk";
|
|
5196
5273
|
async function listViews(config, listId) {
|
|
5197
5274
|
const client = new ClickUpClient(config);
|
|
5198
5275
|
const data = await client.getListViews(listId);
|
|
@@ -5200,7 +5277,7 @@ async function listViews(config, listId) {
|
|
|
5200
5277
|
}
|
|
5201
5278
|
function formatViews(views) {
|
|
5202
5279
|
if (views.length === 0) return "No views";
|
|
5203
|
-
return views.map((v) => `${
|
|
5280
|
+
return views.map((v) => `${chalk19.bold(v.name)} ${chalk19.dim(`(${v.id})`)} ${chalk19.dim(v.type)}`).join("\n");
|
|
5204
5281
|
}
|
|
5205
5282
|
function formatViewsMarkdown(views) {
|
|
5206
5283
|
if (views.length === 0) return "No views";
|
|
@@ -5208,20 +5285,20 @@ function formatViewsMarkdown(views) {
|
|
|
5208
5285
|
}
|
|
5209
5286
|
|
|
5210
5287
|
// src/commands/view.ts
|
|
5211
|
-
import
|
|
5288
|
+
import chalk20 from "chalk";
|
|
5212
5289
|
async function getView(config, viewId) {
|
|
5213
5290
|
const client = new ClickUpClient(config);
|
|
5214
5291
|
return client.getView(viewId);
|
|
5215
5292
|
}
|
|
5216
5293
|
function formatView(view) {
|
|
5217
5294
|
const lines = [];
|
|
5218
|
-
lines.push(
|
|
5295
|
+
lines.push(chalk20.bold.underline(view.name));
|
|
5219
5296
|
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(` ${
|
|
5297
|
+
lines.push(` ${chalk20.bold("ID")} ${view.id}`);
|
|
5298
|
+
lines.push(` ${chalk20.bold("Type")} ${view.type}`);
|
|
5299
|
+
if (view.visibility) lines.push(` ${chalk20.bold("Visibility")} ${view.visibility}`);
|
|
5300
|
+
if (view.date_created) lines.push(` ${chalk20.bold("Created")} ${formatDate(view.date_created)}`);
|
|
5301
|
+
if (view.protected !== void 0) lines.push(` ${chalk20.bold("Protected")} ${view.protected}`);
|
|
5225
5302
|
return lines.join("\n");
|
|
5226
5303
|
}
|
|
5227
5304
|
function formatViewMarkdown(view) {
|