@krodak/clickup-cli 1.15.0 → 1.16.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.
@@ -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.15.0",
4
+ "version": "1.16.0",
5
5
  "author": {
6
6
  "name": "Krzysztof Rodak"
7
7
  },
package/dist/index.js CHANGED
@@ -258,6 +258,12 @@ var ClickUpClient = class {
258
258
  body: JSON.stringify({ name })
259
259
  });
260
260
  }
261
+ async updateList(listId, payload) {
262
+ return this.request(`/list/${listId}`, {
263
+ method: "PUT",
264
+ body: JSON.stringify(payload)
265
+ });
266
+ }
261
267
  async createFolder(spaceId, name) {
262
268
  return this.request(`/space/${spaceId}/folder`, {
263
269
  method: "POST",
@@ -892,6 +898,7 @@ function migrateToMultiProfile(parsed, filePath) {
892
898
  if (typeof value.teamId === "string" && value.teamId.trim()) p.teamId = value.teamId.trim();
893
899
  if (typeof value.sprintFolderId === "string" && value.sprintFolderId.trim())
894
900
  p.sprintFolderId = value.sprintFolderId.trim();
901
+ if (isRecord2(value.filters)) p.filters = value.filters;
895
902
  profiles[name] = p;
896
903
  }
897
904
  }
@@ -1079,6 +1086,33 @@ function getConfigPath() {
1079
1086
  migrateFromLegacy();
1080
1087
  return configPath();
1081
1088
  }
1089
+ function getFilters(profileName) {
1090
+ const multi = loadMultiProfileConfig();
1091
+ const name = profileName ?? process.env.CU_PROFILE?.trim() ?? multi.defaultProfile;
1092
+ const profile = name ? multi.profiles[name] ?? {} : {};
1093
+ return profile.filters ?? {};
1094
+ }
1095
+ function saveFilter(name, entry, profileName) {
1096
+ const multi = loadMultiProfileConfig();
1097
+ const pName = profileName ?? process.env.CU_PROFILE?.trim() ?? multi.defaultProfile ?? "default";
1098
+ const profile = multi.profiles[pName] ?? {};
1099
+ const filters = { ...profile.filters ?? {}, [name]: entry };
1100
+ multi.profiles[pName] = { ...profile, filters };
1101
+ if (!multi.defaultProfile) multi.defaultProfile = pName;
1102
+ saveMultiProfileConfig(multi);
1103
+ }
1104
+ function deleteFilter(name, profileName) {
1105
+ const multi = loadMultiProfileConfig();
1106
+ const pName = profileName ?? process.env.CU_PROFILE?.trim() ?? multi.defaultProfile ?? "default";
1107
+ const profile = multi.profiles[pName] ?? {};
1108
+ const filters = { ...profile.filters ?? {} };
1109
+ if (!(name in filters)) {
1110
+ throw new Error(`Filter "${name}" not found.`);
1111
+ }
1112
+ delete filters[name];
1113
+ multi.profiles[pName] = { ...profile, filters };
1114
+ saveMultiProfileConfig(multi);
1115
+ }
1082
1116
  function writeConfig(config, profileName) {
1083
1117
  const multi = loadMultiProfileConfig();
1084
1118
  const name = profileName || multi.defaultProfile || "default";
@@ -1754,8 +1788,14 @@ function buildUpdatePayload(opts) {
1754
1788
  payload.start_date = parseDueDate(opts.startDate);
1755
1789
  payload.start_date_time = false;
1756
1790
  }
1757
- if (opts.assignee !== void 0) {
1758
- payload.assignees = { add: [parseAssigneeId(opts.assignee)] };
1791
+ if (opts.assignee !== void 0 || opts.removeAssignee !== void 0) {
1792
+ payload.assignees = {};
1793
+ if (opts.assignee !== void 0) {
1794
+ payload.assignees.add = [parseAssigneeId(opts.assignee)];
1795
+ }
1796
+ if (opts.removeAssignee !== void 0) {
1797
+ payload.assignees.rem = [parseAssigneeId(opts.removeAssignee)];
1798
+ }
1759
1799
  }
1760
1800
  if (opts.timeEstimate !== void 0) {
1761
1801
  payload.time_estimate = parseTimeEstimate(opts.timeEstimate);
@@ -1789,7 +1829,7 @@ async function resolveStatus(client, taskId, statusInput) {
1789
1829
  async function updateTask(config, taskId, options) {
1790
1830
  if (!hasUpdateFields(options))
1791
1831
  throw new Error(
1792
- "Provide at least one of: --name, --description, --status, --priority, --due-date, --start-date, --time-estimate, --assignee, --parent, --detach, --archive, --unarchive"
1832
+ "Provide at least one of: --name, --description, --status, --priority, --due-date, --start-date, --time-estimate, --assignee, --remove-assignee, --parent, --detach, --archive, --unarchive"
1793
1833
  );
1794
1834
  const client = new ClickUpClient(config);
1795
1835
  if (options.status !== void 0) {
@@ -2630,7 +2670,11 @@ async function fetchOverdueTasks(config, opts = {}) {
2630
2670
  }
2631
2671
 
2632
2672
  // src/commands/config.ts
2633
- var VALID_KEYS = /* @__PURE__ */ new Set(["apiToken", "teamId", "sprintFolderId"]);
2673
+ var VALID_KEYS = /* @__PURE__ */ new Set([
2674
+ "apiToken",
2675
+ "teamId",
2676
+ "sprintFolderId"
2677
+ ]);
2634
2678
  function readStoredString(value) {
2635
2679
  if (typeof value !== "string") return void 0;
2636
2680
  const trimmed = value.trim();
@@ -2802,6 +2846,7 @@ var commandMetadata = [
2802
2846
  "--start-date",
2803
2847
  "--time-estimate",
2804
2848
  "--assignee",
2849
+ "--remove-assignee",
2805
2850
  "--parent",
2806
2851
  "--detach",
2807
2852
  "--archive",
@@ -3151,7 +3196,11 @@ var commandMetadata = [
3151
3196
  usage: "time log <taskId> <duration>",
3152
3197
  description: "Log a manual time entry"
3153
3198
  },
3154
- { section: "write", usage: "time list", description: "List recent time entries" },
3199
+ {
3200
+ section: "write",
3201
+ usage: "time list",
3202
+ description: "List my recent time entries (--all for team)"
3203
+ },
3155
3204
  { section: "write", usage: "time update <timeEntryId>", description: "Update a time entry" },
3156
3205
  { section: "write", usage: "time delete <timeEntryId>", description: "Delete a time entry" }
3157
3206
  ]
@@ -3255,7 +3304,7 @@ var commandMetadata = [
3255
3304
  {
3256
3305
  name: "list-create",
3257
3306
  description: "Create a new list in a space",
3258
- flags: ["--folder", "--json"],
3307
+ flags: ["--folder", "--copy-statuses-from", "--json"],
3259
3308
  quickReference: [
3260
3309
  {
3261
3310
  section: "write",
@@ -3318,6 +3367,21 @@ var commandMetadata = [
3318
3367
  section: "write",
3319
3368
  usage: "bulk status <status> <taskIds...>",
3320
3369
  description: "Bulk update task status"
3370
+ },
3371
+ {
3372
+ section: "write",
3373
+ usage: "bulk assign <taskIds...>",
3374
+ description: "Bulk assign user to tasks"
3375
+ },
3376
+ {
3377
+ section: "write",
3378
+ usage: "bulk due-date <date> <taskIds...>",
3379
+ description: "Bulk set due date"
3380
+ },
3381
+ {
3382
+ section: "write",
3383
+ usage: "bulk tag <tagName> <taskIds...>",
3384
+ description: "Bulk add/remove tag"
3321
3385
  }
3322
3386
  ]
3323
3387
  },
@@ -3489,6 +3553,19 @@ var commandMetadata = [
3489
3553
  { section: "write", usage: "view-delete <viewId>", description: "Delete a view" }
3490
3554
  ]
3491
3555
  },
3556
+ {
3557
+ name: "filter",
3558
+ description: "Manage saved command shortcuts",
3559
+ quickReference: [
3560
+ {
3561
+ section: "setup",
3562
+ usage: "filter save <name> [args...]",
3563
+ description: "Save a command shortcut"
3564
+ },
3565
+ { section: "read", usage: "filter list", description: "List saved shortcuts" },
3566
+ { section: "read", usage: "filter run <name>", description: "Run a saved shortcut" }
3567
+ ]
3568
+ },
3492
3569
  {
3493
3570
  name: "profile",
3494
3571
  description: "Manage profiles",
@@ -3556,6 +3633,7 @@ var bashSpecialCaseCommands = /* @__PURE__ */ new Set([
3556
3633
  "checklist",
3557
3634
  "time",
3558
3635
  "bulk",
3636
+ "filter",
3559
3637
  "config",
3560
3638
  "profile",
3561
3639
  "completion"
@@ -3649,7 +3727,7 @@ ${renderBashCommandCases()}
3649
3727
  ;;
3650
3728
  bulk)
3651
3729
  if [[ $cword -eq 2 ]]; then
3652
- COMPREPLY=($(compgen -W "status" -- "$cur"))
3730
+ COMPREPLY=($(compgen -W "status assign due-date tag" -- "$cur"))
3653
3731
  fi
3654
3732
  ;;
3655
3733
  profile)
@@ -3724,6 +3802,7 @@ ${renderZshTopLevelCommands(name)}
3724
3802
  '--start-date[Start date]:date:' \\
3725
3803
  '--time-estimate[Time estimate]:duration:' \\
3726
3804
  '--assignee[Add assignee]:user_id:' \\
3805
+ '--remove-assignee[Remove assignee]:user_id:' \\
3727
3806
  '--parent[Set parent task]:task_id:' \\
3728
3807
  '--detach[Remove parent task]' \\
3729
3808
  '--archive[Archive the task]' \\
@@ -4087,6 +4166,9 @@ ${renderZshTopLevelCommands(name)}
4087
4166
  local -a bulk_cmds
4088
4167
  bulk_cmds=(
4089
4168
  'status:Update status of multiple tasks'
4169
+ 'assign:Bulk assign or unassign a user from tasks'
4170
+ 'due-date:Bulk set due date on tasks'
4171
+ 'tag:Bulk add or remove a tag on tasks'
4090
4172
  )
4091
4173
  _arguments -C \\
4092
4174
  '1:bulk command:->bulk_cmd' \\
@@ -4100,6 +4182,15 @@ ${renderZshTopLevelCommands(name)}
4100
4182
  status)
4101
4183
  _arguments '1:status:' '*:task_ids:' '--json[Force JSON output]'
4102
4184
  ;;
4185
+ assign)
4186
+ _arguments '*:task_ids:' '--to[Add user (ID or me)]:userId:' '--remove[Remove user (ID or me)]:userId:' '--json[Force JSON output]'
4187
+ ;;
4188
+ due-date)
4189
+ _arguments '1:date:' '*:task_ids:' '--json[Force JSON output]'
4190
+ ;;
4191
+ tag)
4192
+ _arguments '1:tagName:' '*:task_ids:' '--add[Add tag]' '--remove[Remove tag]' '--json[Force JSON output]'
4193
+ ;;
4103
4194
  esac
4104
4195
  ;;
4105
4196
  esac
@@ -4244,6 +4335,7 @@ ${renderZshTopLevelCommands(name)}
4244
4335
  '1:space_id:' \\
4245
4336
  '2:name:' \\
4246
4337
  '--folder[Create inside a folder]:folder_id:' \\
4338
+ '--copy-statuses-from[Copy statuses from list or space]:id:' \\
4247
4339
  '--json[Force JSON output]'
4248
4340
  ;;
4249
4341
  folder-create)
@@ -4274,6 +4366,50 @@ ${renderZshTopLevelCommands(name)}
4274
4366
  '(-c --content)'{-c,--content}'[New page content]:text:' \\
4275
4367
  '--json[Force JSON output]'
4276
4368
  ;;
4369
+ filter)
4370
+ local -a filter_cmds
4371
+ filter_cmds=(
4372
+ 'save:Save a command shortcut'
4373
+ 'run:Run a saved shortcut'
4374
+ 'list:List saved shortcuts'
4375
+ 'delete:Delete a saved shortcut'
4376
+ 'show:Show details of a saved shortcut'
4377
+ )
4378
+ _arguments -C \\
4379
+ '1:filter command:->filter_cmd' \\
4380
+ '*::filter_arg:->filter_args'
4381
+ case $state in
4382
+ filter_cmd)
4383
+ _describe 'filter command' filter_cmds
4384
+ ;;
4385
+ filter_args)
4386
+ case $words[1] in
4387
+ save)
4388
+ _arguments \\
4389
+ '1:name:' \\
4390
+ '*:command:' \\
4391
+ '(-d --description)'{-d,--description}'[Filter description]:text:' \\
4392
+ '--json[Force JSON output]'
4393
+ ;;
4394
+ run)
4395
+ _arguments '1:name:'
4396
+ ;;
4397
+ list)
4398
+ _arguments '--json[Force JSON output]'
4399
+ ;;
4400
+ delete)
4401
+ _arguments '1:name:' '--json[Force JSON output]'
4402
+ ;;
4403
+ show)
4404
+ _arguments '1:name:' '--json[Force JSON output]'
4405
+ ;;
4406
+ *)
4407
+ _arguments '1:subcommand:(save run list delete show)'
4408
+ ;;
4409
+ esac
4410
+ ;;
4411
+ esac
4412
+ ;;
4277
4413
  profile)
4278
4414
  local -a profile_cmds
4279
4415
  profile_cmds=(
@@ -4378,8 +4514,15 @@ complete -c ${name} -n '__fish_seen_subcommand_from update; and __fish_seen_subc
4378
4514
 
4379
4515
  complete -c ${name} -n '__fish_seen_subcommand_from attach' -F
4380
4516
 
4381
- complete -c ${name} -n '__fish_seen_subcommand_from bulk; and not __fish_seen_subcommand_from status' -a status -d 'Update status of multiple tasks'
4382
- complete -c ${name} -n '__fish_seen_subcommand_from status; and __fish_seen_subcommand_from bulk' -l json -d 'Force JSON output'
4517
+ complete -c ${name} -n '__fish_seen_subcommand_from bulk; and not __fish_seen_subcommand_from status assign due-date tag' -a status -d 'Update status of multiple tasks'
4518
+ complete -c ${name} -n '__fish_seen_subcommand_from bulk; and not __fish_seen_subcommand_from status assign due-date tag' -a assign -d 'Bulk assign or unassign a user from tasks'
4519
+ complete -c ${name} -n '__fish_seen_subcommand_from bulk; and not __fish_seen_subcommand_from status assign due-date tag' -a due-date -d 'Bulk set due date on tasks'
4520
+ complete -c ${name} -n '__fish_seen_subcommand_from bulk; and not __fish_seen_subcommand_from status assign due-date tag' -a tag -d 'Bulk add or remove a tag on tasks'
4521
+ complete -c ${name} -n '__fish_seen_subcommand_from status assign due-date tag; and __fish_seen_subcommand_from bulk' -l json -d 'Force JSON output'
4522
+ complete -c ${name} -n '__fish_seen_subcommand_from assign; and __fish_seen_subcommand_from bulk' -l to -d 'Add user (ID or me)'
4523
+ complete -c ${name} -n '__fish_seen_subcommand_from assign; and __fish_seen_subcommand_from bulk' -l remove -d 'Remove user (ID or me)'
4524
+ complete -c ${name} -n '__fish_seen_subcommand_from tag; and __fish_seen_subcommand_from bulk' -l add -d 'Add tag'
4525
+ complete -c ${name} -n '__fish_seen_subcommand_from tag; and __fish_seen_subcommand_from bulk' -l remove -d 'Remove tag'
4383
4526
 
4384
4527
  complete -c ${name} -n '__fish_seen_subcommand_from profile; and not __fish_seen_subcommand_from list add remove use' -a list -d 'List all profiles'
4385
4528
  complete -c ${name} -n '__fish_seen_subcommand_from profile; and not __fish_seen_subcommand_from list add remove use' -a add -d 'Add a new profile'
@@ -4393,6 +4536,14 @@ complete -c ${name} -n '__fish_seen_subcommand_from config; and not __fish_seen_
4393
4536
  complete -c ${name} -n '__fish_seen_subcommand_from get set' -a 'apiToken teamId sprintFolderId' -d 'Config key'
4394
4537
 
4395
4538
  complete -c ${name} -n '__fish_seen_subcommand_from completion' -a 'bash zsh fish' -d 'Shell type'
4539
+
4540
+ complete -c ${name} -n '__fish_seen_subcommand_from filter; and not __fish_seen_subcommand_from save run list delete show' -a save -d 'Save a command shortcut'
4541
+ complete -c ${name} -n '__fish_seen_subcommand_from filter; and not __fish_seen_subcommand_from save run list delete show' -a run -d 'Run a saved shortcut'
4542
+ complete -c ${name} -n '__fish_seen_subcommand_from filter; and not __fish_seen_subcommand_from save run list delete show' -a list -d 'List saved shortcuts'
4543
+ complete -c ${name} -n '__fish_seen_subcommand_from filter; and not __fish_seen_subcommand_from save run list delete show' -a delete -d 'Delete a saved shortcut'
4544
+ complete -c ${name} -n '__fish_seen_subcommand_from filter; and not __fish_seen_subcommand_from save run list delete show' -a show -d 'Show details of a saved shortcut'
4545
+ complete -c ${name} -n '__fish_seen_subcommand_from save run list delete show; and __fish_seen_subcommand_from filter' -l json -d 'Force JSON output'
4546
+ complete -c ${name} -n '__fish_seen_subcommand_from save; and __fish_seen_subcommand_from filter' -s d -l description -d 'Filter description'
4396
4547
  `;
4397
4548
  }
4398
4549
  function generateCompletion(shell, name = "cup") {
@@ -4990,13 +5141,18 @@ async function listTimeEntries(config, opts) {
4990
5141
  const days = opts?.days ?? 7;
4991
5142
  const endDate = Date.now();
4992
5143
  const startDate = endDate - days * 24 * 60 * 60 * 1e3;
5144
+ let assigneeId = opts?.assigneeId;
5145
+ if (!opts?.all && !assigneeId) {
5146
+ const me = await client.getMe();
5147
+ assigneeId = String(me.id);
5148
+ }
4993
5149
  return client.getTimeEntries(config.teamId, {
4994
5150
  startDate,
4995
5151
  endDate,
4996
5152
  taskId: opts?.taskId,
4997
5153
  spaceId: opts?.spaceId,
4998
5154
  listId: opts?.listId,
4999
- assigneeId: opts?.assigneeId
5155
+ assigneeId
5000
5156
  });
5001
5157
  }
5002
5158
  async function updateTimeEntry(config, timeEntryId, opts) {
@@ -5198,6 +5354,53 @@ async function bulkUpdateStatus(config, taskIds, status) {
5198
5354
  }
5199
5355
  return { updated: taskIds.length - failed.length, failed };
5200
5356
  }
5357
+ async function bulkAssign(config, userIdOrMe, taskIds, action) {
5358
+ const client = new ClickUpClient(config);
5359
+ const numericId = await resolveAssigneeId(client, userIdOrMe);
5360
+ const failed = [];
5361
+ for (const id of taskIds) {
5362
+ try {
5363
+ await client.updateTask(id, {
5364
+ assignees: action === "add" ? { add: [numericId] } : { rem: [numericId] }
5365
+ });
5366
+ } catch (err) {
5367
+ const reason = err instanceof Error ? err.message : String(err);
5368
+ failed.push({ id, reason });
5369
+ }
5370
+ }
5371
+ return { updated: taskIds.length - failed.length, failed };
5372
+ }
5373
+ async function bulkDueDate(config, date, taskIds) {
5374
+ const client = new ClickUpClient(config);
5375
+ const payload = date === "none" || date === "clear" ? { due_date: null } : { due_date: parseDueDate(date), due_date_time: false };
5376
+ const failed = [];
5377
+ for (const id of taskIds) {
5378
+ try {
5379
+ await client.updateTask(id, payload);
5380
+ } catch (err) {
5381
+ const reason = err instanceof Error ? err.message : String(err);
5382
+ failed.push({ id, reason });
5383
+ }
5384
+ }
5385
+ return { updated: taskIds.length - failed.length, failed };
5386
+ }
5387
+ async function bulkTag(config, tagName, taskIds, action) {
5388
+ const client = new ClickUpClient(config);
5389
+ const failed = [];
5390
+ for (const id of taskIds) {
5391
+ try {
5392
+ if (action === "add") {
5393
+ await client.addTagToTask(id, tagName);
5394
+ } else {
5395
+ await client.removeTagFromTask(id, tagName);
5396
+ }
5397
+ } catch (err) {
5398
+ const reason = err instanceof Error ? err.message : String(err);
5399
+ failed.push({ id, reason });
5400
+ }
5401
+ }
5402
+ return { updated: taskIds.length - failed.length, failed };
5403
+ }
5201
5404
 
5202
5405
  // src/commands/goals.ts
5203
5406
  import chalk14 from "chalk";
@@ -5499,6 +5702,117 @@ async function deleteViewCommand(config, viewId, opts) {
5499
5702
  return { viewId, deleted: true };
5500
5703
  }
5501
5704
 
5705
+ // src/commands/filter.ts
5706
+ import { spawnSync } from "child_process";
5707
+ var ALLOWED_FILTER_COMMANDS = /* @__PURE__ */ new Set([
5708
+ "tasks",
5709
+ "search",
5710
+ "sprint",
5711
+ "assigned",
5712
+ "overdue",
5713
+ "inbox",
5714
+ "summary",
5715
+ "views",
5716
+ "lists",
5717
+ "spaces",
5718
+ "folders",
5719
+ "members",
5720
+ "tags",
5721
+ "goals",
5722
+ "key-results",
5723
+ "task-types",
5724
+ "templates",
5725
+ "list-templates",
5726
+ "folder-templates",
5727
+ "docs"
5728
+ ]);
5729
+ function isAllowedFilterCommand(tokens) {
5730
+ if (tokens.length === 0) return false;
5731
+ if (tokens[0] === "time" && tokens[1] === "list") return true;
5732
+ return ALLOWED_FILTER_COMMANDS.has(tokens[0]);
5733
+ }
5734
+ function runFilter(name, entry) {
5735
+ const result = spawnSync(process.execPath, [process.argv[1], ...entry.command], {
5736
+ stdio: "inherit"
5737
+ });
5738
+ if (result.error) throw result.error;
5739
+ if (result.status !== null && result.status !== 0) {
5740
+ process.exitCode = result.status;
5741
+ }
5742
+ }
5743
+ var FILTER_COLUMNS = [
5744
+ { key: "name", label: "NAME", maxWidth: 30 },
5745
+ { key: "command", label: "COMMAND", maxWidth: 60 },
5746
+ { key: "description", label: "DESCRIPTION", maxWidth: 50 }
5747
+ ];
5748
+ function formatFiltersTable(filters) {
5749
+ const entries = Object.entries(filters);
5750
+ if (entries.length === 0) return "No filters saved";
5751
+ const rows = entries.map(([name, entry]) => ({
5752
+ name,
5753
+ command: entry.command.join(" "),
5754
+ description: entry.description ?? ""
5755
+ }));
5756
+ return formatTable(rows, FILTER_COLUMNS);
5757
+ }
5758
+ function formatFiltersMarkdown(filters) {
5759
+ const entries = Object.entries(filters);
5760
+ if (entries.length === 0) return "No filters saved";
5761
+ const lines = ["| Name | Command | Description |", "| --- | --- | --- |"];
5762
+ for (const [name, entry] of entries) {
5763
+ const command = entry.command.join(" ");
5764
+ const description = entry.description ?? "";
5765
+ lines.push(`| ${name} | ${command} | ${description} |`);
5766
+ }
5767
+ return lines.join("\n");
5768
+ }
5769
+ function formatFilterDetail(name, entry) {
5770
+ if (isTTY()) {
5771
+ const lines2 = [`Name: ${name}`, `Command: ${entry.command.join(" ")}`];
5772
+ if (entry.description) lines2.push(`Description: ${entry.description}`);
5773
+ return lines2.join("\n");
5774
+ }
5775
+ const lines = [`**${name}**`, ``, `Command: \`${entry.command.join(" ")}\``];
5776
+ if (entry.description) lines.push(`Description: ${entry.description}`);
5777
+ return lines.join("\n");
5778
+ }
5779
+
5780
+ // src/commands/list-create.ts
5781
+ async function createListWithOptions(config, spaceId, name, opts) {
5782
+ const client = new ClickUpClient(config);
5783
+ let statuses;
5784
+ if (opts.copyStatusesFrom) {
5785
+ statuses = await copyStatusesFrom(client, opts.copyStatusesFrom);
5786
+ }
5787
+ const list = opts.folder ? await client.createFolderList(opts.folder, name) : await client.createList(spaceId, name);
5788
+ if (statuses) {
5789
+ await client.updateList(list.id, { statuses });
5790
+ }
5791
+ return {
5792
+ ...list,
5793
+ ...statuses ? { statusesCopied: statuses.length } : {}
5794
+ };
5795
+ }
5796
+ async function copyStatusesFrom(client, sourceId) {
5797
+ try {
5798
+ const list = await client.getListWithStatuses(sourceId);
5799
+ return list.statuses.map((s) => ({ status: s.status, color: s.color, type: s.type ?? "custom" }));
5800
+ } catch {
5801
+ try {
5802
+ const space = await client.getSpaceWithStatuses(sourceId);
5803
+ return space.statuses.map((s) => ({
5804
+ status: s.status,
5805
+ color: s.color,
5806
+ type: s.type ?? "custom"
5807
+ }));
5808
+ } catch {
5809
+ throw new Error(
5810
+ `Could not find a list or space with ID "${sourceId}". Check the ID and try again.`
5811
+ );
5812
+ }
5813
+ }
5814
+ }
5815
+
5502
5816
  // src/index.ts
5503
5817
  var require2 = createRequire(import.meta.url);
5504
5818
  var { version } = require2("../package.json");
@@ -5572,7 +5886,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
5572
5886
  }
5573
5887
  })
5574
5888
  );
5575
- 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, or "none"/"clear" to remove)').option("--start-date <date>", "Start 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("--detach", "Remove parent task (promote subtask to top-level)").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(
5889
+ 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, or "none"/"clear" to remove)').option("--start-date <date>", "Start 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("--remove-assignee <userId>", 'Remove assignee by user ID or "me"').option("--parent <taskId>", "Set parent task (makes this a subtask)").option("--detach", "Remove parent task (promote subtask to top-level)").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(
5576
5890
  wrapAction(
5577
5891
  async (taskId, opts) => {
5578
5892
  const config = loadConfig(getProfileName());
@@ -5580,11 +5894,15 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
5580
5894
  const client = new ClickUpClient(config);
5581
5895
  opts.assignee = String(await resolveAssigneeId(client, "me"));
5582
5896
  }
5897
+ if (opts.removeAssignee === "me") {
5898
+ const client = new ClickUpClient(config);
5899
+ opts.removeAssignee = String(await resolveAssigneeId(client, "me"));
5900
+ }
5583
5901
  const payload = buildUpdatePayload(opts);
5584
5902
  const hasFields = (opts.field?.length ?? 0) > 0;
5585
5903
  if (!hasFields && Object.keys(payload).length === 0) {
5586
5904
  throw new Error(
5587
- "Provide at least one of: --name, --description, --status, --priority, --due-date, --time-estimate, --assignee, --parent, --archive, --unarchive, --field"
5905
+ "Provide at least one of: --name, --description, --status, --priority, --due-date, --time-estimate, --assignee, --remove-assignee, --parent, --archive, --unarchive, --field"
5588
5906
  );
5589
5907
  }
5590
5908
  let result;
@@ -6080,7 +6398,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
6080
6398
  }
6081
6399
  )
6082
6400
  );
6083
- timeCmd.command("list").description("List recent time entries (default: last 7 days)").option("--days <n>", "Number of days to look back", "7").option("--task <taskId>", "Filter by task ID").option("--space <spaceId>", "Filter by space ID").option("--list <listId>", "Filter by list ID").option("--assignee <userId>", "Filter by assignee user ID").option("--json", "Force JSON output even in terminal").action(
6401
+ timeCmd.command("list").description("List my recent time entries (use --all for team entries)").option("--days <n>", "Number of days to look back", "7").option("--task <taskId>", "Filter by task ID").option("--space <spaceId>", "Filter by space ID").option("--list <listId>", "Filter by list ID").option("--assignee <userId>", "Filter by assignee user ID").option("--all", "Show all team entries (default: only mine)").option("--json", "Force JSON output even in terminal").action(
6084
6402
  wrapAction(
6085
6403
  async (opts) => {
6086
6404
  const config = loadConfig(getProfileName());
@@ -6093,7 +6411,8 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
6093
6411
  taskId: opts.task,
6094
6412
  spaceId: opts.space,
6095
6413
  listId: opts.list,
6096
- assigneeId: opts.assignee
6414
+ assigneeId: opts.assignee,
6415
+ all: opts.all
6097
6416
  });
6098
6417
  if (shouldOutputJson(opts.json ?? false)) {
6099
6418
  console.log(JSON.stringify(entries, null, 2));
@@ -6254,6 +6573,18 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
6254
6573
  }
6255
6574
  })
6256
6575
  );
6576
+ function outputBulkResult(result, forceJson, operation) {
6577
+ if (shouldOutputJson(forceJson)) {
6578
+ console.log(JSON.stringify(result, null, 2));
6579
+ } else {
6580
+ console.log(
6581
+ `${operation}: ${result.updated} updated${result.failed.length > 0 ? `, ${result.failed.length} failed` : ""}`
6582
+ );
6583
+ for (const f of result.failed) {
6584
+ console.error(` ${f.id}: ${f.reason}`);
6585
+ }
6586
+ }
6587
+ }
6257
6588
  const bulkCmd = program.command("bulk").description("Bulk task operations");
6258
6589
  bulkCmd.command("status <status> <taskIds...>").description("Update status of multiple tasks").option("--json", "Force JSON output even in terminal").action(
6259
6590
  wrapAction(async (status, taskIds, opts) => {
@@ -6271,6 +6602,38 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
6271
6602
  }
6272
6603
  })
6273
6604
  );
6605
+ bulkCmd.command("assign <taskIds...>").description("Bulk assign or unassign a user from tasks").option("--to <userId>", 'Add this user (user ID or "me")').option("--remove <userId>", 'Remove this user (user ID or "me")').option("--json", "Force JSON output even in terminal").action(
6606
+ wrapAction(
6607
+ async (taskIds, opts) => {
6608
+ if (!opts.to && !opts.remove)
6609
+ throw new Error("Provide --to <userId> or --remove <userId>");
6610
+ if (opts.to && opts.remove) throw new Error("Cannot use --to and --remove together");
6611
+ const config = loadConfig(getProfileName());
6612
+ const userId = opts.to ?? opts.remove;
6613
+ const action = opts.remove ? "remove" : "add";
6614
+ const result = await bulkAssign(config, userId, taskIds, action);
6615
+ outputBulkResult(result, opts.json ?? false, `assign ${action}`);
6616
+ }
6617
+ )
6618
+ );
6619
+ bulkCmd.command("due-date <date> <taskIds...>").description('Bulk set due date on tasks (use "none" to clear)').option("--json", "Force JSON output even in terminal").action(
6620
+ wrapAction(async (date, taskIds, opts) => {
6621
+ const config = loadConfig(getProfileName());
6622
+ const result = await bulkDueDate(config, date, taskIds);
6623
+ outputBulkResult(result, opts.json ?? false, "due-date");
6624
+ })
6625
+ );
6626
+ bulkCmd.command("tag <tagName> <taskIds...>").description("Bulk add or remove a tag on tasks").option("--add", "Add tag (default)").option("--remove", "Remove tag instead of adding").option("--json", "Force JSON output even in terminal").action(
6627
+ wrapAction(
6628
+ async (tagName, taskIds, opts) => {
6629
+ if (opts.add && opts.remove) throw new Error("Cannot use --add and --remove together");
6630
+ const action = opts.remove ? "remove" : "add";
6631
+ const config = loadConfig(getProfileName());
6632
+ const result = await bulkTag(config, tagName, taskIds, action);
6633
+ outputBulkResult(result, opts.json ?? false, `tag ${action}`);
6634
+ }
6635
+ )
6636
+ );
6274
6637
  program.command("goals").description("List goals in your workspace").option("--json", "Force JSON output even in terminal").action(
6275
6638
  wrapAction(async (opts) => {
6276
6639
  const config = loadConfig(getProfileName());
@@ -6466,17 +6829,24 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
6466
6829
  }
6467
6830
  })
6468
6831
  );
6469
- program.command("list-create <spaceId> <name>").description("Create a new list in a space").option("--folder <folderId>", "Create the list inside a folder").option("--json", "Force JSON output even in terminal").action(
6832
+ program.command("list-create <spaceId> <name>").description("Create a new list in a space").option("--folder <folderId>", "Create the list inside a folder").option("--copy-statuses-from <id>", "Copy status set from this list or space ID").option("--json", "Force JSON output even in terminal").action(
6470
6833
  wrapAction(
6471
6834
  async (spaceId, name, opts) => {
6472
6835
  if (!name.trim()) throw new Error("List name cannot be empty");
6473
6836
  const config = loadConfig(getProfileName());
6474
- const client = new ClickUpClient(config);
6475
- const list = opts.folder ? await client.createFolderList(opts.folder, name) : await client.createList(spaceId, name);
6837
+ const result = await createListWithOptions(config, spaceId, name, {
6838
+ folder: opts.folder,
6839
+ copyStatusesFrom: opts.copyStatusesFrom
6840
+ });
6476
6841
  if (shouldOutputJson(opts.json ?? false)) {
6477
- console.log(JSON.stringify(list, null, 2));
6842
+ console.log(JSON.stringify(result, null, 2));
6478
6843
  } else {
6479
- console.log(`Created list "${list.name}" (${list.id})`);
6844
+ console.log(`Created list "${result.name}" (${result.id})`);
6845
+ if (result.statusesCopied) {
6846
+ console.log(
6847
+ ` Copied ${result.statusesCopied} statuses from ${opts.copyStatusesFrom}`
6848
+ );
6849
+ }
6480
6850
  }
6481
6851
  }
6482
6852
  )
@@ -6724,6 +7094,77 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
6724
7094
  }
6725
7095
  })
6726
7096
  );
7097
+ const filterCmd = program.command("filter").description("Manage saved command shortcuts");
7098
+ filterCmd.command("save <name> [args...]").description("Save a command shortcut").option("-d, --description <text>", "Description for this filter").option("--json", "Force JSON output even in terminal").action(
7099
+ wrapAction(
7100
+ async (name, args, opts) => {
7101
+ if (args.length === 0) {
7102
+ throw new Error(
7103
+ 'Provide a command to save, e.g.: cup filter save my-sprint tasks --status "in progress"'
7104
+ );
7105
+ }
7106
+ if (!isAllowedFilterCommand(args)) {
7107
+ throw new Error(
7108
+ `Command "${args[0]}" is not allowed in saved filters. Allowed: tasks, search, sprint, assigned, overdue, inbox, summary, views, lists, spaces, folders, members, tags, goals, key-results, task-types, templates, list-templates, folder-templates, docs, time list`
7109
+ );
7110
+ }
7111
+ const entry = { command: args };
7112
+ if (opts.description) entry.description = opts.description;
7113
+ saveFilter(name, entry, getProfileName());
7114
+ if (shouldOutputJson(opts.json ?? false)) {
7115
+ console.log(JSON.stringify({ name, ...entry }, null, 2));
7116
+ } else {
7117
+ console.log(`Saved filter "${name}": ${args.join(" ")}`);
7118
+ }
7119
+ }
7120
+ )
7121
+ );
7122
+ filterCmd.command("run <name>").description("Run a saved command shortcut").action(
7123
+ wrapAction(async (name) => {
7124
+ const filters = getFilters(getProfileName());
7125
+ const entry = filters[name];
7126
+ if (!entry) {
7127
+ throw new Error(`Filter "${name}" not found. Use: cup filter list`);
7128
+ }
7129
+ runFilter(name, entry);
7130
+ })
7131
+ );
7132
+ filterCmd.command("list").description("List all saved command shortcuts").option("--json", "Force JSON output even in terminal").action(
7133
+ wrapAction(async (opts) => {
7134
+ const filters = getFilters(getProfileName());
7135
+ if (shouldOutputJson(opts.json ?? false)) {
7136
+ console.log(JSON.stringify(filters, null, 2));
7137
+ } else if (isTTY()) {
7138
+ console.log(formatFiltersTable(filters));
7139
+ } else {
7140
+ console.log(formatFiltersMarkdown(filters));
7141
+ }
7142
+ })
7143
+ );
7144
+ filterCmd.command("delete <name>").description("Delete a saved command shortcut").option("--json", "Force JSON output even in terminal").action(
7145
+ wrapAction(async (name, opts) => {
7146
+ deleteFilter(name, getProfileName());
7147
+ if (shouldOutputJson(opts.json ?? false)) {
7148
+ console.log(JSON.stringify({ success: true, name }, null, 2));
7149
+ } else {
7150
+ console.log(`Deleted filter "${name}"`);
7151
+ }
7152
+ })
7153
+ );
7154
+ filterCmd.command("show <name>").description("Show details of a saved command shortcut").option("--json", "Force JSON output even in terminal").action(
7155
+ wrapAction(async (name, opts) => {
7156
+ const filters = getFilters(getProfileName());
7157
+ const entry = filters[name];
7158
+ if (!entry) {
7159
+ throw new Error(`Filter "${name}" not found. Use: cup filter list`);
7160
+ }
7161
+ if (shouldOutputJson(opts.json ?? false)) {
7162
+ console.log(JSON.stringify({ name, ...entry }, null, 2));
7163
+ } else {
7164
+ console.log(formatFilterDetail(name, entry));
7165
+ }
7166
+ })
7167
+ );
6727
7168
  const profileCmd = program.command("profile").description("Manage profiles");
6728
7169
  profileCmd.command("list").description("List all profiles").option("--json", "Force JSON output even in terminal").action(
6729
7170
  wrapAction(async (opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krodak/clickup-cli",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "ClickUp CLI for AI agents and humans",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: clickup
3
- description: 'Use when managing ClickUp tasks, sprints, or comments via the `cup` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, threaded replies, 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, task links, time tracking, attachments, file uploads, listing members, listing fields, duplicating tasks, bulk operations, goals, key results.'
3
+ description: 'Use when managing ClickUp tasks, sprints, or comments via the `cup` CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, threaded replies, 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, task links, time tracking, attachments, file uploads, listing members, listing fields, duplicating tasks, bulk operations, goals, key results, saved filters.'
4
4
  ---
5
5
 
6
6
  # ClickUp CLI (`cup`)
@@ -15,6 +15,21 @@ Multiple profiles supported - use `cup profile add <name>` to create, `cup profi
15
15
 
16
16
  Environment variables `CU_API_TOKEN` and `CU_TEAM_ID` override config file when both are set. `CU_PROFILE` selects a profile (overridden by `-p` flag).
17
17
 
18
+ ## Saved Filters (Quick Shortcuts)
19
+
20
+ At the start of each session, run `cup filter list` to discover saved shortcuts for this workspace.
21
+
22
+ | Command | What it does |
23
+ | -------------------------------------------------- | ---------------------------------------------------------------- |
24
+ | `cup filter list [--json]` | List all saved shortcuts with commands and descriptions |
25
+ | `cup filter run <name>` | Execute a saved shortcut (identical to running the full command) |
26
+ | `cup filter save <name> <cmd> [args...] [-d desc]` | Save a command shortcut |
27
+ | `cup filter delete <name>` | Remove a shortcut |
28
+ | `cup filter show <name> [--json]` | Show a single shortcut's details |
29
+
30
+ Example: `cup filter save sprint-tasks tasks --status "in progress" --list l1 -d "Current sprint tasks"`
31
+ Then: `cup filter run sprint-tasks` is equivalent to `cup tasks --status "in progress" --list l1`
32
+
18
33
  ## Output Modes
19
34
 
20
35
  | Context | Default output | Override |
@@ -69,66 +84,69 @@ All commands support `--help` for full flag details. All commands support `--jso
69
84
 
70
85
  ### Write
71
86
 
72
- | Command | What it does |
73
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
74
- | `cup create -n name [-l listId] [-p parentId] [-d desc] [-s status] [--priority p] [--due-date d] [--start-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\|none] [--start-date d] [--time-estimate t] [--assignee id\|me] [--parent id] [--detach] [--archive] [--unarchive] [--field "Name" val]` | Update task fields (including custom fields) |
76
- | `cup comment <id> -m text [--notify-all]` | Post comment on task |
77
- | `cup comment-edit <commentId> -m text [--resolved] [--unresolved]` | Edit a comment |
78
- | `cup comment-delete <commentId>` | Delete a comment |
79
- | `cup replies <commentId>` | List threaded replies |
80
- | `cup reply <commentId> -m text [--notify-all]` | Reply to a comment |
81
- | `cup assign <id> [--to userId\|me] [--remove userId\|me]` | Assign/unassign users |
82
- | `cup depend <id> [--on taskId] [--blocks taskId] [--remove]` | Add/remove dependencies |
83
- | `cup move <id> [--to listId] [--remove listId]` | Add/remove task from lists |
84
- | `cup field <id> [--set "Name" value] [--remove "Name"]` | Set/remove custom field values |
85
- | `cup field-create <name> -t <type> [-d desc] [--options "a,b,c"] [--required]` | Create a custom field |
86
- | `cup tag <id> [--add tags] [--remove tags]` | Add/remove tags on a task |
87
- | `cup link <taskId> <linksTo> [--remove]` | Link/unlink tasks |
88
- | `cup attach <taskId> <filePath>` | Upload file attachment |
89
- | `cup delete <id> [--confirm]` | Delete task (DESTRUCTIVE) |
90
- | `cup duplicate <taskId>` | Duplicate a task |
91
- | `cup bulk status <status> <taskIds...>` | Bulk update status |
92
- | `cup checklist view <id>` | View checklists on a task |
93
- | `cup checklist create <id> <name>` | Create a checklist |
94
- | `cup checklist delete <checklistId>` | Delete a checklist |
95
- | `cup checklist add-item <checklistId> <name>` | Add item to checklist |
96
- | `cup checklist edit-item <checklistId> <itemId> [--name n] [--resolved] [--unresolved] [--assignee id]` | Edit checklist item |
97
- | `cup checklist delete-item <checklistId> <itemId>` | Delete checklist item |
98
- | `cup time start <taskId> [-d desc]` | Start timer |
99
- | `cup time stop` | Stop running timer |
100
- | `cup time status` | Show running timer |
101
- | `cup time log <taskId> <duration> [-d desc]` | Log manual entry (e.g. "2h", "30m") |
102
- | `cup time list [--days n] [--task id]` | List recent time entries |
103
- | `cup time update <timeEntryId> [-d desc] [--duration dur]` | Update time entry |
104
- | `cup time delete <timeEntryId>` | Delete time entry |
105
- | `cup goal-create <name> [-d desc] [--color hex]` | Create a goal |
106
- | `cup goal-update <goalId> [-n name] [-d desc] [--color hex]` | Update a goal |
107
- | `cup goal-delete <goalId>` | Delete a goal |
108
- | `cup key-result-create <goalId> <name> [--type t] [--target n]` | Create key result |
109
- | `cup key-result-update <keyResultId> [--progress n] [--note text]` | Update key result |
110
- | `cup key-result-delete <keyResultId>` | Delete key result |
111
- | `cup doc-create <title> [-c content]` | Create a doc |
112
- | `cup doc-page-create <docId> <name> [-c content] [--parent-page pageId]` | Create doc page |
113
- | `cup doc-page-edit <docId> <pageId> [--name text] [-c content]` | Edit doc page |
114
- | `cup doc-delete <docId>` | Delete a doc |
115
- | `cup doc-page-delete <docId> <pageId>` | Delete doc page |
116
- | `cup space-create <name>` | Create a space |
117
- | `cup list-create <spaceId> <name> [--folder folderId]` | Create a list in a space or folder |
118
- | `cup folder-create <spaceId> <name>` | Create a folder in a space |
119
- | `cup tag-create <spaceId> <name> [--fg color] [--bg color]` | Create space tag |
120
- | `cup tag-update <spaceId> <tagName> --name <newName> [--fg c] [--bg c]` | Update space tag |
121
- | `cup tag-delete <spaceId> <name>` | Delete space tag |
122
- | `cup list-from-template <name> --template <id> [--space id] [--folder id]` | Create list from template |
123
- | `cup view-create <listId> <name> -t <type> [--group-by field]` | Create a view on a list |
124
- | `cup view-update <viewId> [-n name] [--group-by field]` | Update a view |
125
- | `cup view-delete <viewId> [--confirm]` | Delete a view (DESTRUCTIVE) |
126
- | `cup profile list [--json]` | List all profiles |
127
- | `cup profile add <name>` | Add a new profile (interactive) |
128
- | `cup profile remove <name>` | Remove a profile |
129
- | `cup profile use <name>` | Set the default profile |
130
- | `cup config get <key>` / `set <key> <value>` / `path` | Manage config |
131
- | `cup completion <shell>` | Shell completions (bash/zsh/fish) |
87
+ | Command | What it does |
88
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
89
+ | `cup create -n name [-l listId] [-p parentId] [-d desc] [-s status] [--priority p] [--due-date d] [--start-date d] [--time-estimate t] [--assignee id\|me] [--tags t] [--custom-item-id n] [--template id]` | Create task |
90
+ | `cup update <id> [-n name] [-d desc] [-s status] [--priority p] [--due-date d\|none] [--start-date d] [--time-estimate t] [--assignee id\|me] [--remove-assignee id\|me] [--parent id] [--detach] [--archive] [--unarchive] [--field "Name" val]` | Update task fields (including custom fields) |
91
+ | `cup comment <id> -m text [--notify-all]` | Post comment on task |
92
+ | `cup comment-edit <commentId> -m text [--resolved] [--unresolved]` | Edit a comment |
93
+ | `cup comment-delete <commentId>` | Delete a comment |
94
+ | `cup replies <commentId>` | List threaded replies |
95
+ | `cup reply <commentId> -m text [--notify-all]` | Reply to a comment |
96
+ | `cup assign <id> [--to userId\|me] [--remove userId\|me]` | Assign/unassign users |
97
+ | `cup depend <id> [--on taskId] [--blocks taskId] [--remove]` | Add/remove dependencies |
98
+ | `cup move <id> [--to listId] [--remove listId]` | Add/remove task from lists |
99
+ | `cup field <id> [--set "Name" value] [--remove "Name"]` | Set/remove custom field values |
100
+ | `cup field-create <name> -t <type> [-d desc] [--options "a,b,c"] [--required]` | Create a custom field |
101
+ | `cup tag <id> [--add tags] [--remove tags]` | Add/remove tags on a task |
102
+ | `cup link <taskId> <linksTo> [--remove]` | Link/unlink tasks |
103
+ | `cup attach <taskId> <filePath>` | Upload file attachment |
104
+ | `cup delete <id> [--confirm]` | Delete task (DESTRUCTIVE) |
105
+ | `cup duplicate <taskId>` | Duplicate a task |
106
+ | `cup bulk status <status> <taskIds...>` | Bulk update status |
107
+ | `cup bulk assign <taskIds...> [--to userId\|me] [--remove userId\|me]` | Bulk assign/unassign user from tasks |
108
+ | `cup bulk due-date <date\|none\|clear> <taskIds...>` | Bulk set or clear due dates |
109
+ | `cup bulk tag <tagName> <taskIds...> [--add] [--remove]` | Bulk add/remove tag from tasks |
110
+ | `cup checklist view <id>` | View checklists on a task |
111
+ | `cup checklist create <id> <name>` | Create a checklist |
112
+ | `cup checklist delete <checklistId>` | Delete a checklist |
113
+ | `cup checklist add-item <checklistId> <name>` | Add item to checklist |
114
+ | `cup checklist edit-item <checklistId> <itemId> [--name n] [--resolved] [--unresolved] [--assignee id]` | Edit checklist item |
115
+ | `cup checklist delete-item <checklistId> <itemId>` | Delete checklist item |
116
+ | `cup time start <taskId> [-d desc]` | Start timer |
117
+ | `cup time stop` | Stop running timer |
118
+ | `cup time status` | Show running timer |
119
+ | `cup time log <taskId> <duration> [-d desc]` | Log manual entry (e.g. "2h", "30m") |
120
+ | `cup time list [--days n] [--task id] [--all]` | List my recent time entries (--all for team) |
121
+ | `cup time update <timeEntryId> [-d desc] [--duration dur]` | Update time entry |
122
+ | `cup time delete <timeEntryId>` | Delete time entry |
123
+ | `cup goal-create <name> [-d desc] [--color hex]` | Create a goal |
124
+ | `cup goal-update <goalId> [-n name] [-d desc] [--color hex]` | Update a goal |
125
+ | `cup goal-delete <goalId>` | Delete a goal |
126
+ | `cup key-result-create <goalId> <name> [--type t] [--target n]` | Create key result |
127
+ | `cup key-result-update <keyResultId> [--progress n] [--note text]` | Update key result |
128
+ | `cup key-result-delete <keyResultId>` | Delete key result |
129
+ | `cup doc-create <title> [-c content]` | Create a doc |
130
+ | `cup doc-page-create <docId> <name> [-c content] [--parent-page pageId]` | Create doc page |
131
+ | `cup doc-page-edit <docId> <pageId> [--name text] [-c content]` | Edit doc page |
132
+ | `cup doc-delete <docId>` | Delete a doc |
133
+ | `cup doc-page-delete <docId> <pageId>` | Delete doc page |
134
+ | `cup space-create <name>` | Create a space |
135
+ | `cup list-create <spaceId> <name> [--folder folderId] [--copy-statuses-from id]` | Create a list in a space or folder |
136
+ | `cup folder-create <spaceId> <name>` | Create a folder in a space |
137
+ | `cup tag-create <spaceId> <name> [--fg color] [--bg color]` | Create space tag |
138
+ | `cup tag-update <spaceId> <tagName> --name <newName> [--fg c] [--bg c]` | Update space tag |
139
+ | `cup tag-delete <spaceId> <name>` | Delete space tag |
140
+ | `cup list-from-template <name> --template <id> [--space id] [--folder id]` | Create list from template |
141
+ | `cup view-create <listId> <name> -t <type> [--group-by field]` | Create a view on a list |
142
+ | `cup view-update <viewId> [-n name] [--group-by field]` | Update a view |
143
+ | `cup view-delete <viewId> [--confirm]` | Delete a view (DESTRUCTIVE) |
144
+ | `cup profile list [--json]` | List all profiles |
145
+ | `cup profile add <name>` | Add a new profile (interactive) |
146
+ | `cup profile remove <name>` | Remove a profile |
147
+ | `cup profile use <name>` | Set the default profile |
148
+ | `cup config get <key>` / `set <key> <value>` / `path` | Manage config |
149
+ | `cup completion <shell>` | Shell completions (bash/zsh/fish) |
132
150
 
133
151
  ## Global Flags
134
152