@krodak/clickup-cli 1.8.0 → 1.9.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.8.0",
4
+ "version": "1.9.0",
5
5
  "author": {
6
6
  "name": "Krzysztof Rodak"
7
7
  },
package/dist/index.js CHANGED
@@ -698,10 +698,17 @@ var ClickUpClient = class {
698
698
  });
699
699
  }
700
700
  async createCustomField(teamId, name, type, opts) {
701
+ const typeConfig = {};
702
+ if (opts?.options?.length) {
703
+ typeConfig.options = opts.options.map((optName, i) => ({
704
+ name: optName,
705
+ orderindex: i
706
+ }));
707
+ }
701
708
  const body = {
702
709
  name,
703
710
  type,
704
- type_config: {},
711
+ type_config: typeConfig,
705
712
  description: opts?.description ?? "",
706
713
  required: opts?.required ?? false,
707
714
  pinned: false,
@@ -3118,7 +3125,7 @@ var commandMetadata = [
3118
3125
  {
3119
3126
  name: "field-create",
3120
3127
  description: "Create a custom field in your workspace",
3121
- flags: ["-t", "--type", "-d", "--description", "--required", "--json"],
3128
+ flags: ["-t", "--type", "-d", "--description", "--options", "--required", "--json"],
3122
3129
  quickReference: [
3123
3130
  {
3124
3131
  section: "write",
@@ -5541,7 +5548,7 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
5541
5548
  program.command("field-create <name>").description("Create a custom field in your workspace").requiredOption(
5542
5549
  "-t, --type <type>",
5543
5550
  "Field type (text, number, date, checkbox, drop_down, labels, email, phone, url, currency, short_text)"
5544
- ).option("-d, --description <text>", "Field description").option("--required", "Make the field required").option("--json", "Force JSON output even in terminal").action(
5551
+ ).option("-d, --description <text>", "Field description").option("--options <items>", "Comma-separated options for drop_down or labels types").option("--required", "Make the field required").option("--json", "Force JSON output even in terminal").action(
5545
5552
  wrapAction(
5546
5553
  async (name, opts) => {
5547
5554
  if (!name.trim()) throw new Error("Field name cannot be empty");
@@ -5565,9 +5572,16 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
5565
5572
  }
5566
5573
  const config = loadConfig(getProfileName());
5567
5574
  const client = new ClickUpClient(config);
5575
+ const options = opts.options ? opts.options.split(",").map((o) => o.trim()).filter(Boolean) : void 0;
5576
+ if ((opts.type === "drop_down" || opts.type === "labels") && !options?.length) {
5577
+ throw new Error(
5578
+ `--options is required for ${opts.type} fields (comma-separated values)`
5579
+ );
5580
+ }
5568
5581
  const field = await client.createCustomField(config.teamId, name, opts.type, {
5569
5582
  description: opts.description,
5570
- required: opts.required
5583
+ required: opts.required,
5584
+ options
5571
5585
  });
5572
5586
  if (shouldOutputJson(opts.json ?? false)) {
5573
5587
  console.log(JSON.stringify(field, null, 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krodak/clickup-cli",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "ClickUp CLI for AI agents and humans",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -78,7 +78,7 @@ All commands support `--help` for full flag details. All commands support `--jso
78
78
  | `cup depend <id> [--on taskId] [--blocks taskId] [--remove]` | Add/remove dependencies |
79
79
  | `cup move <id> [--to listId] [--remove listId]` | Add/remove task from lists |
80
80
  | `cup field <id> [--set "Name" value] [--remove "Name"]` | Set/remove custom field values |
81
- | `cup field-create <name> -t <type> [-d desc] [--required]` | Create a custom field |
81
+ | `cup field-create <name> -t <type> [-d desc] [--options "a,b,c"] [--required]` | Create a custom field |
82
82
  | `cup tag <id> [--add tags] [--remove tags]` | Add/remove tags on a task |
83
83
  | `cup link <taskId> <linksTo> [--remove]` | Link/unlink tasks |
84
84
  | `cup attach <taskId> <filePath>` | Upload file attachment |
@@ -147,6 +147,7 @@ All commands support `--help` for full flag details. All commands support `--jso
147
147
  | `--include-closed` | Include closed/done tasks |
148
148
  | `--list` on create | Optional when `--parent` is given (auto-detected) |
149
149
  | `cup field --set` | Supports: text, number, checkbox (true/false), dropdown (option name), date (YYYY-MM-DD), url, email. Names resolved case-insensitively; errors list available fields/options |
150
+ | `cup field-create` | Use `--options "a,b,c"` for `drop_down` and `labels` types (required). Other types don't need `--options` |
150
151
  | `cup sprint` | Auto-detects active sprint by folder name (sprint/iteration/cycle/scrum), parses multiple date formats. Override with `--folder <id>` or `cup config set sprintFolderId <id>` |
151
152
  | `cup link` | Both IDs must be the same type (both custom or both native) |
152
153
  | `cup delete` | DESTRUCTIVE. Requires `--confirm` in non-interactive mode. Cannot be undone |