@krodak/clickup-cli 1.9.2 → 1.10.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.9.2",
4
+ "version": "1.10.0",
5
5
  "author": {
6
6
  "name": "Krzysztof Rodak"
7
7
  },
package/dist/index.js CHANGED
@@ -2840,6 +2840,14 @@ var commandMetadata = [
2840
2840
  { section: "read", usage: "overdue", description: "Tasks past their due date" }
2841
2841
  ]
2842
2842
  },
2843
+ {
2844
+ name: "archive",
2845
+ description: "Archive a task (or unarchive with --unarchive)",
2846
+ flags: ["--unarchive", "--confirm", "--json"],
2847
+ quickReference: [
2848
+ { section: "write", usage: "archive <taskId>", description: "Archive or unarchive a task" }
2849
+ ]
2850
+ },
2843
2851
  {
2844
2852
  name: "assign",
2845
2853
  description: "Assign or unassign users from a task",
@@ -4310,6 +4318,27 @@ async function deleteTaskCommand(config, taskId, opts) {
4310
4318
  return { taskId, deleted: true };
4311
4319
  }
4312
4320
 
4321
+ // src/commands/archive.ts
4322
+ async function archiveTaskCommand(config, taskId, opts) {
4323
+ const client = new ClickUpClient(config);
4324
+ if (!opts.confirm) {
4325
+ if (!isTTY()) {
4326
+ throw new Error(`Destructive operation requires --confirm flag in non-interactive mode`);
4327
+ }
4328
+ const task = await client.getTask(taskId);
4329
+ const { confirm: confirm3 } = await import("@inquirer/prompts");
4330
+ const confirmed = await confirm3({
4331
+ message: `${opts.unarchive ? "Unarchive" : "Archive"} task "${task.name}" (${task.id})?`,
4332
+ default: false
4333
+ });
4334
+ if (!confirmed) {
4335
+ throw new Error("Cancelled");
4336
+ }
4337
+ }
4338
+ await client.updateTask(taskId, { archived: !opts.unarchive });
4339
+ return { taskId, archived: !opts.unarchive };
4340
+ }
4341
+
4313
4342
  // src/commands/tag.ts
4314
4343
  function parseTags(input) {
4315
4344
  return input.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
@@ -5291,6 +5320,19 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
5291
5320
  }
5292
5321
  })
5293
5322
  );
5323
+ program.command("archive <taskId>").description("Archive a task (or unarchive with --unarchive)").option("--unarchive", "Unarchive instead of archiving").option("--confirm", "Skip confirmation prompt (required in non-interactive mode)").option("--json", "Force JSON output even in terminal").action(
5324
+ wrapAction(
5325
+ async (taskId, opts) => {
5326
+ const config = loadConfig(getProfileName());
5327
+ const result = await archiveTaskCommand(config, taskId, opts);
5328
+ if (shouldOutputJson(opts.json ?? false)) {
5329
+ console.log(JSON.stringify(result, null, 2));
5330
+ } else {
5331
+ console.log(`${result.archived ? "Archived" : "Unarchived"} task ${result.taskId}`);
5332
+ }
5333
+ }
5334
+ )
5335
+ );
5294
5336
  program.command("tag <taskId>").description("Add or remove tags from a task").option("--add <tags>", "Comma-separated tag names to add").option("--remove <tags>", "Comma-separated tag names to remove").option("--json", "Force JSON output even in terminal").action(
5295
5337
  wrapAction(
5296
5338
  async (taskId, opts) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krodak/clickup-cli",
3
- "version": "1.9.2",
3
+ "version": "1.10.0",
4
4
  "description": "ClickUp CLI for AI agents and humans",
5
5
  "type": "module",
6
6
  "license": "MIT",