@camunda8/cli 2.6.1 → 2.7.0-alpha.10
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/README.md +80 -1
- package/dist/command-dispatch.d.ts +16 -0
- package/dist/command-dispatch.d.ts.map +1 -0
- package/dist/command-dispatch.js +129 -0
- package/dist/command-dispatch.js.map +1 -0
- package/dist/command-framework.d.ts +248 -0
- package/dist/command-framework.d.ts.map +1 -0
- package/dist/command-framework.js +229 -0
- package/dist/command-framework.js.map +1 -0
- package/dist/command-registry.d.ts +2089 -0
- package/dist/command-registry.d.ts.map +1 -0
- package/dist/command-registry.js +1482 -0
- package/dist/command-registry.js.map +1 -0
- package/dist/command-validation.d.ts +30 -4
- package/dist/command-validation.d.ts.map +1 -1
- package/dist/command-validation.js +90 -4
- package/dist/command-validation.js.map +1 -1
- package/dist/commands/completion.d.ts +25 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +590 -1223
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/deployments.d.ts +2 -0
- package/dist/commands/deployments.d.ts.map +1 -1
- package/dist/commands/deployments.js +13 -2
- package/dist/commands/deployments.js.map +1 -1
- package/dist/commands/forms.d.ts +2 -20
- package/dist/commands/forms.d.ts.map +1 -1
- package/dist/commands/forms.js +76 -79
- package/dist/commands/forms.js.map +1 -1
- package/dist/commands/help.d.ts +4 -88
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +574 -1941
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/identity-authorizations.d.ts +5 -24
- package/dist/commands/identity-authorizations.d.ts.map +1 -1
- package/dist/commands/identity-authorizations.js +113 -137
- package/dist/commands/identity-authorizations.js.map +1 -1
- package/dist/commands/identity-groups.d.ts +5 -26
- package/dist/commands/identity-groups.d.ts.map +1 -1
- package/dist/commands/identity-groups.js +91 -124
- package/dist/commands/identity-groups.js.map +1 -1
- package/dist/commands/identity-mapping-rules.d.ts +5 -30
- package/dist/commands/identity-mapping-rules.d.ts.map +1 -1
- package/dist/commands/identity-mapping-rules.js +106 -136
- package/dist/commands/identity-mapping-rules.js.map +1 -1
- package/dist/commands/identity-roles.d.ts +5 -26
- package/dist/commands/identity-roles.d.ts.map +1 -1
- package/dist/commands/identity-roles.js +91 -124
- package/dist/commands/identity-roles.js.map +1 -1
- package/dist/commands/identity-tenants.d.ts +5 -26
- package/dist/commands/identity-tenants.d.ts.map +1 -1
- package/dist/commands/identity-tenants.js +92 -126
- package/dist/commands/identity-tenants.js.map +1 -1
- package/dist/commands/identity-users.d.ts +5 -29
- package/dist/commands/identity-users.d.ts.map +1 -1
- package/dist/commands/identity-users.js +95 -129
- package/dist/commands/identity-users.js.map +1 -1
- package/dist/commands/identity.d.ts +6 -6
- package/dist/commands/identity.d.ts.map +1 -1
- package/dist/commands/identity.js +6 -7
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/incidents.d.ts +3 -16
- package/dist/commands/incidents.d.ts.map +1 -1
- package/dist/commands/incidents.js +71 -98
- package/dist/commands/incidents.js.map +1 -1
- package/dist/commands/jobs.d.ts +4 -26
- package/dist/commands/jobs.d.ts.map +1 -1
- package/dist/commands/jobs.js +143 -159
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/mcp-proxy.d.ts +1 -0
- package/dist/commands/mcp-proxy.d.ts.map +1 -1
- package/dist/commands/mcp-proxy.js +10 -2
- package/dist/commands/mcp-proxy.js.map +1 -1
- package/dist/commands/messages.d.ts +2 -12
- package/dist/commands/messages.d.ts.map +1 -1
- package/dist/commands/messages.js +87 -81
- package/dist/commands/messages.js.map +1 -1
- package/dist/commands/open.d.ts +4 -0
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +18 -0
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/plugins.d.ts +7 -9
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +32 -25
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/process-definitions.d.ts +2 -14
- package/dist/commands/process-definitions.d.ts.map +1 -1
- package/dist/commands/process-definitions.js +57 -80
- package/dist/commands/process-definitions.js.map +1 -1
- package/dist/commands/process-instances.d.ts +8 -37
- package/dist/commands/process-instances.d.ts.map +1 -1
- package/dist/commands/process-instances.js +242 -193
- package/dist/commands/process-instances.js.map +1 -1
- package/dist/commands/profiles.d.ts +4 -0
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +29 -0
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/run.d.ts +2 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +10 -0
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/search.d.ts +7 -100
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +530 -694
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +30 -0
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/topology.d.ts +1 -3
- package/dist/commands/topology.d.ts.map +1 -1
- package/dist/commands/topology.js +11 -18
- package/dist/commands/topology.js.map +1 -1
- package/dist/commands/user-tasks.d.ts +2 -16
- package/dist/commands/user-tasks.d.ts.map +1 -1
- package/dist/commands/user-tasks.js +73 -101
- package/dist/commands/user-tasks.js.map +1 -1
- package/dist/commands/watch.d.ts +1 -0
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +15 -0
- package/dist/commands/watch.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -1
- package/dist/default-plugins/cluster/README.md +1 -1
- package/dist/default-plugins/cluster/c8ctl-plugin.js +281 -59
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +111 -1023
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +5 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +7 -1
- package/dist/logger.js.map +1 -1
- package/dist/plugin-loader.d.ts +5 -0
- package/dist/plugin-loader.d.ts.map +1 -1
- package/dist/plugin-loader.js +1 -0
- package/dist/plugin-loader.js.map +1 -1
- package/dist/update-check.d.ts +67 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +284 -0
- package/dist/update-check.js.map +1 -0
- package/package.json +3 -2
- /package/dist/templates/{tsconfig.json → tsconfig.json.template} +0 -0
|
@@ -0,0 +1,1482 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative command registry — single source of truth for all
|
|
3
|
+
* verb×resource combinations, their flags, constraints, and metadata.
|
|
4
|
+
*
|
|
5
|
+
* Consumers (help, completion, validation, dispatch) derive their
|
|
6
|
+
* data from this registry instead of maintaining separate copies.
|
|
7
|
+
*/
|
|
8
|
+
import { AuthorizationKey, IncidentKey, JobKey, ProcessDefinitionId, ProcessDefinitionKey, ProcessInstanceKey, TenantId, Username, UserTaskKey, } from "@camunda8/orchestration-cluster-api";
|
|
9
|
+
// ─── Resource Aliases ────────────────────────────────────────────────────────
|
|
10
|
+
/**
|
|
11
|
+
* Maps short/plural resource names to their canonical singular form.
|
|
12
|
+
* Used by the dispatch layer to normalize user input before lookup.
|
|
13
|
+
*/
|
|
14
|
+
export const RESOURCE_ALIASES = {
|
|
15
|
+
pi: "process-instance",
|
|
16
|
+
"process-instances": "process-instance",
|
|
17
|
+
pd: "process-definition",
|
|
18
|
+
"process-definitions": "process-definition",
|
|
19
|
+
ut: "user-task",
|
|
20
|
+
"user-tasks": "user-task",
|
|
21
|
+
inc: "incident",
|
|
22
|
+
incidents: "incident",
|
|
23
|
+
msg: "message",
|
|
24
|
+
vars: "variable",
|
|
25
|
+
variables: "variable",
|
|
26
|
+
profile: "profile",
|
|
27
|
+
profiles: "profile",
|
|
28
|
+
plugin: "plugin",
|
|
29
|
+
plugins: "plugin",
|
|
30
|
+
auth: "authorization",
|
|
31
|
+
authorizations: "authorization",
|
|
32
|
+
mr: "mapping-rule",
|
|
33
|
+
"mapping-rules": "mapping-rule",
|
|
34
|
+
users: "user",
|
|
35
|
+
roles: "role",
|
|
36
|
+
groups: "group",
|
|
37
|
+
tenants: "tenant",
|
|
38
|
+
};
|
|
39
|
+
// ─── Global Flags ────────────────────────────────────────────────────────────
|
|
40
|
+
/**
|
|
41
|
+
* Flags accepted by every command (infrastructure/agent flags).
|
|
42
|
+
*/
|
|
43
|
+
export const GLOBAL_FLAGS = {
|
|
44
|
+
help: { type: "boolean", description: "Show help", short: "h" },
|
|
45
|
+
version: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Show CLI version, or filter by process definition version on supported commands",
|
|
48
|
+
short: "v",
|
|
49
|
+
},
|
|
50
|
+
profile: { type: "string", description: "Use a specific profile" },
|
|
51
|
+
"dry-run": {
|
|
52
|
+
type: "boolean",
|
|
53
|
+
description: "Preview the API request without executing",
|
|
54
|
+
agentDescription: "Preview the API request that would be sent, without executing it.\nEmits JSON: { dryRun, command, method, url, body }\nAlways exits 0.",
|
|
55
|
+
agentAppliesTo: "all commands",
|
|
56
|
+
},
|
|
57
|
+
verbose: { type: "boolean", description: "Show verbose output" },
|
|
58
|
+
fields: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Comma-separated list of fields to display",
|
|
61
|
+
agentDescription: "Comma-separated list of output fields to include.\nReduces context window size when parsing output.\nExample: c8ctl list pi --fields Key,State,processDefinitionId\nCase-insensitive.",
|
|
62
|
+
agentAppliesTo: "all list/search/get commands",
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Flags shared across all search/list commands.
|
|
67
|
+
*/
|
|
68
|
+
export const SEARCH_FLAGS = {
|
|
69
|
+
sortBy: { type: "string", description: "Sort results by field" },
|
|
70
|
+
asc: { type: "boolean", description: "Sort ascending" },
|
|
71
|
+
desc: { type: "boolean", description: "Sort descending" },
|
|
72
|
+
limit: { type: "string", description: "Maximum number of results" },
|
|
73
|
+
between: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Date range filter (e.g. 7d, 30d, 2024-01-01..2024-12-31)",
|
|
76
|
+
},
|
|
77
|
+
dateField: {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "Date field for --between filter",
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
// ─── Reusable flag sets ──────────────────────────────────────────────────────
|
|
83
|
+
const PI_SEARCH_FLAGS = {
|
|
84
|
+
bpmnProcessId: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "Filter by BPMN process ID",
|
|
87
|
+
},
|
|
88
|
+
id: { type: "string", description: "Filter by BPMN process ID (alias)" },
|
|
89
|
+
processDefinitionId: {
|
|
90
|
+
type: "string",
|
|
91
|
+
description: "Filter by process definition ID",
|
|
92
|
+
validate: ProcessDefinitionId.assumeExists,
|
|
93
|
+
},
|
|
94
|
+
processDefinitionKey: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Filter by process definition key",
|
|
97
|
+
validate: ProcessDefinitionKey.assumeExists,
|
|
98
|
+
},
|
|
99
|
+
state: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Filter by state (ACTIVE, COMPLETED, etc)",
|
|
102
|
+
},
|
|
103
|
+
key: { type: "string", description: "Filter by key" },
|
|
104
|
+
parentProcessInstanceKey: {
|
|
105
|
+
type: "string",
|
|
106
|
+
description: "Filter by parent process instance key",
|
|
107
|
+
validate: ProcessInstanceKey.assumeExists,
|
|
108
|
+
},
|
|
109
|
+
iid: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Case-insensitive filter by BPMN process ID",
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
const PD_SEARCH_FLAGS = {
|
|
115
|
+
bpmnProcessId: {
|
|
116
|
+
type: "string",
|
|
117
|
+
description: "Filter by BPMN process ID",
|
|
118
|
+
},
|
|
119
|
+
id: { type: "string", description: "Filter by BPMN process ID (alias)" },
|
|
120
|
+
processDefinitionId: {
|
|
121
|
+
type: "string",
|
|
122
|
+
description: "Filter by process definition ID",
|
|
123
|
+
validate: ProcessDefinitionId.assumeExists,
|
|
124
|
+
},
|
|
125
|
+
name: { type: "string", description: "Filter by name" },
|
|
126
|
+
key: { type: "string", description: "Filter by key" },
|
|
127
|
+
iid: {
|
|
128
|
+
type: "string",
|
|
129
|
+
description: "Case-insensitive filter by BPMN process ID",
|
|
130
|
+
},
|
|
131
|
+
iname: { type: "string", description: "Case-insensitive filter by name" },
|
|
132
|
+
};
|
|
133
|
+
const UT_SEARCH_FLAGS = {
|
|
134
|
+
state: { type: "string", description: "Filter by state" },
|
|
135
|
+
assignee: { type: "string", description: "Filter by assignee" },
|
|
136
|
+
processInstanceKey: {
|
|
137
|
+
type: "string",
|
|
138
|
+
description: "Filter by process instance key",
|
|
139
|
+
validate: ProcessInstanceKey.assumeExists,
|
|
140
|
+
},
|
|
141
|
+
processDefinitionKey: {
|
|
142
|
+
type: "string",
|
|
143
|
+
description: "Filter by process definition key",
|
|
144
|
+
validate: ProcessDefinitionKey.assumeExists,
|
|
145
|
+
},
|
|
146
|
+
elementId: { type: "string", description: "Filter by element ID" },
|
|
147
|
+
iassignee: {
|
|
148
|
+
type: "string",
|
|
149
|
+
description: "Case-insensitive filter by assignee",
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
const INC_SEARCH_FLAGS = {
|
|
153
|
+
state: { type: "string", description: "Filter by state" },
|
|
154
|
+
processInstanceKey: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "Filter by process instance key",
|
|
157
|
+
validate: ProcessInstanceKey.assumeExists,
|
|
158
|
+
},
|
|
159
|
+
processDefinitionKey: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "Filter by process definition key",
|
|
162
|
+
validate: ProcessDefinitionKey.assumeExists,
|
|
163
|
+
},
|
|
164
|
+
bpmnProcessId: {
|
|
165
|
+
type: "string",
|
|
166
|
+
description: "Filter by BPMN process ID",
|
|
167
|
+
},
|
|
168
|
+
id: { type: "string", description: "Filter by BPMN process ID (alias)" },
|
|
169
|
+
processDefinitionId: {
|
|
170
|
+
type: "string",
|
|
171
|
+
description: "Filter by process definition ID",
|
|
172
|
+
validate: ProcessDefinitionId.assumeExists,
|
|
173
|
+
},
|
|
174
|
+
errorType: { type: "string", description: "Filter by error type" },
|
|
175
|
+
errorMessage: {
|
|
176
|
+
type: "string",
|
|
177
|
+
description: "Filter by error message",
|
|
178
|
+
},
|
|
179
|
+
ierrorMessage: {
|
|
180
|
+
type: "string",
|
|
181
|
+
description: "Case-insensitive filter by error message",
|
|
182
|
+
},
|
|
183
|
+
iid: {
|
|
184
|
+
type: "string",
|
|
185
|
+
description: "Case-insensitive filter by BPMN process ID",
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
const JOB_SEARCH_FLAGS = {
|
|
189
|
+
state: { type: "string", description: "Filter by state" },
|
|
190
|
+
type: { type: "string", description: "Filter by job type" },
|
|
191
|
+
processInstanceKey: {
|
|
192
|
+
type: "string",
|
|
193
|
+
description: "Filter by process instance key",
|
|
194
|
+
validate: ProcessInstanceKey.assumeExists,
|
|
195
|
+
},
|
|
196
|
+
processDefinitionKey: {
|
|
197
|
+
type: "string",
|
|
198
|
+
description: "Filter by process definition key",
|
|
199
|
+
validate: ProcessDefinitionKey.assumeExists,
|
|
200
|
+
},
|
|
201
|
+
itype: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description: "Case-insensitive filter by job type",
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
const VAR_SEARCH_FLAGS = {
|
|
207
|
+
name: { type: "string", description: "Filter by variable name" },
|
|
208
|
+
value: { type: "string", description: "Filter by value" },
|
|
209
|
+
processInstanceKey: {
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Filter by process instance key",
|
|
212
|
+
validate: ProcessInstanceKey.assumeExists,
|
|
213
|
+
},
|
|
214
|
+
scopeKey: { type: "string", description: "Filter by scope key" },
|
|
215
|
+
fullValue: {
|
|
216
|
+
type: "boolean",
|
|
217
|
+
description: "Return full variable values (not truncated)",
|
|
218
|
+
},
|
|
219
|
+
iname: {
|
|
220
|
+
type: "string",
|
|
221
|
+
description: "Case-insensitive filter by name",
|
|
222
|
+
},
|
|
223
|
+
ivalue: {
|
|
224
|
+
type: "string",
|
|
225
|
+
description: "Case-insensitive filter by value",
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
const USER_SEARCH_FLAGS = {
|
|
229
|
+
username: {
|
|
230
|
+
type: "string",
|
|
231
|
+
description: "Filter by username",
|
|
232
|
+
validate: Username.assumeExists,
|
|
233
|
+
},
|
|
234
|
+
name: { type: "string", description: "Filter by name" },
|
|
235
|
+
email: { type: "string", description: "Filter by email" },
|
|
236
|
+
};
|
|
237
|
+
const ROLE_SEARCH_FLAGS = {
|
|
238
|
+
roleId: { type: "string", description: "Filter by role ID" },
|
|
239
|
+
name: { type: "string", description: "Filter by name" },
|
|
240
|
+
};
|
|
241
|
+
const GROUP_SEARCH_FLAGS = {
|
|
242
|
+
groupId: { type: "string", description: "Filter by group ID" },
|
|
243
|
+
name: { type: "string", description: "Filter by name" },
|
|
244
|
+
};
|
|
245
|
+
const TENANT_SEARCH_FLAGS = {
|
|
246
|
+
tenantId: {
|
|
247
|
+
type: "string",
|
|
248
|
+
description: "Filter by tenant ID",
|
|
249
|
+
validate: TenantId.assumeExists,
|
|
250
|
+
},
|
|
251
|
+
name: { type: "string", description: "Filter by name" },
|
|
252
|
+
};
|
|
253
|
+
const AUTH_SEARCH_FLAGS = {
|
|
254
|
+
ownerId: { type: "string", description: "Filter by owner ID" },
|
|
255
|
+
ownerType: { type: "string", description: "Filter by owner type" },
|
|
256
|
+
resourceType: {
|
|
257
|
+
type: "string",
|
|
258
|
+
description: "Filter by resource type",
|
|
259
|
+
},
|
|
260
|
+
resourceId: { type: "string", description: "Filter by resource ID" },
|
|
261
|
+
};
|
|
262
|
+
const MR_SEARCH_FLAGS = {
|
|
263
|
+
mappingRuleId: {
|
|
264
|
+
type: "string",
|
|
265
|
+
description: "Filter by mapping rule ID",
|
|
266
|
+
},
|
|
267
|
+
name: { type: "string", description: "Filter by name" },
|
|
268
|
+
claimName: { type: "string", description: "Filter by claim name" },
|
|
269
|
+
claimValue: { type: "string", description: "Filter by claim value" },
|
|
270
|
+
};
|
|
271
|
+
const ASSIGN_FLAGS = {
|
|
272
|
+
"to-user": { type: "string", description: "Target user ID" },
|
|
273
|
+
"to-group": { type: "string", description: "Target group ID" },
|
|
274
|
+
"to-tenant": { type: "string", description: "Target tenant ID" },
|
|
275
|
+
"to-mapping-rule": {
|
|
276
|
+
type: "string",
|
|
277
|
+
description: "Target mapping rule ID",
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
const UNASSIGN_FLAGS = {
|
|
281
|
+
"from-user": { type: "string", description: "Source user ID" },
|
|
282
|
+
"from-group": { type: "string", description: "Source group ID" },
|
|
283
|
+
"from-tenant": { type: "string", description: "Source tenant ID" },
|
|
284
|
+
"from-mapping-rule": {
|
|
285
|
+
type: "string",
|
|
286
|
+
description: "Source mapping rule ID",
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
const PROFILE_CONNECTION_FLAGS = {
|
|
290
|
+
baseUrl: { type: "string", description: "Cluster base URL" },
|
|
291
|
+
clientId: { type: "string", description: "OAuth client ID" },
|
|
292
|
+
clientSecret: { type: "string", description: "OAuth client secret" },
|
|
293
|
+
audience: { type: "string", description: "OAuth audience" },
|
|
294
|
+
oAuthUrl: { type: "string", description: "OAuth token URL" },
|
|
295
|
+
defaultTenantId: { type: "string", description: "Default tenant ID" },
|
|
296
|
+
username: { type: "string", description: "Basic auth username" },
|
|
297
|
+
password: { type: "string", description: "Basic auth password" },
|
|
298
|
+
"from-file": { type: "string", description: "Import from .env file" },
|
|
299
|
+
"from-env": {
|
|
300
|
+
type: "boolean",
|
|
301
|
+
description: "Import from environment variables",
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
// ─── Per-resource get flags ──────────────────────────────────────────────────
|
|
305
|
+
export const GET_PD_FLAGS = {
|
|
306
|
+
xml: {
|
|
307
|
+
type: "boolean",
|
|
308
|
+
description: "Get BPMN XML (process definitions)",
|
|
309
|
+
showInTopLevelHelp: true,
|
|
310
|
+
helpHint: "use with 'get pd'",
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
const GET_FORM_FLAGS = {
|
|
314
|
+
userTask: {
|
|
315
|
+
type: "boolean",
|
|
316
|
+
description: "Get form for user task",
|
|
317
|
+
showInTopLevelHelp: true,
|
|
318
|
+
helpHint: "use with 'get form'",
|
|
319
|
+
},
|
|
320
|
+
ut: {
|
|
321
|
+
type: "boolean",
|
|
322
|
+
description: "Alias for --userTask",
|
|
323
|
+
},
|
|
324
|
+
processDefinition: {
|
|
325
|
+
type: "boolean",
|
|
326
|
+
description: "Get form for process definition",
|
|
327
|
+
showInTopLevelHelp: true,
|
|
328
|
+
helpHint: "use with 'get form'",
|
|
329
|
+
},
|
|
330
|
+
pd: {
|
|
331
|
+
type: "boolean",
|
|
332
|
+
description: "Alias for --processDefinition",
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
const GET_PI_FLAGS = {
|
|
336
|
+
variables: {
|
|
337
|
+
type: "boolean",
|
|
338
|
+
description: "Include variables in output",
|
|
339
|
+
showInTopLevelHelp: true,
|
|
340
|
+
helpHint: "use with 'get pi'",
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
// ─── Per-resource get positionals ────────────────────────────────────────────
|
|
344
|
+
export const GET_PD_POSITIONALS = [
|
|
345
|
+
{
|
|
346
|
+
name: "key",
|
|
347
|
+
required: true,
|
|
348
|
+
validate: ProcessDefinitionKey.assumeExists,
|
|
349
|
+
},
|
|
350
|
+
];
|
|
351
|
+
const GET_PI_POSITIONALS = [
|
|
352
|
+
{
|
|
353
|
+
name: "key",
|
|
354
|
+
required: true,
|
|
355
|
+
validate: ProcessInstanceKey.assumeExists,
|
|
356
|
+
},
|
|
357
|
+
];
|
|
358
|
+
const GET_INCIDENT_POSITIONALS = [
|
|
359
|
+
{
|
|
360
|
+
name: "key",
|
|
361
|
+
required: true,
|
|
362
|
+
validate: IncidentKey.assumeExists,
|
|
363
|
+
},
|
|
364
|
+
];
|
|
365
|
+
const GET_USER_POSITIONALS = [
|
|
366
|
+
{
|
|
367
|
+
name: "username",
|
|
368
|
+
required: true,
|
|
369
|
+
validate: Username.assumeExists,
|
|
370
|
+
},
|
|
371
|
+
];
|
|
372
|
+
const GET_ROLE_POSITIONALS = [
|
|
373
|
+
{ name: "roleId", required: true },
|
|
374
|
+
];
|
|
375
|
+
const GET_GROUP_POSITIONALS = [
|
|
376
|
+
{ name: "groupId", required: true },
|
|
377
|
+
];
|
|
378
|
+
const GET_TENANT_POSITIONALS = [
|
|
379
|
+
{
|
|
380
|
+
name: "tenantId",
|
|
381
|
+
required: true,
|
|
382
|
+
validate: TenantId.assumeExists,
|
|
383
|
+
},
|
|
384
|
+
];
|
|
385
|
+
const GET_AUTHORIZATION_POSITIONALS = [
|
|
386
|
+
{
|
|
387
|
+
name: "authorizationKey",
|
|
388
|
+
required: true,
|
|
389
|
+
validate: AuthorizationKey.assumeExists,
|
|
390
|
+
},
|
|
391
|
+
];
|
|
392
|
+
const GET_MAPPING_RULE_POSITIONALS = [
|
|
393
|
+
{ name: "mappingRuleId", required: true },
|
|
394
|
+
];
|
|
395
|
+
const GET_FORM_POSITIONALS = [
|
|
396
|
+
{ name: "key", required: true },
|
|
397
|
+
];
|
|
398
|
+
// ─── Command Registry ────────────────────────────────────────────────────────
|
|
399
|
+
export const COMMAND_REGISTRY = {
|
|
400
|
+
// ── Read commands ──────────────────────────────────────────────────────
|
|
401
|
+
list: {
|
|
402
|
+
description: "List resources (process, identity)",
|
|
403
|
+
helpDescription: "List resources",
|
|
404
|
+
hasDetailedHelp: true,
|
|
405
|
+
helpFooterLabel: "Show all list resources and their flags",
|
|
406
|
+
mutating: false,
|
|
407
|
+
requiresResource: true,
|
|
408
|
+
helpExamples: [
|
|
409
|
+
{ command: "c8ctl list pi", description: "List process instances" },
|
|
410
|
+
{ command: "c8ctl list pd", description: "List process definitions" },
|
|
411
|
+
{ command: "c8ctl list users", description: "List users" },
|
|
412
|
+
],
|
|
413
|
+
resources: [
|
|
414
|
+
"pi",
|
|
415
|
+
"pd",
|
|
416
|
+
"ut",
|
|
417
|
+
"inc",
|
|
418
|
+
"jobs",
|
|
419
|
+
"profiles",
|
|
420
|
+
"plugins",
|
|
421
|
+
"users",
|
|
422
|
+
"roles",
|
|
423
|
+
"groups",
|
|
424
|
+
"tenants",
|
|
425
|
+
"auth",
|
|
426
|
+
"mapping-rules",
|
|
427
|
+
],
|
|
428
|
+
flags: {
|
|
429
|
+
all: {
|
|
430
|
+
type: "boolean",
|
|
431
|
+
description: "List all (disable pagination limit)",
|
|
432
|
+
},
|
|
433
|
+
...SEARCH_FLAGS,
|
|
434
|
+
...PI_SEARCH_FLAGS,
|
|
435
|
+
...PD_SEARCH_FLAGS,
|
|
436
|
+
...UT_SEARCH_FLAGS,
|
|
437
|
+
...INC_SEARCH_FLAGS,
|
|
438
|
+
...JOB_SEARCH_FLAGS,
|
|
439
|
+
...USER_SEARCH_FLAGS,
|
|
440
|
+
...ROLE_SEARCH_FLAGS,
|
|
441
|
+
...GROUP_SEARCH_FLAGS,
|
|
442
|
+
...TENANT_SEARCH_FLAGS,
|
|
443
|
+
...AUTH_SEARCH_FLAGS,
|
|
444
|
+
...MR_SEARCH_FLAGS,
|
|
445
|
+
},
|
|
446
|
+
resourceFlags: {
|
|
447
|
+
"process-definition": PD_SEARCH_FLAGS,
|
|
448
|
+
"process-instance": PI_SEARCH_FLAGS,
|
|
449
|
+
"user-task": UT_SEARCH_FLAGS,
|
|
450
|
+
incident: INC_SEARCH_FLAGS,
|
|
451
|
+
jobs: JOB_SEARCH_FLAGS,
|
|
452
|
+
user: USER_SEARCH_FLAGS,
|
|
453
|
+
role: ROLE_SEARCH_FLAGS,
|
|
454
|
+
group: GROUP_SEARCH_FLAGS,
|
|
455
|
+
tenant: TENANT_SEARCH_FLAGS,
|
|
456
|
+
authorization: AUTH_SEARCH_FLAGS,
|
|
457
|
+
"mapping-rule": MR_SEARCH_FLAGS,
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
search: {
|
|
461
|
+
description: "Search resources with filters",
|
|
462
|
+
helpDescription: "Search resources with filters (wildcards, date ranges, case-insensitive)",
|
|
463
|
+
hasDetailedHelp: true,
|
|
464
|
+
helpFooterLabel: "Show all search resources and their flags",
|
|
465
|
+
mutating: false,
|
|
466
|
+
requiresResource: true,
|
|
467
|
+
helpExamples: [
|
|
468
|
+
{
|
|
469
|
+
command: "c8ctl search pi --state=ACTIVE",
|
|
470
|
+
description: "Search for active process instances",
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
command: "c8ctl search pd --bpmnProcessId=myProcess",
|
|
474
|
+
description: "Search process definitions by ID",
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
command: "c8ctl search pd --name='*main*'",
|
|
478
|
+
description: "Search process definitions with wildcard",
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
command: "c8ctl search ut --assignee=john",
|
|
482
|
+
description: "Search user tasks assigned to john",
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
command: "c8ctl search inc --state=ACTIVE",
|
|
486
|
+
description: "Search for active incidents",
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
command: "c8ctl search jobs --type=myJobType",
|
|
490
|
+
description: "Search jobs by type",
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
command: "c8ctl search jobs --type='*service*'",
|
|
494
|
+
description: 'Search jobs with type containing "service"',
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
command: "c8ctl search variables --name=myVar",
|
|
498
|
+
description: "Search for variables by name",
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
command: "c8ctl search variables --value=foo",
|
|
502
|
+
description: "Search for variables by value",
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
command: "c8ctl search variables --processInstanceKey=123 --fullValue",
|
|
506
|
+
description: "Search variables with full values",
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
command: "c8ctl search pd --iname='*order*'",
|
|
510
|
+
description: "Case-insensitive search by name",
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
command: "c8ctl search ut --iassignee=John",
|
|
514
|
+
description: "Case-insensitive search by assignee",
|
|
515
|
+
},
|
|
516
|
+
],
|
|
517
|
+
resources: [
|
|
518
|
+
"pi",
|
|
519
|
+
"pd",
|
|
520
|
+
"ut",
|
|
521
|
+
"inc",
|
|
522
|
+
"jobs",
|
|
523
|
+
"vars",
|
|
524
|
+
"users",
|
|
525
|
+
"roles",
|
|
526
|
+
"groups",
|
|
527
|
+
"tenants",
|
|
528
|
+
"auth",
|
|
529
|
+
"mapping-rules",
|
|
530
|
+
],
|
|
531
|
+
flags: {
|
|
532
|
+
...SEARCH_FLAGS,
|
|
533
|
+
...PI_SEARCH_FLAGS,
|
|
534
|
+
...PD_SEARCH_FLAGS,
|
|
535
|
+
...UT_SEARCH_FLAGS,
|
|
536
|
+
...INC_SEARCH_FLAGS,
|
|
537
|
+
...JOB_SEARCH_FLAGS,
|
|
538
|
+
...VAR_SEARCH_FLAGS,
|
|
539
|
+
...USER_SEARCH_FLAGS,
|
|
540
|
+
...ROLE_SEARCH_FLAGS,
|
|
541
|
+
...GROUP_SEARCH_FLAGS,
|
|
542
|
+
...TENANT_SEARCH_FLAGS,
|
|
543
|
+
...AUTH_SEARCH_FLAGS,
|
|
544
|
+
...MR_SEARCH_FLAGS,
|
|
545
|
+
},
|
|
546
|
+
resourceFlags: {
|
|
547
|
+
"process-definition": PD_SEARCH_FLAGS,
|
|
548
|
+
"process-instance": PI_SEARCH_FLAGS,
|
|
549
|
+
"user-task": UT_SEARCH_FLAGS,
|
|
550
|
+
incident: INC_SEARCH_FLAGS,
|
|
551
|
+
jobs: JOB_SEARCH_FLAGS,
|
|
552
|
+
variable: VAR_SEARCH_FLAGS,
|
|
553
|
+
user: USER_SEARCH_FLAGS,
|
|
554
|
+
role: ROLE_SEARCH_FLAGS,
|
|
555
|
+
group: GROUP_SEARCH_FLAGS,
|
|
556
|
+
tenant: TENANT_SEARCH_FLAGS,
|
|
557
|
+
authorization: AUTH_SEARCH_FLAGS,
|
|
558
|
+
"mapping-rule": MR_SEARCH_FLAGS,
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
get: {
|
|
562
|
+
description: "Get resource by key",
|
|
563
|
+
helpDescription: "Get a resource by key",
|
|
564
|
+
hasDetailedHelp: true,
|
|
565
|
+
helpFooterLabel: "Show all get resources and their flags",
|
|
566
|
+
mutating: false,
|
|
567
|
+
requiresResource: true,
|
|
568
|
+
helpExamples: [
|
|
569
|
+
{
|
|
570
|
+
command: "c8ctl get pi 123456",
|
|
571
|
+
description: "Get process instance by key",
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
command: "c8ctl get pi 123456 --variables",
|
|
575
|
+
description: "Get process instance with variables",
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
command: "c8ctl get pd 123456",
|
|
579
|
+
description: "Get process definition by key",
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
command: "c8ctl get pd 123456 --xml",
|
|
583
|
+
description: "Get process definition XML",
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
command: "c8ctl get form 123456",
|
|
587
|
+
description: "Get form (searches both user task and process definition)",
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
command: "c8ctl get form 123456 --ut",
|
|
591
|
+
description: "Get form for user task only",
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
command: "c8ctl get form 123456 --pd",
|
|
595
|
+
description: "Get start form for process definition only",
|
|
596
|
+
},
|
|
597
|
+
{ command: "c8ctl get user john", description: "Get user by username" },
|
|
598
|
+
],
|
|
599
|
+
resources: [
|
|
600
|
+
"pi",
|
|
601
|
+
"pd",
|
|
602
|
+
"inc",
|
|
603
|
+
"topology",
|
|
604
|
+
"form",
|
|
605
|
+
"user",
|
|
606
|
+
"role",
|
|
607
|
+
"group",
|
|
608
|
+
"tenant",
|
|
609
|
+
"auth",
|
|
610
|
+
"mapping-rule",
|
|
611
|
+
],
|
|
612
|
+
flags: { ...GET_PD_FLAGS, ...GET_FORM_FLAGS, ...GET_PI_FLAGS },
|
|
613
|
+
resourceFlags: {
|
|
614
|
+
"process-definition": GET_PD_FLAGS,
|
|
615
|
+
form: GET_FORM_FLAGS,
|
|
616
|
+
"process-instance": GET_PI_FLAGS,
|
|
617
|
+
},
|
|
618
|
+
resourcePositionals: {
|
|
619
|
+
"process-definition": GET_PD_POSITIONALS,
|
|
620
|
+
"process-instance": GET_PI_POSITIONALS,
|
|
621
|
+
incident: GET_INCIDENT_POSITIONALS,
|
|
622
|
+
user: GET_USER_POSITIONALS,
|
|
623
|
+
role: GET_ROLE_POSITIONALS,
|
|
624
|
+
group: GET_GROUP_POSITIONALS,
|
|
625
|
+
tenant: GET_TENANT_POSITIONALS,
|
|
626
|
+
authorization: GET_AUTHORIZATION_POSITIONALS,
|
|
627
|
+
"mapping-rule": GET_MAPPING_RULE_POSITIONALS,
|
|
628
|
+
form: GET_FORM_POSITIONALS,
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
// ── Mutating commands ──────────────────────────────────────────────────
|
|
632
|
+
create: {
|
|
633
|
+
description: "Create resource",
|
|
634
|
+
helpDescription: "Create a resource (process instance, identity)",
|
|
635
|
+
hasDetailedHelp: true,
|
|
636
|
+
helpFooterLabel: "Show all create resources and their flags",
|
|
637
|
+
mutating: true,
|
|
638
|
+
requiresResource: true,
|
|
639
|
+
helpExamples: [
|
|
640
|
+
{
|
|
641
|
+
command: "c8ctl create pi --id=myProcess",
|
|
642
|
+
description: "Create a process instance",
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
command: "c8ctl create pi --id=myProcess --awaitCompletion",
|
|
646
|
+
description: "Create and await completion",
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
command: "c8ctl create user --username=john --name='John Doe' --email=john@example.com --password=secret",
|
|
650
|
+
description: "Create a user",
|
|
651
|
+
},
|
|
652
|
+
],
|
|
653
|
+
resources: [
|
|
654
|
+
"pi",
|
|
655
|
+
"user",
|
|
656
|
+
"role",
|
|
657
|
+
"group",
|
|
658
|
+
"tenant",
|
|
659
|
+
"auth",
|
|
660
|
+
"mapping-rule",
|
|
661
|
+
],
|
|
662
|
+
flags: {
|
|
663
|
+
// Process instance creation
|
|
664
|
+
processDefinitionId: {
|
|
665
|
+
type: "string",
|
|
666
|
+
description: "Process definition ID (BPMN process ID)",
|
|
667
|
+
validate: ProcessDefinitionId.assumeExists,
|
|
668
|
+
},
|
|
669
|
+
id: {
|
|
670
|
+
type: "string",
|
|
671
|
+
description: "Process definition ID (alias for --processDefinitionId)",
|
|
672
|
+
showInTopLevelHelp: true,
|
|
673
|
+
helpHint: "alias for --bpmnProcessId",
|
|
674
|
+
},
|
|
675
|
+
bpmnProcessId: {
|
|
676
|
+
type: "string",
|
|
677
|
+
description: "BPMN process ID (alias for --processDefinitionId)",
|
|
678
|
+
},
|
|
679
|
+
variables: { type: "string", description: "JSON variables" },
|
|
680
|
+
awaitCompletion: {
|
|
681
|
+
type: "boolean",
|
|
682
|
+
description: "Wait for process to complete",
|
|
683
|
+
showInTopLevelHelp: true,
|
|
684
|
+
helpHint: "use with 'create pi'",
|
|
685
|
+
},
|
|
686
|
+
fetchVariables: {
|
|
687
|
+
type: "boolean",
|
|
688
|
+
description: "Fetch result variables on completion",
|
|
689
|
+
showInTopLevelHelp: true,
|
|
690
|
+
},
|
|
691
|
+
requestTimeout: {
|
|
692
|
+
type: "string",
|
|
693
|
+
description: "Await timeout in milliseconds",
|
|
694
|
+
showInTopLevelHelp: true,
|
|
695
|
+
helpHint: "use with --awaitCompletion",
|
|
696
|
+
},
|
|
697
|
+
// Identity user
|
|
698
|
+
username: {
|
|
699
|
+
type: "string",
|
|
700
|
+
description: "Username",
|
|
701
|
+
validate: Username.assumeExists,
|
|
702
|
+
},
|
|
703
|
+
name: { type: "string", description: "Display name" },
|
|
704
|
+
email: { type: "string", description: "Email address" },
|
|
705
|
+
password: { type: "string", description: "Password" },
|
|
706
|
+
// Identity role
|
|
707
|
+
roleId: { type: "string", description: "Role ID" },
|
|
708
|
+
// Identity group
|
|
709
|
+
groupId: { type: "string", description: "Group ID" },
|
|
710
|
+
// Identity tenant
|
|
711
|
+
tenantId: {
|
|
712
|
+
type: "string",
|
|
713
|
+
description: "Tenant ID",
|
|
714
|
+
validate: TenantId.assumeExists,
|
|
715
|
+
},
|
|
716
|
+
// Identity authorization
|
|
717
|
+
ownerId: {
|
|
718
|
+
type: "string",
|
|
719
|
+
description: "Authorization owner ID",
|
|
720
|
+
required: true,
|
|
721
|
+
},
|
|
722
|
+
ownerType: {
|
|
723
|
+
type: "string",
|
|
724
|
+
description: "Authorization owner type",
|
|
725
|
+
required: true,
|
|
726
|
+
},
|
|
727
|
+
resourceType: {
|
|
728
|
+
type: "string",
|
|
729
|
+
description: "Authorization resource type",
|
|
730
|
+
required: true,
|
|
731
|
+
},
|
|
732
|
+
resourceId: {
|
|
733
|
+
type: "string",
|
|
734
|
+
description: "Authorization resource ID",
|
|
735
|
+
required: true,
|
|
736
|
+
},
|
|
737
|
+
permissions: {
|
|
738
|
+
type: "string",
|
|
739
|
+
description: "Comma-separated permissions",
|
|
740
|
+
required: true,
|
|
741
|
+
csv: true,
|
|
742
|
+
},
|
|
743
|
+
// Identity mapping rule
|
|
744
|
+
mappingRuleId: {
|
|
745
|
+
type: "string",
|
|
746
|
+
description: "Mapping rule ID",
|
|
747
|
+
},
|
|
748
|
+
claimName: { type: "string", description: "Claim name" },
|
|
749
|
+
claimValue: { type: "string", description: "Claim value" },
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
delete: {
|
|
753
|
+
description: "Delete resource",
|
|
754
|
+
helpDescription: "Delete a resource by key",
|
|
755
|
+
helpResource: "<resource> <key>",
|
|
756
|
+
hasDetailedHelp: true,
|
|
757
|
+
helpFooterLabel: "Show delete command with all flags",
|
|
758
|
+
mutating: true,
|
|
759
|
+
requiresResource: true,
|
|
760
|
+
helpExamples: [
|
|
761
|
+
{ command: "c8ctl delete user john", description: "Delete user" },
|
|
762
|
+
],
|
|
763
|
+
resources: ["user", "role", "group", "tenant", "auth", "mapping-rule"],
|
|
764
|
+
flags: {},
|
|
765
|
+
resourcePositionals: {
|
|
766
|
+
user: GET_USER_POSITIONALS,
|
|
767
|
+
role: GET_ROLE_POSITIONALS,
|
|
768
|
+
group: GET_GROUP_POSITIONALS,
|
|
769
|
+
tenant: GET_TENANT_POSITIONALS,
|
|
770
|
+
authorization: GET_AUTHORIZATION_POSITIONALS,
|
|
771
|
+
"mapping-rule": GET_MAPPING_RULE_POSITIONALS,
|
|
772
|
+
},
|
|
773
|
+
},
|
|
774
|
+
cancel: {
|
|
775
|
+
description: "Cancel resource",
|
|
776
|
+
helpDescription: "Cancel a process instance",
|
|
777
|
+
helpResource: "<resource> <key>",
|
|
778
|
+
hasDetailedHelp: true,
|
|
779
|
+
helpFooterLabel: "Show cancel command with all flags",
|
|
780
|
+
mutating: true,
|
|
781
|
+
requiresResource: true,
|
|
782
|
+
resources: ["pi"],
|
|
783
|
+
flags: {},
|
|
784
|
+
resourcePositionals: {
|
|
785
|
+
"process-instance": GET_PI_POSITIONALS,
|
|
786
|
+
},
|
|
787
|
+
},
|
|
788
|
+
await: {
|
|
789
|
+
description: "Create and await completion (alias for create --awaitCompletion)",
|
|
790
|
+
helpDescription: "Create and await process instance completion (server-side waiting)",
|
|
791
|
+
helpResource: "<resource>",
|
|
792
|
+
hasDetailedHelp: true,
|
|
793
|
+
helpFooterLabel: "Show await command with all flags",
|
|
794
|
+
mutating: true,
|
|
795
|
+
requiresResource: true,
|
|
796
|
+
helpExamples: [
|
|
797
|
+
{
|
|
798
|
+
command: "c8ctl await pi --id=myProcess",
|
|
799
|
+
description: "Create and wait for completion",
|
|
800
|
+
},
|
|
801
|
+
],
|
|
802
|
+
resources: ["pi"],
|
|
803
|
+
flags: {
|
|
804
|
+
processDefinitionId: {
|
|
805
|
+
type: "string",
|
|
806
|
+
description: "Process definition ID (BPMN process ID)",
|
|
807
|
+
validate: ProcessDefinitionId.assumeExists,
|
|
808
|
+
},
|
|
809
|
+
id: {
|
|
810
|
+
type: "string",
|
|
811
|
+
description: "Process definition ID (alias for --processDefinitionId)",
|
|
812
|
+
},
|
|
813
|
+
bpmnProcessId: {
|
|
814
|
+
type: "string",
|
|
815
|
+
description: "BPMN process ID (alias for --processDefinitionId)",
|
|
816
|
+
},
|
|
817
|
+
variables: { type: "string", description: "JSON variables" },
|
|
818
|
+
fetchVariables: {
|
|
819
|
+
type: "boolean",
|
|
820
|
+
description: "Fetch result variables on completion",
|
|
821
|
+
},
|
|
822
|
+
requestTimeout: {
|
|
823
|
+
type: "string",
|
|
824
|
+
description: "Await timeout in milliseconds",
|
|
825
|
+
},
|
|
826
|
+
},
|
|
827
|
+
},
|
|
828
|
+
complete: {
|
|
829
|
+
description: "Complete resource",
|
|
830
|
+
helpDescription: "Complete a user task or job",
|
|
831
|
+
helpResource: "<resource> <key>",
|
|
832
|
+
hasDetailedHelp: true,
|
|
833
|
+
helpFooterLabel: "Show all complete resources and their flags",
|
|
834
|
+
mutating: true,
|
|
835
|
+
requiresResource: true,
|
|
836
|
+
resources: ["ut", "job"],
|
|
837
|
+
flags: {
|
|
838
|
+
variables: { type: "string", description: "JSON variables" },
|
|
839
|
+
},
|
|
840
|
+
resourcePositionals: {
|
|
841
|
+
"user-task": [
|
|
842
|
+
{
|
|
843
|
+
name: "key",
|
|
844
|
+
required: true,
|
|
845
|
+
validate: UserTaskKey.assumeExists,
|
|
846
|
+
},
|
|
847
|
+
],
|
|
848
|
+
job: [
|
|
849
|
+
{
|
|
850
|
+
name: "key",
|
|
851
|
+
required: true,
|
|
852
|
+
validate: JobKey.assumeExists,
|
|
853
|
+
},
|
|
854
|
+
],
|
|
855
|
+
},
|
|
856
|
+
},
|
|
857
|
+
fail: {
|
|
858
|
+
description: "Fail a job",
|
|
859
|
+
helpDescription: "Mark a job as failed with optional error message and retry count",
|
|
860
|
+
hasDetailedHelp: true,
|
|
861
|
+
helpFooterLabel: "Show fail command with all flags",
|
|
862
|
+
mutating: true,
|
|
863
|
+
requiresResource: true,
|
|
864
|
+
resources: ["job"],
|
|
865
|
+
flags: {
|
|
866
|
+
retries: {
|
|
867
|
+
type: "string",
|
|
868
|
+
description: "Remaining retries",
|
|
869
|
+
},
|
|
870
|
+
errorMessage: {
|
|
871
|
+
type: "string",
|
|
872
|
+
description: "Error message",
|
|
873
|
+
},
|
|
874
|
+
},
|
|
875
|
+
resourcePositionals: {
|
|
876
|
+
job: [
|
|
877
|
+
{
|
|
878
|
+
name: "key",
|
|
879
|
+
required: true,
|
|
880
|
+
validate: JobKey.assumeExists,
|
|
881
|
+
},
|
|
882
|
+
],
|
|
883
|
+
},
|
|
884
|
+
},
|
|
885
|
+
activate: {
|
|
886
|
+
description: "Activate jobs by type",
|
|
887
|
+
helpDescription: "Activate jobs of a specific type for processing",
|
|
888
|
+
hasDetailedHelp: true,
|
|
889
|
+
helpFooterLabel: "Show activate command with all flags",
|
|
890
|
+
mutating: true,
|
|
891
|
+
requiresResource: true,
|
|
892
|
+
resources: ["jobs"],
|
|
893
|
+
flags: {
|
|
894
|
+
maxJobsToActivate: {
|
|
895
|
+
type: "string",
|
|
896
|
+
description: "Maximum number of jobs to activate",
|
|
897
|
+
},
|
|
898
|
+
timeout: {
|
|
899
|
+
type: "string",
|
|
900
|
+
description: "Job timeout in milliseconds",
|
|
901
|
+
},
|
|
902
|
+
worker: { type: "string", description: "Worker name" },
|
|
903
|
+
},
|
|
904
|
+
resourcePositionals: {
|
|
905
|
+
jobs: [
|
|
906
|
+
{ name: "type", required: true },
|
|
907
|
+
],
|
|
908
|
+
},
|
|
909
|
+
},
|
|
910
|
+
resolve: {
|
|
911
|
+
description: "Resolve incident",
|
|
912
|
+
helpDescription: "Resolve an incident (marks resolved, allows process to continue)",
|
|
913
|
+
hasDetailedHelp: true,
|
|
914
|
+
helpFooterLabel: "Show resolve command with all flags",
|
|
915
|
+
mutating: true,
|
|
916
|
+
requiresResource: true,
|
|
917
|
+
resources: ["inc"],
|
|
918
|
+
flags: {},
|
|
919
|
+
resourcePositionals: {
|
|
920
|
+
incident: GET_INCIDENT_POSITIONALS,
|
|
921
|
+
},
|
|
922
|
+
},
|
|
923
|
+
publish: {
|
|
924
|
+
description: "Publish message",
|
|
925
|
+
helpDescription: "Publish a message for message correlation",
|
|
926
|
+
hasDetailedHelp: true,
|
|
927
|
+
helpFooterLabel: "Show publish command with all flags",
|
|
928
|
+
mutating: true,
|
|
929
|
+
requiresResource: true,
|
|
930
|
+
resources: ["msg"],
|
|
931
|
+
flags: {
|
|
932
|
+
correlationKey: {
|
|
933
|
+
type: "string",
|
|
934
|
+
description: "Correlation key",
|
|
935
|
+
},
|
|
936
|
+
variables: { type: "string", description: "JSON variables" },
|
|
937
|
+
timeToLive: {
|
|
938
|
+
type: "string",
|
|
939
|
+
description: "Time to live in milliseconds",
|
|
940
|
+
},
|
|
941
|
+
},
|
|
942
|
+
resourcePositionals: {
|
|
943
|
+
message: [
|
|
944
|
+
{ name: "name", required: true },
|
|
945
|
+
],
|
|
946
|
+
},
|
|
947
|
+
},
|
|
948
|
+
correlate: {
|
|
949
|
+
description: "Correlate message",
|
|
950
|
+
helpDescription: "Correlate a message to a specific process instance",
|
|
951
|
+
hasDetailedHelp: true,
|
|
952
|
+
helpFooterLabel: "Show correlate command with all flags",
|
|
953
|
+
mutating: true,
|
|
954
|
+
requiresResource: true,
|
|
955
|
+
resources: ["msg"],
|
|
956
|
+
flags: {
|
|
957
|
+
correlationKey: {
|
|
958
|
+
type: "string",
|
|
959
|
+
description: "Correlation key",
|
|
960
|
+
required: true,
|
|
961
|
+
},
|
|
962
|
+
variables: { type: "string", description: "JSON variables" },
|
|
963
|
+
timeToLive: {
|
|
964
|
+
type: "string",
|
|
965
|
+
description: "Time to live in milliseconds",
|
|
966
|
+
},
|
|
967
|
+
},
|
|
968
|
+
resourcePositionals: {
|
|
969
|
+
message: [
|
|
970
|
+
{ name: "name", required: true },
|
|
971
|
+
],
|
|
972
|
+
},
|
|
973
|
+
},
|
|
974
|
+
deploy: {
|
|
975
|
+
description: "Deploy BPMN/DMN/forms",
|
|
976
|
+
helpDescription: "Deploy BPMN, DMN, and form files (auto-discovers deployable files)",
|
|
977
|
+
helpResource: "[path...]",
|
|
978
|
+
hasDetailedHelp: true,
|
|
979
|
+
helpFooterLabel: "Show deploy command with all flags",
|
|
980
|
+
mutating: true,
|
|
981
|
+
requiresResource: false,
|
|
982
|
+
helpExamples: [
|
|
983
|
+
{
|
|
984
|
+
command: "c8ctl deploy ./my-process.bpmn",
|
|
985
|
+
description: "Deploy a BPMN file",
|
|
986
|
+
},
|
|
987
|
+
],
|
|
988
|
+
resources: [],
|
|
989
|
+
flags: {},
|
|
990
|
+
},
|
|
991
|
+
run: {
|
|
992
|
+
description: "Deploy and start process",
|
|
993
|
+
helpDescription: "Deploy and start a process instance from a BPMN file",
|
|
994
|
+
helpResource: "<path>",
|
|
995
|
+
hasDetailedHelp: true,
|
|
996
|
+
helpFooterLabel: "Show run command with all flags",
|
|
997
|
+
mutating: true,
|
|
998
|
+
requiresResource: true,
|
|
999
|
+
helpExamples: [
|
|
1000
|
+
{
|
|
1001
|
+
command: "c8ctl run ./my-process.bpmn",
|
|
1002
|
+
description: "Deploy and start process",
|
|
1003
|
+
},
|
|
1004
|
+
],
|
|
1005
|
+
resources: [],
|
|
1006
|
+
flags: {
|
|
1007
|
+
variables: { type: "string", description: "JSON variables" },
|
|
1008
|
+
},
|
|
1009
|
+
},
|
|
1010
|
+
// ── Assignment commands ────────────────────────────────────────────────
|
|
1011
|
+
assign: {
|
|
1012
|
+
description: "Assign resource to target",
|
|
1013
|
+
helpDescription: "Assign a resource to a target (--to-user, --to-group, etc.)",
|
|
1014
|
+
helpResource: "<resource> <id>",
|
|
1015
|
+
hasDetailedHelp: true,
|
|
1016
|
+
helpFooterLabel: "Show assign command with all flags",
|
|
1017
|
+
mutating: true,
|
|
1018
|
+
requiresResource: true,
|
|
1019
|
+
helpExamples: [
|
|
1020
|
+
{
|
|
1021
|
+
command: "c8ctl assign role admin --to-user=john",
|
|
1022
|
+
description: "Assign role to user",
|
|
1023
|
+
},
|
|
1024
|
+
],
|
|
1025
|
+
resources: ["role", "user", "group", "mapping-rule"],
|
|
1026
|
+
flags: { ...ASSIGN_FLAGS },
|
|
1027
|
+
resourcePositionals: {
|
|
1028
|
+
role: GET_ROLE_POSITIONALS,
|
|
1029
|
+
user: GET_USER_POSITIONALS,
|
|
1030
|
+
group: GET_GROUP_POSITIONALS,
|
|
1031
|
+
"mapping-rule": GET_MAPPING_RULE_POSITIONALS,
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
1034
|
+
unassign: {
|
|
1035
|
+
description: "Unassign resource from target",
|
|
1036
|
+
helpDescription: "Unassign a resource from a target (--from-user, --from-group, etc.)",
|
|
1037
|
+
helpResource: "<resource> <id>",
|
|
1038
|
+
hasDetailedHelp: true,
|
|
1039
|
+
helpFooterLabel: "Show unassign command with all flags",
|
|
1040
|
+
mutating: true,
|
|
1041
|
+
requiresResource: true,
|
|
1042
|
+
helpExamples: [
|
|
1043
|
+
{
|
|
1044
|
+
command: "c8ctl unassign role admin --from-user=john",
|
|
1045
|
+
description: "Unassign role from user",
|
|
1046
|
+
},
|
|
1047
|
+
],
|
|
1048
|
+
resources: ["role", "user", "group", "mapping-rule"],
|
|
1049
|
+
flags: { ...UNASSIGN_FLAGS },
|
|
1050
|
+
resourcePositionals: {
|
|
1051
|
+
role: GET_ROLE_POSITIONALS,
|
|
1052
|
+
user: GET_USER_POSITIONALS,
|
|
1053
|
+
group: GET_GROUP_POSITIONALS,
|
|
1054
|
+
"mapping-rule": GET_MAPPING_RULE_POSITIONALS,
|
|
1055
|
+
},
|
|
1056
|
+
},
|
|
1057
|
+
// ── Operational commands ───────────────────────────────────────────────
|
|
1058
|
+
watch: {
|
|
1059
|
+
description: "Watch files for changes and auto-deploy",
|
|
1060
|
+
helpDescription: "Watch files for changes and auto-deploy (BPMN, DMN, forms)",
|
|
1061
|
+
helpResource: "[path...]",
|
|
1062
|
+
hasDetailedHelp: true,
|
|
1063
|
+
helpFooterLabel: "Show watch command with all flags",
|
|
1064
|
+
mutating: false,
|
|
1065
|
+
requiresResource: false,
|
|
1066
|
+
helpExamples: [
|
|
1067
|
+
{
|
|
1068
|
+
command: "c8ctl watch ./src",
|
|
1069
|
+
description: "Watch directory for changes",
|
|
1070
|
+
},
|
|
1071
|
+
],
|
|
1072
|
+
resources: [],
|
|
1073
|
+
flags: {
|
|
1074
|
+
force: {
|
|
1075
|
+
type: "boolean",
|
|
1076
|
+
description: "Continue watching after all deployment errors",
|
|
1077
|
+
},
|
|
1078
|
+
},
|
|
1079
|
+
aliases: ["w"],
|
|
1080
|
+
},
|
|
1081
|
+
open: {
|
|
1082
|
+
description: "Open Camunda web application in browser",
|
|
1083
|
+
helpDescription: "Open Camunda web app in browser",
|
|
1084
|
+
helpResource: "<app>",
|
|
1085
|
+
hasDetailedHelp: true,
|
|
1086
|
+
helpFooterLabel: "Show open command with all apps",
|
|
1087
|
+
mutating: false,
|
|
1088
|
+
requiresResource: true,
|
|
1089
|
+
helpExamples: [
|
|
1090
|
+
{
|
|
1091
|
+
command: "c8ctl open operate",
|
|
1092
|
+
description: "Open Camunda Operate in browser",
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
command: "c8ctl open tasklist",
|
|
1096
|
+
description: "Open Camunda Tasklist in browser",
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
command: "c8ctl open operate --profile=prod",
|
|
1100
|
+
description: "Open Operate using a specific profile",
|
|
1101
|
+
},
|
|
1102
|
+
],
|
|
1103
|
+
resources: ["operate", "tasklist", "modeler", "optimize"],
|
|
1104
|
+
flags: {},
|
|
1105
|
+
},
|
|
1106
|
+
// ── Profile & plugin management ────────────────────────────────────────
|
|
1107
|
+
add: {
|
|
1108
|
+
description: "Add a profile",
|
|
1109
|
+
mutating: false,
|
|
1110
|
+
requiresResource: true,
|
|
1111
|
+
resources: ["profile"],
|
|
1112
|
+
flags: { ...PROFILE_CONNECTION_FLAGS },
|
|
1113
|
+
resourcePositionals: {
|
|
1114
|
+
profile: [
|
|
1115
|
+
{ name: "name", required: true },
|
|
1116
|
+
],
|
|
1117
|
+
},
|
|
1118
|
+
},
|
|
1119
|
+
remove: {
|
|
1120
|
+
description: "Remove a profile or plugin",
|
|
1121
|
+
helpResource: "profile <name>",
|
|
1122
|
+
helpDescription: "Remove a profile (alias: rm)",
|
|
1123
|
+
mutating: false,
|
|
1124
|
+
requiresResource: true,
|
|
1125
|
+
resources: ["profile", "plugin"],
|
|
1126
|
+
flags: {
|
|
1127
|
+
none: {
|
|
1128
|
+
type: "boolean",
|
|
1129
|
+
description: "Clear active profile",
|
|
1130
|
+
},
|
|
1131
|
+
},
|
|
1132
|
+
aliases: ["rm"],
|
|
1133
|
+
resourcePositionals: {
|
|
1134
|
+
profile: [
|
|
1135
|
+
{ name: "name", required: true },
|
|
1136
|
+
],
|
|
1137
|
+
plugin: [
|
|
1138
|
+
{ name: "package", required: true },
|
|
1139
|
+
],
|
|
1140
|
+
},
|
|
1141
|
+
},
|
|
1142
|
+
load: {
|
|
1143
|
+
description: "Load a c8ctl plugin",
|
|
1144
|
+
helpResource: "plugin [name|--from url]",
|
|
1145
|
+
helpDescription: "Load a c8ctl plugin (npm registry or URL)",
|
|
1146
|
+
mutating: false,
|
|
1147
|
+
requiresResource: true,
|
|
1148
|
+
helpExamples: [
|
|
1149
|
+
{
|
|
1150
|
+
command: "c8ctl load plugin my-plugin",
|
|
1151
|
+
description: "Load plugin from npm registry",
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
command: "c8ctl load plugin --from https://github.com/org/plugin",
|
|
1155
|
+
description: "Load plugin from URL",
|
|
1156
|
+
},
|
|
1157
|
+
],
|
|
1158
|
+
resources: ["plugin"],
|
|
1159
|
+
flags: {
|
|
1160
|
+
from: {
|
|
1161
|
+
type: "string",
|
|
1162
|
+
description: "Load plugin from URL",
|
|
1163
|
+
showInTopLevelHelp: true,
|
|
1164
|
+
helpHint: "use with 'load plugin'",
|
|
1165
|
+
},
|
|
1166
|
+
},
|
|
1167
|
+
resourcePositionals: {
|
|
1168
|
+
plugin: [
|
|
1169
|
+
{ name: "package", required: false },
|
|
1170
|
+
],
|
|
1171
|
+
},
|
|
1172
|
+
},
|
|
1173
|
+
unload: {
|
|
1174
|
+
description: "Unload a c8ctl plugin",
|
|
1175
|
+
helpResource: "plugin <name>",
|
|
1176
|
+
helpDescription: "Unload a c8ctl plugin (npm uninstall wrapper)",
|
|
1177
|
+
mutating: false,
|
|
1178
|
+
requiresResource: true,
|
|
1179
|
+
resources: ["plugin"],
|
|
1180
|
+
flags: {
|
|
1181
|
+
force: {
|
|
1182
|
+
type: "boolean",
|
|
1183
|
+
description: "Force unload without confirmation",
|
|
1184
|
+
},
|
|
1185
|
+
},
|
|
1186
|
+
aliases: ["rm"],
|
|
1187
|
+
resourcePositionals: {
|
|
1188
|
+
plugin: [
|
|
1189
|
+
{ name: "package", required: true },
|
|
1190
|
+
],
|
|
1191
|
+
},
|
|
1192
|
+
},
|
|
1193
|
+
upgrade: {
|
|
1194
|
+
description: "Upgrade a plugin",
|
|
1195
|
+
helpResource: "plugin <name> [version]",
|
|
1196
|
+
helpDescription: "Upgrade a plugin (respects source type)",
|
|
1197
|
+
mutating: false,
|
|
1198
|
+
requiresResource: true,
|
|
1199
|
+
helpExamples: [
|
|
1200
|
+
{
|
|
1201
|
+
command: "c8ctl upgrade plugin my-plugin",
|
|
1202
|
+
description: "Upgrade plugin to latest version",
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
command: "c8ctl upgrade plugin my-plugin 1.2.3",
|
|
1206
|
+
description: "Upgrade plugin to a specific version (source-aware)",
|
|
1207
|
+
},
|
|
1208
|
+
],
|
|
1209
|
+
resources: ["plugin"],
|
|
1210
|
+
flags: {},
|
|
1211
|
+
resourcePositionals: {
|
|
1212
|
+
plugin: [
|
|
1213
|
+
{ name: "package", required: true },
|
|
1214
|
+
{ name: "version", required: false },
|
|
1215
|
+
],
|
|
1216
|
+
},
|
|
1217
|
+
},
|
|
1218
|
+
downgrade: {
|
|
1219
|
+
description: "Downgrade a plugin to a specific version",
|
|
1220
|
+
helpResource: "plugin <name> <version>",
|
|
1221
|
+
mutating: false,
|
|
1222
|
+
requiresResource: true,
|
|
1223
|
+
resources: ["plugin"],
|
|
1224
|
+
flags: {},
|
|
1225
|
+
resourcePositionals: {
|
|
1226
|
+
plugin: [
|
|
1227
|
+
{ name: "package", required: true },
|
|
1228
|
+
{ name: "version", required: true },
|
|
1229
|
+
],
|
|
1230
|
+
},
|
|
1231
|
+
},
|
|
1232
|
+
sync: {
|
|
1233
|
+
description: "Synchronize plugins",
|
|
1234
|
+
helpDescription: "Synchronize plugins from registry (rebuild/reinstall)",
|
|
1235
|
+
mutating: false,
|
|
1236
|
+
requiresResource: true,
|
|
1237
|
+
helpExamples: [
|
|
1238
|
+
{ command: "c8ctl sync plugin", description: "Synchronize plugins" },
|
|
1239
|
+
],
|
|
1240
|
+
resources: ["plugin"],
|
|
1241
|
+
flags: {},
|
|
1242
|
+
},
|
|
1243
|
+
init: {
|
|
1244
|
+
description: "Create a new plugin from TypeScript template",
|
|
1245
|
+
mutating: false,
|
|
1246
|
+
requiresResource: true,
|
|
1247
|
+
helpExamples: [
|
|
1248
|
+
{
|
|
1249
|
+
command: "c8ctl init plugin my-plugin",
|
|
1250
|
+
description: "Create new plugin from template (c8ctl-plugin-my-plugin)",
|
|
1251
|
+
},
|
|
1252
|
+
],
|
|
1253
|
+
resources: ["plugin"],
|
|
1254
|
+
flags: {},
|
|
1255
|
+
resourcePositionals: {
|
|
1256
|
+
plugin: [
|
|
1257
|
+
{ name: "name", required: false },
|
|
1258
|
+
],
|
|
1259
|
+
},
|
|
1260
|
+
},
|
|
1261
|
+
// ── Session commands ───────────────────────────────────────────────────
|
|
1262
|
+
use: {
|
|
1263
|
+
description: "Set active profile or tenant",
|
|
1264
|
+
helpResource: "profile|tenant",
|
|
1265
|
+
mutating: false,
|
|
1266
|
+
requiresResource: true,
|
|
1267
|
+
helpExamples: [
|
|
1268
|
+
{ command: "c8ctl use profile prod", description: "Set active profile" },
|
|
1269
|
+
],
|
|
1270
|
+
resources: ["profile", "tenant"],
|
|
1271
|
+
flags: {
|
|
1272
|
+
none: {
|
|
1273
|
+
type: "boolean",
|
|
1274
|
+
description: "Clear active profile/tenant",
|
|
1275
|
+
},
|
|
1276
|
+
},
|
|
1277
|
+
resourcePositionals: {
|
|
1278
|
+
profile: [
|
|
1279
|
+
{ name: "name", required: false },
|
|
1280
|
+
],
|
|
1281
|
+
tenant: [
|
|
1282
|
+
{ name: "tenantId", required: true },
|
|
1283
|
+
],
|
|
1284
|
+
},
|
|
1285
|
+
},
|
|
1286
|
+
output: {
|
|
1287
|
+
description: "Show or set output format",
|
|
1288
|
+
helpResource: "[json|text]",
|
|
1289
|
+
mutating: false,
|
|
1290
|
+
requiresResource: false,
|
|
1291
|
+
helpExamples: [
|
|
1292
|
+
{ command: "c8ctl output json", description: "Switch to JSON output" },
|
|
1293
|
+
],
|
|
1294
|
+
resources: ["json", "text"],
|
|
1295
|
+
flags: {},
|
|
1296
|
+
},
|
|
1297
|
+
// ── Utility commands ───────────────────────────────────────────────────
|
|
1298
|
+
completion: {
|
|
1299
|
+
description: "Generate shell completion script",
|
|
1300
|
+
helpResource: "bash|zsh|fish|install",
|
|
1301
|
+
mutating: true,
|
|
1302
|
+
requiresResource: false,
|
|
1303
|
+
helpExamples: [
|
|
1304
|
+
{
|
|
1305
|
+
command: "c8ctl completion bash",
|
|
1306
|
+
description: "Generate bash completion script",
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
command: "c8ctl completion install",
|
|
1310
|
+
description: "Auto-detect shell and install completions (auto-refreshes on upgrade)",
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
command: "c8ctl completion install --shell zsh",
|
|
1314
|
+
description: "Install completions for a specific shell",
|
|
1315
|
+
},
|
|
1316
|
+
],
|
|
1317
|
+
resources: ["bash", "zsh", "fish", "install"],
|
|
1318
|
+
flags: {},
|
|
1319
|
+
resourceFlags: {
|
|
1320
|
+
install: {
|
|
1321
|
+
shell: {
|
|
1322
|
+
type: "string",
|
|
1323
|
+
description: "Shell to install completions for (bash, zsh, fish)",
|
|
1324
|
+
},
|
|
1325
|
+
},
|
|
1326
|
+
},
|
|
1327
|
+
},
|
|
1328
|
+
"mcp-proxy": {
|
|
1329
|
+
description: "Start a STDIO to remote HTTP MCP proxy server",
|
|
1330
|
+
helpDescription: "Start a STDIO MCP proxy (bridges local MCP clients to remote Camunda 8)",
|
|
1331
|
+
helpResource: "[mcp-path]",
|
|
1332
|
+
hasDetailedHelp: true,
|
|
1333
|
+
helpFooterLabel: "Show mcp-proxy setup and usage",
|
|
1334
|
+
mutating: false,
|
|
1335
|
+
requiresResource: false,
|
|
1336
|
+
resources: [],
|
|
1337
|
+
flags: {},
|
|
1338
|
+
},
|
|
1339
|
+
feedback: {
|
|
1340
|
+
description: "Open the feedback page to report issues or request features",
|
|
1341
|
+
mutating: false,
|
|
1342
|
+
requiresResource: false,
|
|
1343
|
+
resources: [],
|
|
1344
|
+
flags: {},
|
|
1345
|
+
},
|
|
1346
|
+
help: {
|
|
1347
|
+
description: "Show help",
|
|
1348
|
+
helpResource: "[command]",
|
|
1349
|
+
helpDescription: "Show help (run 'c8ctl help <command>' for details)",
|
|
1350
|
+
mutating: false,
|
|
1351
|
+
requiresResource: false,
|
|
1352
|
+
resources: [],
|
|
1353
|
+
flags: {},
|
|
1354
|
+
aliases: ["menu"],
|
|
1355
|
+
},
|
|
1356
|
+
which: {
|
|
1357
|
+
description: "Show active profile",
|
|
1358
|
+
mutating: false,
|
|
1359
|
+
requiresResource: true,
|
|
1360
|
+
helpExamples: [
|
|
1361
|
+
{
|
|
1362
|
+
command: "c8ctl which profile",
|
|
1363
|
+
description: "Show currently active profile",
|
|
1364
|
+
},
|
|
1365
|
+
],
|
|
1366
|
+
resources: ["profile"],
|
|
1367
|
+
flags: {},
|
|
1368
|
+
},
|
|
1369
|
+
};
|
|
1370
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
1371
|
+
/**
|
|
1372
|
+
* Maps verb aliases to their canonical verb names.
|
|
1373
|
+
* Built from COMMAND_REGISTRY aliases fields.
|
|
1374
|
+
* e.g. { "rm": ["remove", "unload"], "w": ["watch"] }
|
|
1375
|
+
*/
|
|
1376
|
+
export const VERB_ALIASES = (() => {
|
|
1377
|
+
const map = {};
|
|
1378
|
+
// biome-ignore lint/plugin: widen to CommandDef to access optional aliases property
|
|
1379
|
+
for (const [verb, def] of Object.entries(COMMAND_REGISTRY)) {
|
|
1380
|
+
for (const alias of def.aliases ?? []) {
|
|
1381
|
+
if (!map[alias]) {
|
|
1382
|
+
map[alias] = [];
|
|
1383
|
+
}
|
|
1384
|
+
map[alias].push(verb);
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
return map;
|
|
1388
|
+
})();
|
|
1389
|
+
/**
|
|
1390
|
+
* Resolve a resource alias to its canonical form.
|
|
1391
|
+
* Returns the input unchanged if no alias exists.
|
|
1392
|
+
*/
|
|
1393
|
+
export function resolveAlias(resource) {
|
|
1394
|
+
return RESOURCE_ALIASES[resource] ?? resource;
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* Look up a command definition by verb (resolves verb aliases).
|
|
1398
|
+
* For alias verbs that map to multiple commands (e.g. "rm" → remove + unload),
|
|
1399
|
+
* returns the first match. Use VERB_ALIASES directly for multi-target aliases.
|
|
1400
|
+
*/
|
|
1401
|
+
export function getCommandDef(verb) {
|
|
1402
|
+
// biome-ignore lint/plugin: trust boundary — verb is unvalidated CLI input, must index dynamically
|
|
1403
|
+
const direct = COMMAND_REGISTRY[verb];
|
|
1404
|
+
if (direct)
|
|
1405
|
+
return direct;
|
|
1406
|
+
const targets = VERB_ALIASES[verb];
|
|
1407
|
+
return targets
|
|
1408
|
+
? // biome-ignore lint/plugin: trust boundary — alias target is a dynamic string
|
|
1409
|
+
COMMAND_REGISTRY[targets[0]]
|
|
1410
|
+
: undefined;
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Get all flags accepted for a given verb, including global flags.
|
|
1414
|
+
*/
|
|
1415
|
+
export function getAcceptedFlags(verb) {
|
|
1416
|
+
const def = getCommandDef(verb);
|
|
1417
|
+
if (!def)
|
|
1418
|
+
return undefined;
|
|
1419
|
+
return { ...GLOBAL_FLAGS, ...def.flags };
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Check whether a verb×resource combination is valid.
|
|
1423
|
+
* Accepts both raw aliases and canonical resource names.
|
|
1424
|
+
*/
|
|
1425
|
+
export function isValidCommand(verb, resource) {
|
|
1426
|
+
const def = getCommandDef(verb);
|
|
1427
|
+
if (!def)
|
|
1428
|
+
return false;
|
|
1429
|
+
if (!def.requiresResource)
|
|
1430
|
+
return true;
|
|
1431
|
+
const canonical = resolveAlias(resource);
|
|
1432
|
+
return (def.resources.includes(resource) ||
|
|
1433
|
+
def.resources.includes(canonical) ||
|
|
1434
|
+
def.resources.some((r) => resolveAlias(r) === canonical));
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Derive parseArgs options from the registry. This produces the flat
|
|
1438
|
+
* options object that node:util parseArgs expects, covering all flags
|
|
1439
|
+
* from all commands plus global flags.
|
|
1440
|
+
*
|
|
1441
|
+
* When the same flag name appears with different types across commands
|
|
1442
|
+
* (e.g. `--variables` is boolean for `get pi` but string for `create pi`),
|
|
1443
|
+
* "string" wins because parseArgs with `type: "string"` can accept any
|
|
1444
|
+
* value, whereas `type: "boolean"` would discard the string payload.
|
|
1445
|
+
*/
|
|
1446
|
+
export function deriveParseArgsOptions() {
|
|
1447
|
+
const options = {};
|
|
1448
|
+
function addFlags(flags) {
|
|
1449
|
+
for (const [name, def] of Object.entries(flags)) {
|
|
1450
|
+
const existing = options[name];
|
|
1451
|
+
if (!existing) {
|
|
1452
|
+
options[name] = {
|
|
1453
|
+
type: def.type,
|
|
1454
|
+
...(def.short && { short: def.short }),
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
else {
|
|
1458
|
+
// String is more permissive — upgrade when any usage is string
|
|
1459
|
+
if (def.type === "string")
|
|
1460
|
+
existing.type = "string";
|
|
1461
|
+
if (def.short && !existing.short)
|
|
1462
|
+
existing.short = def.short;
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
// Global flags
|
|
1467
|
+
addFlags(GLOBAL_FLAGS);
|
|
1468
|
+
// Search flags
|
|
1469
|
+
addFlags(SEARCH_FLAGS);
|
|
1470
|
+
// All command-specific flags
|
|
1471
|
+
for (const cmd of Object.values(COMMAND_REGISTRY)) {
|
|
1472
|
+
addFlags(cmd.flags);
|
|
1473
|
+
// Include resource-specific flags so parseArgs can parse them
|
|
1474
|
+
if ("resourceFlags" in cmd && cmd.resourceFlags) {
|
|
1475
|
+
for (const rFlags of Object.values(cmd.resourceFlags)) {
|
|
1476
|
+
addFlags(rFlags);
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
return options;
|
|
1481
|
+
}
|
|
1482
|
+
//# sourceMappingURL=command-registry.js.map
|