@krodak/clickup-cli 1.7.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/dist/index.js +94 -0
- package/package.json +1 -1
- package/skills/clickup-cli/SKILL.md +2 -0
|
@@ -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.
|
|
4
|
+
"version": "1.9.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,34 @@ var ClickUpClient = class {
|
|
|
697
697
|
body: JSON.stringify({ name })
|
|
698
698
|
});
|
|
699
699
|
}
|
|
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
|
+
}
|
|
708
|
+
const body = {
|
|
709
|
+
name,
|
|
710
|
+
type,
|
|
711
|
+
type_config: typeConfig,
|
|
712
|
+
description: opts?.description ?? "",
|
|
713
|
+
required: opts?.required ?? false,
|
|
714
|
+
pinned: false,
|
|
715
|
+
hide_from_guests: false,
|
|
716
|
+
required_on_subtasks: false,
|
|
717
|
+
private: false,
|
|
718
|
+
permission_level: null,
|
|
719
|
+
members: [],
|
|
720
|
+
groups: []
|
|
721
|
+
};
|
|
722
|
+
const data = await this.request(
|
|
723
|
+
`/field?workspace_id=${teamId}`,
|
|
724
|
+
{ method: "POST", body: JSON.stringify(body) }
|
|
725
|
+
);
|
|
726
|
+
return data.data;
|
|
727
|
+
}
|
|
700
728
|
};
|
|
701
729
|
|
|
702
730
|
// src/config.ts
|
|
@@ -3094,6 +3122,18 @@ var commandMetadata = [
|
|
|
3094
3122
|
{ section: "read", usage: "fields <listId>", description: "List custom fields for a list" }
|
|
3095
3123
|
]
|
|
3096
3124
|
},
|
|
3125
|
+
{
|
|
3126
|
+
name: "field-create",
|
|
3127
|
+
description: "Create a custom field in your workspace",
|
|
3128
|
+
flags: ["-t", "--type", "-d", "--description", "--options", "--required", "--json"],
|
|
3129
|
+
quickReference: [
|
|
3130
|
+
{
|
|
3131
|
+
section: "write",
|
|
3132
|
+
usage: "field-create <name>",
|
|
3133
|
+
description: "Create a custom field in your workspace"
|
|
3134
|
+
}
|
|
3135
|
+
]
|
|
3136
|
+
},
|
|
3097
3137
|
{
|
|
3098
3138
|
name: "duplicate",
|
|
3099
3139
|
description: "Duplicate a task",
|
|
@@ -3781,6 +3821,14 @@ ${renderZshTopLevelCommands(name)}
|
|
|
3781
3821
|
'1:list_id:' \\
|
|
3782
3822
|
'--json[Force JSON output]'
|
|
3783
3823
|
;;
|
|
3824
|
+
field-create)
|
|
3825
|
+
_arguments \\
|
|
3826
|
+
'1:name:' \\
|
|
3827
|
+
'(-t --type)'{-t,--type}'[Field type]:type:(text short_text number date checkbox drop_down labels email phone url currency)' \\
|
|
3828
|
+
'(-d --description)'{-d,--description}'[Field description]:text:' \\
|
|
3829
|
+
'--required[Make the field required]' \\
|
|
3830
|
+
'--json[Force JSON output]'
|
|
3831
|
+
;;
|
|
3784
3832
|
duplicate)
|
|
3785
3833
|
_arguments \\
|
|
3786
3834
|
'1:task_id:' \\
|
|
@@ -5497,6 +5545,52 @@ function buildProgram(programName = basename(process.argv[1] ?? "cup")) {
|
|
|
5497
5545
|
}
|
|
5498
5546
|
})
|
|
5499
5547
|
);
|
|
5548
|
+
program.command("field-create <name>").description("Create a custom field in your workspace").requiredOption(
|
|
5549
|
+
"-t, --type <type>",
|
|
5550
|
+
"Field type (text, number, date, checkbox, drop_down, labels, email, phone, url, currency, short_text)"
|
|
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(
|
|
5552
|
+
wrapAction(
|
|
5553
|
+
async (name, opts) => {
|
|
5554
|
+
if (!name.trim()) throw new Error("Field name cannot be empty");
|
|
5555
|
+
const validTypes = [
|
|
5556
|
+
"text",
|
|
5557
|
+
"short_text",
|
|
5558
|
+
"number",
|
|
5559
|
+
"date",
|
|
5560
|
+
"checkbox",
|
|
5561
|
+
"drop_down",
|
|
5562
|
+
"labels",
|
|
5563
|
+
"email",
|
|
5564
|
+
"phone",
|
|
5565
|
+
"url",
|
|
5566
|
+
"currency"
|
|
5567
|
+
];
|
|
5568
|
+
if (!validTypes.includes(opts.type)) {
|
|
5569
|
+
throw new Error(
|
|
5570
|
+
`Invalid field type "${opts.type}". Valid types: ${validTypes.join(", ")}`
|
|
5571
|
+
);
|
|
5572
|
+
}
|
|
5573
|
+
const config = loadConfig(getProfileName());
|
|
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
|
+
}
|
|
5581
|
+
const field = await client.createCustomField(config.teamId, name, opts.type, {
|
|
5582
|
+
description: opts.description,
|
|
5583
|
+
required: opts.required,
|
|
5584
|
+
options
|
|
5585
|
+
});
|
|
5586
|
+
if (shouldOutputJson(opts.json ?? false)) {
|
|
5587
|
+
console.log(JSON.stringify(field, null, 2));
|
|
5588
|
+
} else {
|
|
5589
|
+
console.log(`Created field "${field.name}" (${field.id}) type: ${field.type}`);
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
)
|
|
5593
|
+
);
|
|
5500
5594
|
program.command("duplicate <taskId>").description("Duplicate a task").option("--json", "Force JSON output even in terminal").action(
|
|
5501
5595
|
wrapAction(async (taskId, opts) => {
|
|
5502
5596
|
const config = loadConfig(getProfileName());
|
package/package.json
CHANGED
|
@@ -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] [--options "a,b,c"] [--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 |
|
|
@@ -146,6 +147,7 @@ All commands support `--help` for full flag details. All commands support `--jso
|
|
|
146
147
|
| `--include-closed` | Include closed/done tasks |
|
|
147
148
|
| `--list` on create | Optional when `--parent` is given (auto-detected) |
|
|
148
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` |
|
|
149
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>` |
|
|
150
152
|
| `cup link` | Both IDs must be the same type (both custom or both native) |
|
|
151
153
|
| `cup delete` | DESTRUCTIVE. Requires `--confirm` in non-interactive mode. Cannot be undone |
|