@krodak/clickup-cli 1.7.0 → 1.8.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.7.0",
4
+ "version": "1.8.0",
5
5
  "author": {
6
6
  "name": "Krzysztof Rodak"
7
7
  },
package/README.md CHANGED
@@ -150,7 +150,7 @@ Full CRUD for the core ClickUp workflow:
150
150
  | 📄 **Docs** | List, read, create, edit, delete (v3 API) |
151
151
  | ⏱️ **Time Tracking** | Start/stop timer, log entries, list/update/delete history |
152
152
  | ☑️ **Checklists** | View, create, delete, add/edit/delete items |
153
- | 🔧 **Custom Fields** | List, set, remove values (dropdown, date, checkbox, text, etc.) |
153
+ | 🔧 **Custom Fields** | List, create, set, remove values (dropdown, date, checkbox, text, etc.) |
154
154
  | 🏷️ **Tags** | Add/remove on tasks, space-level create/update/delete |
155
155
  | 🎯 **Goals & OKRs** | Goals CRUD, key results CRUD |
156
156
  | 🏃 **Sprints** | Auto-detect active sprint, flexible date parsing, config override |
package/dist/index.js CHANGED
@@ -697,6 +697,27 @@ var ClickUpClient = class {
697
697
  body: JSON.stringify({ name })
698
698
  });
699
699
  }
700
+ async createCustomField(teamId, name, type, opts) {
701
+ const body = {
702
+ name,
703
+ type,
704
+ type_config: {},
705
+ description: opts?.description ?? "",
706
+ required: opts?.required ?? false,
707
+ pinned: false,
708
+ hide_from_guests: false,
709
+ required_on_subtasks: false,
710
+ private: false,
711
+ permission_level: null,
712
+ members: [],
713
+ groups: []
714
+ };
715
+ const data = await this.request(
716
+ `/field?workspace_id=${teamId}`,
717
+ { method: "POST", body: JSON.stringify(body) }
718
+ );
719
+ return data.data;
720
+ }
700
721
  };
701
722
 
702
723
  // src/config.ts
@@ -3094,6 +3115,18 @@ var commandMetadata = [
3094
3115
  { section: "read", usage: "fields <listId>", description: "List custom fields for a list" }
3095
3116
  ]
3096
3117
  },
3118
+ {
3119
+ name: "field-create",
3120
+ description: "Create a custom field in your workspace",
3121
+ flags: ["-t", "--type", "-d", "--description", "--required", "--json"],
3122
+ quickReference: [
3123
+ {
3124
+ section: "write",
3125
+ usage: "field-create <name>",
3126
+ description: "Create a custom field in your workspace"
3127
+ }
3128
+ ]
3129
+ },
3097
3130
  {
3098
3131
  name: "duplicate",
3099
3132
  description: "Duplicate a task",
@@ -3781,6 +3814,14 @@ ${renderZshTopLevelCommands(name)}
3781
3814
  '1:list_id:' \\
3782
3815
  '--json[Force JSON output]'
3783
3816
  ;;
3817
+ field-create)
3818
+ _arguments \\
3819
+ '1:name:' \\
3820
+ '(-t --type)'{-t,--type}'[Field type]:type:(text short_text number date checkbox drop_down labels email phone url currency)' \\
3821
+ '(-d --description)'{-d,--description}'[Field description]:text:' \\
3822
+ '--required[Make the field required]' \\
3823
+ '--json[Force JSON output]'
3824
+ ;;
3784
3825
  duplicate)
3785
3826
  _arguments \\
3786
3827
  '1:task_id:' \\
@@ -5497,6 +5538,45 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
5497
5538
  }
5498
5539
  })
5499
5540
  );
5541
+ program.command("field-create <name>").description("Create a custom field in your workspace").requiredOption(
5542
+ "-t, --type <type>",
5543
+ "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(
5545
+ wrapAction(
5546
+ async (name, opts) => {
5547
+ if (!name.trim()) throw new Error("Field name cannot be empty");
5548
+ const validTypes = [
5549
+ "text",
5550
+ "short_text",
5551
+ "number",
5552
+ "date",
5553
+ "checkbox",
5554
+ "drop_down",
5555
+ "labels",
5556
+ "email",
5557
+ "phone",
5558
+ "url",
5559
+ "currency"
5560
+ ];
5561
+ if (!validTypes.includes(opts.type)) {
5562
+ throw new Error(
5563
+ `Invalid field type "${opts.type}". Valid types: ${validTypes.join(", ")}`
5564
+ );
5565
+ }
5566
+ const config = loadConfig(getProfileName());
5567
+ const client = new ClickUpClient(config);
5568
+ const field = await client.createCustomField(config.teamId, name, opts.type, {
5569
+ description: opts.description,
5570
+ required: opts.required
5571
+ });
5572
+ if (shouldOutputJson(opts.json ?? false)) {
5573
+ console.log(JSON.stringify(field, null, 2));
5574
+ } else {
5575
+ console.log(`Created field "${field.name}" (${field.id}) type: ${field.type}`);
5576
+ }
5577
+ }
5578
+ )
5579
+ );
5500
5580
  program.command("duplicate <taskId>").description("Duplicate a task").option("--json", "Force JSON output even in terminal").action(
5501
5581
  wrapAction(async (taskId, opts) => {
5502
5582
  const config = loadConfig(getProfileName());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krodak/clickup-cli",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "ClickUp CLI for AI agents and humans",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -78,6 +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
82
  | `cup tag <id> [--add tags] [--remove tags]` | Add/remove tags on a task |
82
83
  | `cup link <taskId> <linksTo> [--remove]` | Link/unlink tasks |
83
84
  | `cup attach <taskId> <filePath>` | Upload file attachment |