@krodak/clickup-cli 1.22.0 → 1.22.2

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.22.0",
4
+ "version": "1.22.2",
5
5
  "author": {
6
6
  "name": "Krzysztof Rodak"
7
7
  },
package/README.md CHANGED
@@ -16,13 +16,24 @@ npm install -g @krodak/clickup-cli && cup init
16
16
 
17
17
  ## For AI Agents
18
18
 
19
- Paste this into any AI agent to get started immediately:
19
+ Paste this into any AI agent (Claude Code, Codex, Cursor, OpenCode, etc.):
20
20
 
21
21
  ```
22
- Fetch and follow instructions from https://raw.githubusercontent.com/krodak/clickup-cli/main/skills/clickup-cli/SKILL.md
22
+ Install and configure the ClickUp CLI for me. Fetch the setup guide from:
23
+ https://raw.githubusercontent.com/krodak/clickup-cli/main/skills/clickup-cli/SKILL.md
24
+
25
+ Then walk me through installing the CLI, getting a ClickUp API token,
26
+ and running cup init. Finally, install the skill with `cup skill` so
27
+ you have persistent access to the full command reference.
23
28
  ```
24
29
 
25
- Or install the skill permanently with `cup skill` (see [Set up your agent](#set-up-your-agent) below).
30
+ The fetched SKILL.md contains everything the agent needs: install commands,
31
+ where to get a ClickUp API token, non-interactive setup with `cup init --token --team`,
32
+ and the complete command reference. After setup, the agent can run any `cup` command
33
+ to manage your tasks, sprints, comments, time tracking, and more.
34
+
35
+ **Already have the CLI installed?** Just run `cup skill` to install the agent skill to
36
+ all detected locations (see [Set up your agent](#set-up-your-agent) below).
26
37
 
27
38
  ## Talk to your agent
28
39
 
package/dist/index.js CHANGED
@@ -1021,7 +1021,9 @@ function loadConfig(profileName) {
1021
1021
  if (envToken || envTeamId) {
1022
1022
  throw new Error("Both CU_API_TOKEN and CU_TEAM_ID must be set, or run: cup init");
1023
1023
  }
1024
- throw new Error("Config missing required field: apiToken.\nSet CU_API_TOKEN or run: cup init");
1024
+ throw new Error(
1025
+ "No ClickUp CLI configuration found.\n\nTo get started:\n cup init\n\nFor scripts or AI agents:\n cup init --token pk_YOUR_TOKEN --team YOUR_TEAM_ID\n\nGet your API token: https://app.clickup.com/settings/apps"
1026
+ );
1025
1027
  }
1026
1028
  const { parsed } = parseRawConfig(path);
1027
1029
  if (isOldFormat(parsed)) {
@@ -2065,31 +2067,75 @@ async function getTask(config, taskId) {
2065
2067
  // src/commands/init.ts
2066
2068
  import { password, select, confirm as confirm2 } from "@inquirer/prompts";
2067
2069
  import fs2 from "fs";
2070
+ var TOKEN_URL = "https://app.clickup.com/settings/apps";
2071
+ var TOKEN_HELP = `
2072
+ How to get a ClickUp API token:
2073
+ 1. Open ${TOKEN_URL}
2074
+ 2. Find the "API Token" section, click "Generate" (or copy the existing one)
2075
+ 3. The token starts with "pk_"
2076
+ `;
2077
+ var NON_TTY_HELP = `cup init requires an interactive terminal.
2078
+
2079
+ For scripts, CI, or AI agents, use flags:
2080
+ cup init --token pk_YOUR_TOKEN --team YOUR_TEAM_ID
2081
+
2082
+ Or set environment variables:
2083
+ export CU_API_TOKEN=pk_YOUR_TOKEN
2084
+ export CU_TEAM_ID=YOUR_TEAM_ID
2085
+ ${TOKEN_HELP}`;
2086
+ var NEXT_STEPS = `
2087
+ Next steps:
2088
+ cup auth # verify setup
2089
+ cup tasks # list your assigned tasks
2090
+ cup sprint # show current sprint
2091
+ cup --help # see all commands
2092
+ `;
2093
+ function validateTokenFormat(token) {
2094
+ if (!token.startsWith("pk_")) {
2095
+ throw new Error(
2096
+ `Invalid token format. Personal API tokens start with "pk_".
2097
+ ${TOKEN_HELP}`
2098
+ );
2099
+ }
2100
+ }
2101
+ async function verifyToken(apiToken) {
2102
+ const client = new ClickUpClient({ apiToken });
2103
+ try {
2104
+ const me = await client.getMe();
2105
+ return me.username;
2106
+ } catch (err) {
2107
+ const msg = err instanceof Error ? err.message : String(err);
2108
+ throw new Error(
2109
+ `Token verification failed: ${msg}
2110
+
2111
+ Check the token is correct and not expired.
2112
+ ${TOKEN_HELP}`,
2113
+ { cause: err }
2114
+ );
2115
+ }
2116
+ }
2068
2117
  async function runInitCommand(opts) {
2069
2118
  if (opts?.token && opts?.team) {
2070
2119
  const apiToken2 = opts.token.trim();
2071
- if (!apiToken2.startsWith("pk_")) throw new Error("Token must start with pk_");
2072
- const client2 = new ClickUpClient({ apiToken: apiToken2 });
2073
- let username2;
2074
- try {
2075
- const me = await client2.getMe();
2076
- username2 = me.username;
2077
- } catch (err) {
2078
- throw new Error(`Invalid token: ${err instanceof Error ? err.message : String(err)}`, {
2079
- cause: err
2080
- });
2081
- }
2120
+ validateTokenFormat(apiToken2);
2121
+ const username2 = await verifyToken(apiToken2);
2082
2122
  process.stdout.write(`Authenticated as @${username2}
2083
2123
  `);
2084
2124
  writeConfig({ apiToken: apiToken2, teamId: opts.team });
2085
2125
  process.stdout.write(`Config written to ${getConfigPath()}
2086
- `);
2126
+ ${NEXT_STEPS}`);
2087
2127
  return;
2088
2128
  }
2089
2129
  if (opts?.token || opts?.team) {
2090
2130
  throw new Error("Both --token and --team are required for non-interactive setup");
2091
2131
  }
2132
+ if (!process.stdin.isTTY) {
2133
+ throw new Error(NON_TTY_HELP);
2134
+ }
2092
2135
  const configPath3 = getConfigPath();
2136
+ process.stdout.write("\nWelcome to ClickUp CLI!\n");
2137
+ process.stdout.write(TOKEN_HELP);
2138
+ process.stdout.write("\n");
2093
2139
  if (fs2.existsSync(configPath3)) {
2094
2140
  const overwrite = await confirm2({
2095
2141
  message: `Config already exists at ${configPath3}. Overwrite?`,
@@ -2100,20 +2146,14 @@ async function runInitCommand(opts) {
2100
2146
  return;
2101
2147
  }
2102
2148
  }
2103
- const apiToken = (await password({ message: "ClickUp API token (pk_...):" })).trim();
2104
- if (!apiToken.startsWith("pk_")) throw new Error("Token must start with pk_");
2105
- const client = new ClickUpClient({ apiToken });
2106
- let username;
2107
- try {
2108
- const me = await client.getMe();
2109
- username = me.username;
2110
- } catch (err) {
2111
- throw new Error(`Invalid token: ${err instanceof Error ? err.message : String(err)}`, {
2112
- cause: err
2113
- });
2114
- }
2149
+ const apiToken = (await password({
2150
+ message: "Paste your ClickUp API token (starts with pk_):"
2151
+ })).trim();
2152
+ validateTokenFormat(apiToken);
2153
+ const username = await verifyToken(apiToken);
2115
2154
  process.stdout.write(`Authenticated as @${username}
2116
2155
  `);
2156
+ const client = new ClickUpClient({ apiToken });
2117
2157
  const teams = await client.getTeams();
2118
2158
  if (teams.length === 0) throw new Error("No workspaces found for this token.");
2119
2159
  let teamId;
@@ -2130,8 +2170,9 @@ async function runInitCommand(opts) {
2130
2170
  });
2131
2171
  }
2132
2172
  writeConfig({ apiToken, teamId });
2133
- process.stdout.write(`Config written to ${configPath3}
2134
- `);
2173
+ process.stdout.write(`
2174
+ Config written to ${configPath3}
2175
+ ${NEXT_STEPS}`);
2135
2176
  }
2136
2177
 
2137
2178
  // src/commands/sprint.ts
@@ -3136,9 +3177,15 @@ function printTimeInStatus(result, forceJson) {
3136
3177
  var commandMetadata = [
3137
3178
  {
3138
3179
  name: "init",
3139
- description: "Set up cup for the first time",
3180
+ description: "Set up cup (interactive). Use --token and --team for non-interactive/agent setup",
3140
3181
  flags: ["--token", "--team"],
3141
- quickReference: [{ section: "setup", usage: "init", description: "First-time setup wizard" }]
3182
+ quickReference: [
3183
+ {
3184
+ section: "setup",
3185
+ usage: "init",
3186
+ description: "First-time setup (interactive, or use --token --team for agents)"
3187
+ }
3188
+ ]
3142
3189
  },
3143
3190
  {
3144
3191
  name: "auth",
@@ -4026,7 +4073,7 @@ function parseCommandFlags(flags = []) {
4026
4073
  }
4027
4074
  function commandDescription(command, programName = "cup") {
4028
4075
  if (command.name === "init") {
4029
- return `Set up ${programName} for the first time`;
4076
+ return `Set up ${programName} (interactive). Use --token and --team for non-interactive/agent setup`;
4030
4077
  }
4031
4078
  return command.description;
4032
4079
  }
@@ -6599,7 +6646,9 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
6599
6646
  function getProfileName() {
6600
6647
  return program.opts().profile;
6601
6648
  }
6602
- program.command("init").description(`Set up ${programName} for the first time`).option("--token <token>", "API token (pk_...) for non-interactive setup").option("--team <teamId>", "Workspace/team ID for non-interactive setup").action(
6649
+ program.command("init").description(
6650
+ `Set up ${programName} (interactive). Use --token and --team for non-interactive/agent setup`
6651
+ ).option("--token <token>", "API token (pk_...) for non-interactive setup").option("--team <teamId>", "Workspace/team ID for non-interactive setup").action(
6603
6652
  wrapAction(async (opts) => {
6604
6653
  await runInitCommand(opts);
6605
6654
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krodak/clickup-cli",
3
- "version": "1.22.0",
3
+ "version": "1.22.2",
4
4
  "description": "ClickUp CLI for AI agents and humans",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -3,11 +3,11 @@ name: clickup
3
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, favorites.'
4
4
  ---
5
5
 
6
- # ClickUp CLI (`cup`) - skill version 1.17.0
6
+ # ClickUp CLI (`cup`) - skill version 1.22.2
7
7
 
8
- Reference for AI agents using the `cup` CLI tool. Covers task management, sprint tracking, comments, and project workflows.
8
+ Reference for AI agents using the `cup` CLI tool. Covers task management, sprint tracking, comments, time tracking, custom fields, goals, docs, and project workflows.
9
9
 
10
- > **Version check:** Run `cup --version`. If your installed version is older than 1.18.0, update with `npm install -g @krodak/clickup-cli` and refresh this skill with `cup skill`.
10
+ > **Version check:** Run `cup --version`. If your installed version is older than 1.22.2, update with `npm install -g @krodak/clickup-cli` and refresh this skill with `cup skill`.
11
11
 
12
12
  ## Install & Configure
13
13