@camunda8/cli 2.0.0-alpha.4 → 2.0.0-alpha.6

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 CHANGED
@@ -64,56 +64,54 @@ After installation, the CLI is available as `c8ctl` (or its alias `c8`).
64
64
 
65
65
  ## Usage
66
66
 
67
- ### Basic Commands
67
+ ### Getting Help
68
68
 
69
69
  ```bash
70
- # Show help
70
+ # Show general help
71
71
  c8ctl help
72
72
 
73
+ # Show detailed help for specific commands with all flags
74
+ c8ctl help list # Shows all list resources and their flags
75
+ c8ctl help get # Shows all get resources and their flags
76
+ c8ctl help create # Shows all create resources and their flags
77
+ c8ctl help complete # Shows all complete resources and their flags
78
+
73
79
  # Show version
74
80
  c8ctl --version
81
+ ```
75
82
 
76
- # List process instances (using alias 'pi')
77
- c8ctl list pi
78
- # Or using full command name
79
- c8ctl list process-instances
80
-
81
- # List process definitions (using alias 'pd')
82
- c8ctl list pd
83
- c8ctl list process-definitions
84
-
85
- # Get process instance by key
86
- c8ctl get pi 123456
87
- c8ctl get process-instance 123456
88
-
89
- # Get process definition by key
90
- c8ctl get pd 123456
91
- c8ctl get process-definition 123456
83
+ ### Basic Commands
92
84
 
93
- # Get process definition XML
94
- c8ctl get pd 123456 --xml
85
+ ```bash
86
+ # List and get resources (use aliases pi, pd, ut, inc for convenience)
87
+ c8ctl list pi # List process instances
88
+ c8ctl list pd # List process definitions
89
+ c8ctl get pi 123456 # Get process instance by key
90
+ c8ctl get pd 123456 --xml # Get process definition as XML
95
91
 
96
92
  # Create process instance
97
- c8ctl create pi --bpmnProcessId=myProcess
98
- c8ctl create process-instance --bpmnProcessId=myProcess
93
+ c8ctl create pi --id=myProcess
94
+ c8ctl create process-instance --id=myProcess
99
95
 
100
- # Deploy BPMN file
101
- c8ctl deploy ./my-process.bpmn
96
+ # Create process instance and wait for completion
97
+ c8ctl create pi --id=myProcess --awaitCompletion
102
98
 
103
- # Deploy current directory
104
- c8ctl deploy
99
+ # Await process instance completion (alias for create with --awaitCompletion)
100
+ c8ctl await pi --id=myProcess
101
+ c8ctl await process-instance --id=myProcess
105
102
 
106
- # Deploy from multiple paths
107
- c8ctl deploy ./processes ./forms ./building-blocks
103
+ # Cancel process instance
104
+ c8ctl cancel pi 123456
108
105
 
109
- # Watch mode (using alias 'w')
110
- c8ctl w
111
- c8ctl watch
112
-
113
- # Deploy and start process (run)
114
- c8ctl run ./my-process.bpmn
106
+ # Deploy and run
107
+ c8ctl deploy ./my-process.bpmn # Deploy a single file
108
+ c8ctl deploy # Deploy current directory
109
+ c8ctl run ./my-process.bpmn # Deploy and start process
110
+ c8ctl watch # Watch for changes and auto-deploy
115
111
  ```
116
112
 
113
+ For comprehensive examples of all commands and their flags, see [EXAMPLES.md](EXAMPLES.md).
114
+
117
115
  ### Shell Completion
118
116
 
119
117
  c8ctl supports shell completion for `bash`, `zsh`, and `fish`. To enable completion:
@@ -277,7 +275,7 @@ Debug output is written to stderr with timestamps and won't interfere with norma
277
275
 
278
276
  ### Plugin Management
279
277
 
280
- c8ctl supports a plugin system that allows extending the CLI with custom commands via npm packages.
278
+ c8ctl supports a plugin system that allows extending the CLI with custom commands via npm packages. Plugins are tracked in a registry file (`~/.config/c8ctl/plugins.json` on Linux, similar locations on other platforms) for persistence across npm operations.
281
279
 
282
280
  ```bash
283
281
  # Load a plugin from npm registry
@@ -292,13 +290,27 @@ c8ctl load plugin --from git://github.com/user/repo.git
292
290
  # Unload a plugin (wraps npm uninstall)
293
291
  c8ctl unload plugin <package-name>
294
292
 
295
- # List installed plugins
293
+ # List installed plugins (shows sync status)
296
294
  c8ctl list plugins
297
295
 
296
+ # Synchronize plugins from registry
297
+ # - First tries npm rebuild for installed plugins
298
+ # - Falls back to fresh npm install if rebuild fails
299
+ c8ctl sync plugins
300
+
298
301
  # View help including plugin commands
299
302
  c8ctl help
300
303
  ```
301
304
 
305
+ **Plugin Registry:**
306
+ - Plugins are tracked independently of `package.json` in a registry file
307
+ - The registry serves as the source of truth (local precedence)
308
+ - `c8ctl list plugins` shows sync status:
309
+ - `✓ Installed` - Plugin is in registry and installed
310
+ - `⚠ Not installed` - Plugin is in registry but not in node_modules (run `sync`)
311
+ - `⚠ Not in registry` - Plugin is in package.json but not tracked in registry
312
+ - `c8ctl sync plugins` synchronizes plugins from the registry, rebuilding or reinstalling as needed
313
+
302
314
  **Plugin Requirements:**
303
315
  - Plugin packages must be regular Node.js modules
304
316
  - They must include a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file in the root directory
@@ -344,9 +356,32 @@ When plugins are loaded, their commands automatically appear in `c8ctl help` out
344
356
  c8ctl <verb> <resource> [arguments] [flags]
345
357
  ```
346
358
 
347
- **Verbs**: list, get, create, cancel, complete, fail, activate, resolve, publish, correlate, deploy, run, add, remove, use, output
348
-
349
- **Resources**: process-instance, process-definition, user-task, incident, job, message, topology, profile, tenant
359
+ **Verbs**:
360
+ - `list` - List resources
361
+ - `get` - Get resource by key
362
+ - `create` - Create resource
363
+ - `cancel` - Cancel resource
364
+ - `complete` - Complete resource
365
+ - `fail` - Fail a job
366
+ - `activate` - Activate jobs
367
+ - `resolve` - Resolve incident
368
+ - `publish` - Publish message
369
+ - `correlate` - Correlate message
370
+ - `deploy` - Deploy BPMN/DMN/forms
371
+ - `run` - Deploy and start process
372
+ - `watch` (alias: `w`) - Watch for changes and auto-deploy
373
+ - `add` - Add a profile
374
+ - `remove` (alias: `rm`) - Remove a profile
375
+ - `load` - Load a plugin
376
+ - `unload` - Unload a plugin
377
+ - `sync` - Synchronize plugins
378
+ - `use` - Set active profile or tenant
379
+ - `output` - Set output format
380
+ - `completion` - Generate shell completion script
381
+
382
+ **Resources**: process-instance (pi), process-definition (pd), user-task (ut), incident (inc), job, jobs, message (msg), topology, profile, tenant, plugin
383
+
384
+ **Tip**: Run `c8ctl help <command>` to see detailed help for specific commands with all available flags.
350
385
 
351
386
  ## Testing
352
387
 
@@ -436,13 +471,14 @@ c8ctl <command>
436
471
 
437
472
  Configuration is stored in platform-specific user data directories:
438
473
 
439
- - **Linux**: `~/.local/share/c8ctl/`
474
+ - **Linux**: `~/.config/c8ctl/`
440
475
  - **macOS**: `~/Library/Application Support/c8ctl/`
441
476
  - **Windows**: `%APPDATA%\c8ctl\`
442
477
 
443
478
  Files:
444
479
  - `profiles.json`: Saved cluster configurations
445
480
  - `session.json`: Active profile, tenant, and output mode
481
+ - `plugins.json`: Plugin registry tracking installed plugins
446
482
 
447
483
  ### Camunda Modeler Configuration
448
484
 
@@ -1 +1 @@
1
- {"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;AA2jBH;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CA0BnD"}
1
+ {"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyoBH;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CA0BnD"}
@@ -18,13 +18,14 @@ _c8ctl_completions() {
18
18
  cword=\${COMP_CWORD}
19
19
 
20
20
  # Commands (verbs)
21
- local verbs="list get create cancel complete fail activate resolve publish correlate deploy run watch add remove rm load unload use output completion help"
21
+ local verbs="list get create cancel await complete fail activate resolve publish correlate deploy run watch add remove rm load unload sync use output completion help"
22
22
 
23
23
  # Resources by verb
24
24
  local list_resources="process-instances process-instance pi user-tasks user-task ut incidents incident inc jobs profiles profile plugins plugin"
25
- local get_resources="process-instance pi topology"
25
+ local get_resources="process-instance pi process-definition pd topology"
26
26
  local create_resources="process-instance pi"
27
27
  local cancel_resources="process-instance pi"
28
+ local await_resources="process-instance pi"
28
29
  local complete_resources="user-task ut job"
29
30
  local fail_resources="job"
30
31
  local activate_resources="jobs"
@@ -35,12 +36,14 @@ _c8ctl_completions() {
35
36
  local remove_resources="profile"
36
37
  local load_resources="plugin"
37
38
  local unload_resources="plugin"
39
+ local sync_resources="plugin plugins"
38
40
  local use_resources="profile tenant"
39
41
  local output_resources="json text"
40
42
  local completion_resources="bash zsh fish"
43
+ local help_resources="list get create complete"
41
44
 
42
45
  # Global flags
43
- local flags="--help --version --profile --from --all --bpmnProcessId --processInstanceKey --variables --state --assignee --type --correlationKey --timeToLive --maxJobsToActivate --timeout --worker --retries --errorMessage --baseUrl --clientId --clientSecret --audience --oAuthUrl --defaultTenantId --version_num"
46
+ local flags="--help --version --profile --from --all --bpmnProcessId --id --processInstanceKey --variables --state --assignee --type --correlationKey --timeToLive --maxJobsToActivate --timeout --worker --retries --errorMessage --baseUrl --clientId --clientSecret --audience --oAuthUrl --defaultTenantId --awaitCompletion --fetchVariables"
44
47
 
45
48
  case \${cword} in
46
49
  1)
@@ -63,6 +66,9 @@ _c8ctl_completions() {
63
66
  cancel)
64
67
  COMPREPLY=( \$(compgen -W "\${cancel_resources}" -- "\${cur}") )
65
68
  ;;
69
+ await)
70
+ COMPREPLY=( \$(compgen -W "\${await_resources}" -- "\${cur}") )
71
+ ;;
66
72
  complete)
67
73
  COMPREPLY=( \$(compgen -W "\${complete_resources}" -- "\${cur}") )
68
74
  ;;
@@ -93,6 +99,9 @@ _c8ctl_completions() {
93
99
  unload)
94
100
  COMPREPLY=( \$(compgen -W "\${unload_resources}" -- "\${cur}") )
95
101
  ;;
102
+ sync)
103
+ COMPREPLY=( \$(compgen -W "\${sync_resources}" -- "\${cur}") )
104
+ ;;
96
105
  use)
97
106
  COMPREPLY=( \$(compgen -W "\${use_resources}" -- "\${cur}") )
98
107
  ;;
@@ -102,6 +111,9 @@ _c8ctl_completions() {
102
111
  completion)
103
112
  COMPREPLY=( \$(compgen -W "\${completion_resources}" -- "\${cur}") )
104
113
  ;;
114
+ help)
115
+ COMPREPLY=( \$(compgen -W "\${help_resources}" -- "\${cur}") )
116
+ ;;
105
117
  deploy|run|watch)
106
118
  # Complete with files
107
119
  COMPREPLY=( \$(compgen -f -- "\${cur}") )
@@ -137,6 +149,7 @@ _c8ctl() {
137
149
  'get:Get resource by key'
138
150
  'create:Create resource'
139
151
  'cancel:Cancel resource'
152
+ 'await:Await resource completion'
140
153
  'complete:Complete resource'
141
154
  'fail:Fail a job'
142
155
  'activate:Activate jobs by type'
@@ -151,10 +164,11 @@ _c8ctl() {
151
164
  'rm:Remove a profile'
152
165
  'load:Load a c8ctl plugin'
153
166
  'unload:Unload a c8ctl plugin'
167
+ 'sync:Synchronize plugins from registry'
154
168
  'use:Set active profile or tenant'
155
169
  'output:Set output format'
156
170
  'completion:Generate shell completion script'
157
- 'help:Show help'
171
+ 'help:Show help or detailed help for a command'
158
172
  )
159
173
 
160
174
  flags=(
@@ -166,6 +180,7 @@ _c8ctl() {
166
180
  '--from[Load plugin from URL]:url:'
167
181
  '--all[Show all results]'
168
182
  '--bpmnProcessId[Process definition ID]:id:'
183
+ '--id[Process definition ID (alias for --bpmnProcessId)]:id:'
169
184
  '--processInstanceKey[Process instance key]:key:'
170
185
  '--variables[JSON variables]:json:'
171
186
  '--state[Filter by state]:state:'
@@ -184,7 +199,9 @@ _c8ctl() {
184
199
  '--audience[OAuth audience]:audience:'
185
200
  '--oAuthUrl[OAuth token endpoint]:url:'
186
201
  '--defaultTenantId[Default tenant ID]:id:'
187
- '--version_num[Process definition version]:version:'
202
+ '--version[Process definition version]:version:'
203
+ '--awaitCompletion[Wait for process instance to complete]'
204
+ '--fetchVariables[Comma-separated variable names]:variables:'
188
205
  )
189
206
 
190
207
  case \$CURRENT in
@@ -216,6 +233,8 @@ _c8ctl() {
216
233
  resources=(
217
234
  'process-instance:Get process instance'
218
235
  'pi:Get process instance'
236
+ 'process-definition:Get process definition'
237
+ 'pd:Get process definition'
219
238
  'topology:Get cluster topology'
220
239
  )
221
240
  _describe 'resource' resources
@@ -234,6 +253,13 @@ _c8ctl() {
234
253
  )
235
254
  _describe 'resource' resources
236
255
  ;;
256
+ await)
257
+ resources=(
258
+ 'process-instance:Await process instance completion'
259
+ 'pi:Await process instance completion'
260
+ )
261
+ _describe 'resource' resources
262
+ ;;
237
263
  complete)
238
264
  resources=(
239
265
  'user-task:Complete user task'
@@ -299,6 +325,13 @@ _c8ctl() {
299
325
  )
300
326
  _describe 'resource' resources
301
327
  ;;
328
+ sync)
329
+ resources=(
330
+ 'plugin:Synchronize plugin'
331
+ 'plugins:Synchronize plugins'
332
+ )
333
+ _describe 'resource' resources
334
+ ;;
302
335
  use)
303
336
  resources=(
304
337
  'profile:Set active profile'
@@ -321,6 +354,15 @@ _c8ctl() {
321
354
  )
322
355
  _describe 'resource' resources
323
356
  ;;
357
+ help)
358
+ resources=(
359
+ 'list:Show list command help'
360
+ 'get:Show get command help'
361
+ 'create:Show create command help'
362
+ 'complete:Show complete command help'
363
+ )
364
+ _describe 'resource' resources
365
+ ;;
324
366
  deploy|run|watch)
325
367
  _files
326
368
  ;;
@@ -358,6 +400,8 @@ complete -c c8ctl -l all -d 'Show all results'
358
400
  complete -c c8 -l all -d 'Show all results'
359
401
  complete -c c8ctl -l bpmnProcessId -d 'Process definition ID' -r
360
402
  complete -c c8 -l bpmnProcessId -d 'Process definition ID' -r
403
+ complete -c c8ctl -l id -d 'Process definition ID (alias for --bpmnProcessId)' -r
404
+ complete -c c8 -l id -d 'Process definition ID (alias for --bpmnProcessId)' -r
361
405
  complete -c c8ctl -l processInstanceKey -d 'Process instance key' -r
362
406
  complete -c c8 -l processInstanceKey -d 'Process instance key' -r
363
407
  complete -c c8ctl -l variables -d 'JSON variables' -r
@@ -394,8 +438,12 @@ complete -c c8ctl -l oAuthUrl -d 'OAuth token endpoint' -r
394
438
  complete -c c8 -l oAuthUrl -d 'OAuth token endpoint' -r
395
439
  complete -c c8ctl -l defaultTenantId -d 'Default tenant ID' -r
396
440
  complete -c c8 -l defaultTenantId -d 'Default tenant ID' -r
397
- complete -c c8ctl -l version_num -d 'Process definition version' -r
398
- complete -c c8 -l version_num -d 'Process definition version' -r
441
+ complete -c c8ctl -l version -d 'Process definition version' -r
442
+ complete -c c8 -l version -d 'Process definition version' -r
443
+ complete -c c8ctl -l awaitCompletion -d 'Wait for process instance to complete'
444
+ complete -c c8 -l awaitCompletion -d 'Wait for process instance to complete'
445
+ complete -c c8ctl -l fetchVariables -d 'Comma-separated variable names' -r
446
+ complete -c c8 -l fetchVariables -d 'Comma-separated variable names' -r
399
447
 
400
448
  # Commands (verbs) - only suggest when no command is given yet
401
449
  complete -c c8ctl -n '__fish_use_subcommand' -a 'list' -d 'List resources'
@@ -406,6 +454,8 @@ complete -c c8ctl -n '__fish_use_subcommand' -a 'create' -d 'Create resource'
406
454
  complete -c c8 -n '__fish_use_subcommand' -a 'create' -d 'Create resource'
407
455
  complete -c c8ctl -n '__fish_use_subcommand' -a 'cancel' -d 'Cancel resource'
408
456
  complete -c c8 -n '__fish_use_subcommand' -a 'cancel' -d 'Cancel resource'
457
+ complete -c c8ctl -n '__fish_use_subcommand' -a 'await' -d 'Await resource completion'
458
+ complete -c c8 -n '__fish_use_subcommand' -a 'await' -d 'Await resource completion'
409
459
  complete -c c8ctl -n '__fish_use_subcommand' -a 'complete' -d 'Complete resource'
410
460
  complete -c c8 -n '__fish_use_subcommand' -a 'complete' -d 'Complete resource'
411
461
  complete -c c8ctl -n '__fish_use_subcommand' -a 'fail' -d 'Fail a job'
@@ -434,12 +484,14 @@ complete -c c8ctl -n '__fish_use_subcommand' -a 'load' -d 'Load a c8ctl plugin'
434
484
  complete -c c8 -n '__fish_use_subcommand' -a 'load' -d 'Load a c8ctl plugin'
435
485
  complete -c c8ctl -n '__fish_use_subcommand' -a 'unload' -d 'Unload a c8ctl plugin'
436
486
  complete -c c8 -n '__fish_use_subcommand' -a 'unload' -d 'Unload a c8ctl plugin'
487
+ complete -c c8ctl -n '__fish_use_subcommand' -a 'sync' -d 'Synchronize plugins from registry'
488
+ complete -c c8 -n '__fish_use_subcommand' -a 'sync' -d 'Synchronize plugins from registry'
437
489
  complete -c c8ctl -n '__fish_use_subcommand' -a 'use' -d 'Set active profile or tenant'
438
490
  complete -c c8 -n '__fish_use_subcommand' -a 'use' -d 'Set active profile or tenant'
439
491
  complete -c c8ctl -n '__fish_use_subcommand' -a 'output' -d 'Set output format'
440
492
  complete -c c8 -n '__fish_use_subcommand' -a 'output' -d 'Set output format'
441
- complete -c c8ctl -n '__fish_use_subcommand' -a 'help' -d 'Show help'
442
- complete -c c8 -n '__fish_use_subcommand' -a 'help' -d 'Show help'
493
+ complete -c c8ctl -n '__fish_use_subcommand' -a 'help' -d 'Show help or detailed help for a command'
494
+ complete -c c8 -n '__fish_use_subcommand' -a 'help' -d 'Show help or detailed help for a command'
443
495
  complete -c c8ctl -n '__fish_use_subcommand' -a 'completion' -d 'Generate shell completion script'
444
496
  complete -c c8 -n '__fish_use_subcommand' -a 'completion' -d 'Generate shell completion script'
445
497
 
@@ -478,6 +530,10 @@ complete -c c8ctl -n '__fish_seen_subcommand_from get' -a 'process-instance' -d
478
530
  complete -c c8 -n '__fish_seen_subcommand_from get' -a 'process-instance' -d 'Get process instance'
479
531
  complete -c c8ctl -n '__fish_seen_subcommand_from get' -a 'pi' -d 'Get process instance'
480
532
  complete -c c8 -n '__fish_seen_subcommand_from get' -a 'pi' -d 'Get process instance'
533
+ complete -c c8ctl -n '__fish_seen_subcommand_from get' -a 'process-definition' -d 'Get process definition'
534
+ complete -c c8 -n '__fish_seen_subcommand_from get' -a 'process-definition' -d 'Get process definition'
535
+ complete -c c8ctl -n '__fish_seen_subcommand_from get' -a 'pd' -d 'Get process definition'
536
+ complete -c c8 -n '__fish_seen_subcommand_from get' -a 'pd' -d 'Get process definition'
481
537
  complete -c c8ctl -n '__fish_seen_subcommand_from get' -a 'topology' -d 'Get cluster topology'
482
538
  complete -c c8 -n '__fish_seen_subcommand_from get' -a 'topology' -d 'Get cluster topology'
483
539
 
@@ -493,6 +549,12 @@ complete -c c8 -n '__fish_seen_subcommand_from cancel' -a 'process-instance' -d
493
549
  complete -c c8ctl -n '__fish_seen_subcommand_from cancel' -a 'pi' -d 'Cancel process instance'
494
550
  complete -c c8 -n '__fish_seen_subcommand_from cancel' -a 'pi' -d 'Cancel process instance'
495
551
 
552
+ # Resources for 'await' command
553
+ complete -c c8ctl -n '__fish_seen_subcommand_from await' -a 'process-instance' -d 'Await process instance completion'
554
+ complete -c c8 -n '__fish_seen_subcommand_from await' -a 'process-instance' -d 'Await process instance completion'
555
+ complete -c c8ctl -n '__fish_seen_subcommand_from await' -a 'pi' -d 'Await process instance completion'
556
+ complete -c c8 -n '__fish_seen_subcommand_from await' -a 'pi' -d 'Await process instance completion'
557
+
496
558
  # Resources for 'complete' command
497
559
  complete -c c8ctl -n '__fish_seen_subcommand_from complete' -a 'user-task' -d 'Complete user task'
498
560
  complete -c c8 -n '__fish_seen_subcommand_from complete' -a 'user-task' -d 'Complete user task'
@@ -545,6 +607,12 @@ complete -c c8 -n '__fish_seen_subcommand_from load' -a 'plugin' -d 'Load plugin
545
607
  complete -c c8ctl -n '__fish_seen_subcommand_from unload' -a 'plugin' -d 'Unload plugin'
546
608
  complete -c c8 -n '__fish_seen_subcommand_from unload' -a 'plugin' -d 'Unload plugin'
547
609
 
610
+ # Resources for 'sync' command
611
+ complete -c c8ctl -n '__fish_seen_subcommand_from sync' -a 'plugin' -d 'Synchronize plugin'
612
+ complete -c c8 -n '__fish_seen_subcommand_from sync' -a 'plugin' -d 'Synchronize plugin'
613
+ complete -c c8ctl -n '__fish_seen_subcommand_from sync' -a 'plugins' -d 'Synchronize plugins'
614
+ complete -c c8 -n '__fish_seen_subcommand_from sync' -a 'plugins' -d 'Synchronize plugins'
615
+
548
616
  # Resources for 'use' command
549
617
  complete -c c8ctl -n '__fish_seen_subcommand_from use' -a 'profile' -d 'Set active profile'
550
618
  complete -c c8 -n '__fish_seen_subcommand_from use' -a 'profile' -d 'Set active profile'
@@ -564,6 +632,16 @@ complete -c c8ctl -n '__fish_seen_subcommand_from completion' -a 'zsh' -d 'Gener
564
632
  complete -c c8 -n '__fish_seen_subcommand_from completion' -a 'zsh' -d 'Generate zsh completion'
565
633
  complete -c c8ctl -n '__fish_seen_subcommand_from completion' -a 'fish' -d 'Generate fish completion'
566
634
  complete -c c8 -n '__fish_seen_subcommand_from completion' -a 'fish' -d 'Generate fish completion'
635
+
636
+ # Resources for 'help' command
637
+ complete -c c8ctl -n '__fish_seen_subcommand_from help' -a 'list' -d 'Show list command help'
638
+ complete -c c8 -n '__fish_seen_subcommand_from help' -a 'list' -d 'Show list command help'
639
+ complete -c c8ctl -n '__fish_seen_subcommand_from help' -a 'get' -d 'Show get command help'
640
+ complete -c c8 -n '__fish_seen_subcommand_from help' -a 'get' -d 'Show get command help'
641
+ complete -c c8ctl -n '__fish_seen_subcommand_from help' -a 'create' -d 'Show create command help'
642
+ complete -c c8 -n '__fish_seen_subcommand_from help' -a 'create' -d 'Show create command help'
643
+ complete -c c8ctl -n '__fish_seen_subcommand_from help' -a 'complete' -d 'Show complete command help'
644
+ complete -c c8 -n '__fish_seen_subcommand_from help' -a 'complete' -d 'Show complete command help'
567
645
  `;
568
646
  }
569
647
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,SAAS,sBAAsB;IAC7B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmHR,CAAC;AACF,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB;IAC5B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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QACX,MAAM,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAE5C,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,MAAM;YACT,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,CAAC,CAAC;YACtC,MAAM;QACR,KAAK,KAAK;YACR,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC;YACrC,MAAM;QACR,KAAK,MAAM;YACT,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,CAAC,CAAC;YACtC,MAAM;QACR;YACE,MAAM,CAAC,KAAK,CAAC,kBAAkB,KAAK,EAAE,CAAC,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;YACjD,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/commands/deployments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgMH;;GAEG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgMhB"}
1
+ {"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/commands/deployments.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgMH;;GAEG;AACH,wBAAsB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+KhB"}
@@ -167,8 +167,8 @@ export async function deploy(paths, options) {
167
167
  const logger = getLogger();
168
168
  const client = createClient(options.profile);
169
169
  const tenantId = resolveTenantId(options.profile);
170
+ const resources = [];
170
171
  try {
171
- const resources = [];
172
172
  // Store the base paths for relative path calculation
173
173
  const basePaths = paths.length === 0 ? [process.cwd()] : paths;
174
174
  if (paths.length === 0) {
@@ -318,24 +318,145 @@ export async function deploy(paths, options) {
318
318
  }
319
319
  }
320
320
  catch (error) {
321
- // Log detailed error information
322
- if (error && typeof error === 'object') {
323
- const err = error;
324
- logger.error('Failed to deploy resources', error);
325
- if (err.response) {
326
- console.error('API Response:', err.response);
327
- }
328
- if (err.message) {
329
- console.error('Error message:', err.message);
330
- }
331
- if (err.cause) {
332
- console.error('Error cause:', err.cause);
321
+ handleDeploymentError(error, resources, logger);
322
+ }
323
+ }
324
+ /**
325
+ * Format and display deployment errors with actionable guidance
326
+ */
327
+ function handleDeploymentError(error, resources, logger) {
328
+ const raw = (error && typeof error === 'object') ? error : {};
329
+ // Try to interpret common transport/network issues first for actionable guidance
330
+ const deriveNetworkErrorTitle = (err) => {
331
+ const anyErr = err;
332
+ const code = typeof anyErr?.code === 'string'
333
+ ? anyErr.code
334
+ : (typeof anyErr?.cause?.code === 'string'
335
+ ? anyErr.cause.code
336
+ : undefined);
337
+ if (!code && typeof anyErr?.name === 'string') {
338
+ // Handle fetch/abort style errors
339
+ if (anyErr.name === 'AbortError') {
340
+ return 'Request to Camunda cluster timed out or was aborted. Please check your network connection and try again.';
333
341
  }
334
342
  }
343
+ switch (code) {
344
+ case 'ECONNREFUSED':
345
+ return 'Cannot connect to Camunda cluster (connection refused). Verify the endpoint URL and that the cluster is reachable.';
346
+ case 'ENOTFOUND':
347
+ return 'Cannot resolve Camunda cluster host. Check the cluster URL and your DNS/network configuration.';
348
+ case 'EHOSTUNREACH':
349
+ return 'Camunda cluster host is unreachable. Check VPN/proxy settings and your network connectivity.';
350
+ case 'ECONNRESET':
351
+ return 'Connection to Camunda cluster was reset. Retry the operation and check for intermittent network issues.';
352
+ case 'ETIMEDOUT':
353
+ return 'Request to Camunda cluster timed out. Check your network connection and consider retrying.';
354
+ default:
355
+ return undefined;
356
+ }
357
+ };
358
+ // Extract RFC 9457 Problem Detail fields and other useful signals
359
+ const problemTitle = typeof raw.title === 'string' ? raw.title : undefined;
360
+ const networkTitle = deriveNetworkErrorTitle(error);
361
+ const errorInstanceTitle = error instanceof Error && typeof error.message === 'string' && error.message
362
+ ? error.message
363
+ : undefined;
364
+ const messageFieldTitle = typeof raw.message === 'string' ? raw.message : undefined;
365
+ const title = problemTitle ??
366
+ networkTitle ??
367
+ errorInstanceTitle ??
368
+ messageFieldTitle ??
369
+ 'Unknown error (unexpected error format; re-run with increased logging or check network configuration).';
370
+ const detail = typeof raw.detail === 'string' ? raw.detail : undefined;
371
+ const status = typeof raw.status === 'number' ? raw.status : undefined;
372
+ // Display the main error
373
+ logger.error('Deployment failed', new Error(title));
374
+ // Display the detailed error message if available
375
+ if (detail) {
376
+ console.error('\n' + formatDeploymentErrorDetail(detail));
377
+ }
378
+ // Provide actionable hints based on error type
379
+ console.error('');
380
+ printDeploymentHints(title, detail, status, resources);
381
+ process.exit(1);
382
+ }
383
+ /**
384
+ * Format the error detail for better readability
385
+ */
386
+ function formatDeploymentErrorDetail(detail) {
387
+ // The detail often contains embedded newlines, format them nicely
388
+ const lines = detail.split('\n').map(line => line.trim()).filter(Boolean);
389
+ // Find the main message and the file-specific errors
390
+ const result = [];
391
+ let inFileError = false;
392
+ for (const line of lines) {
393
+ if (line.startsWith("'") && (line.includes('.bpmn') || line.includes('.dmn') || line.includes('.form'))) {
394
+ // This is a file-specific error
395
+ inFileError = true;
396
+ result.push(` 📄 ${line}`);
397
+ }
398
+ else if (line.startsWith('- Element:')) {
399
+ result.push(` ${line}`);
400
+ }
401
+ else if (line.startsWith('- ERROR:') || line.startsWith('- WARNING:')) {
402
+ const icon = line.startsWith('- ERROR:') ? '❌' : '⚠️';
403
+ result.push(` ${icon} ${line.substring(2)}`);
404
+ }
405
+ else if (inFileError && line.startsWith('-')) {
406
+ result.push(` ${line}`);
407
+ }
335
408
  else {
336
- logger.error('Failed to deploy resources', error);
409
+ result.push(` ${line}`);
410
+ }
411
+ }
412
+ return result.join('\n');
413
+ }
414
+ /**
415
+ * Print actionable hints based on the error type
416
+ */
417
+ function printDeploymentHints(title, detail, status, resources) {
418
+ const hints = [];
419
+ if (title === 'INVALID_ARGUMENT') {
420
+ if (detail?.includes('Must reference a message')) {
421
+ hints.push('💡 A message start event or intermediate catch event is missing a message reference.');
422
+ hints.push(' Open the BPMN file in Camunda Modeler and configure the message name.');
423
+ }
424
+ if (detail?.includes('duplicate')) {
425
+ hints.push('💡 Resource IDs must be unique within a deployment.');
426
+ hints.push(' Check for duplicate process/decision IDs in your files.');
427
+ }
428
+ if (detail?.includes('parsing') || detail?.includes('syntax')) {
429
+ hints.push('💡 The resource file contains syntax errors.');
430
+ hints.push(' Validate the file in Camunda Modeler or check the XML/JSON structure.');
431
+ }
432
+ }
433
+ else if (title === 'RESOURCE_EXHAUSTED') {
434
+ hints.push('💡 The server is under heavy load (backpressure).');
435
+ hints.push(' Wait a moment and retry the deployment.');
436
+ }
437
+ else if (title === 'NOT_FOUND' || status === 404) {
438
+ hints.push('💡 The Camunda server could not be reached or the endpoint was not found.');
439
+ hints.push(' Check your connection settings with: c8 list profiles');
440
+ }
441
+ else if (title === 'UNAUTHENTICATED' || title === 'PERMISSION_DENIED' || status === 401 || status === 403) {
442
+ hints.push('💡 Authentication or authorization failed.');
443
+ hints.push(' Check your credentials and permissions for the current profile.');
444
+ }
445
+ else {
446
+ hints.push('💡 Review the error message above for specific issues.');
447
+ hints.push(' You may need to fix the resource files before deploying.');
448
+ }
449
+ // Show which files were being deployed
450
+ if (resources.length > 0) {
451
+ hints.push('');
452
+ hints.push(`📁 Resources attempted (${resources.length}):`);
453
+ resources.slice(0, 5).forEach(r => {
454
+ hints.push(` - ${r.relativePath || r.name}`);
455
+ });
456
+ if (resources.length > 5) {
457
+ hints.push(` ... and ${resources.length - 5} more`);
337
458
  }
338
- process.exit(1);
339
459
  }
460
+ hints.forEach(h => console.error(h));
340
461
  }
341
462
  //# sourceMappingURL=deployments.js.map