@camunda8/cli 2.0.0-alpha.1 → 2.0.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.
Files changed (52) hide show
  1. package/README.md +142 -28
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +1 -1
  4. package/dist/client.js.map +1 -1
  5. package/dist/commands/completion.d.ts +8 -0
  6. package/dist/commands/completion.d.ts.map +1 -0
  7. package/dist/commands/completion.js +695 -0
  8. package/dist/commands/completion.js.map +1 -0
  9. package/dist/commands/deployments.d.ts.map +1 -1
  10. package/dist/commands/deployments.js +289 -49
  11. package/dist/commands/deployments.js.map +1 -1
  12. package/dist/commands/forms.d.ts +26 -0
  13. package/dist/commands/forms.d.ts.map +1 -0
  14. package/dist/commands/forms.js +125 -0
  15. package/dist/commands/forms.js.map +1 -0
  16. package/dist/commands/help.d.ts +24 -0
  17. package/dist/commands/help.d.ts.map +1 -1
  18. package/dist/commands/help.js +247 -10
  19. package/dist/commands/help.js.map +1 -1
  20. package/dist/commands/incidents.d.ts +6 -0
  21. package/dist/commands/incidents.d.ts.map +1 -1
  22. package/dist/commands/incidents.js +15 -0
  23. package/dist/commands/incidents.js.map +1 -1
  24. package/dist/commands/plugins.d.ts +5 -0
  25. package/dist/commands/plugins.d.ts.map +1 -1
  26. package/dist/commands/plugins.js +190 -23
  27. package/dist/commands/plugins.js.map +1 -1
  28. package/dist/commands/process-definitions.d.ts +17 -0
  29. package/dist/commands/process-definitions.d.ts.map +1 -0
  30. package/dist/commands/process-definitions.js +61 -0
  31. package/dist/commands/process-definitions.js.map +1 -0
  32. package/dist/commands/process-instances.d.ts +12 -2
  33. package/dist/commands/process-instances.d.ts.map +1 -1
  34. package/dist/commands/process-instances.js +55 -4
  35. package/dist/commands/process-instances.js.map +1 -1
  36. package/dist/commands/profiles.d.ts +17 -8
  37. package/dist/commands/profiles.d.ts.map +1 -1
  38. package/dist/commands/profiles.js +74 -35
  39. package/dist/commands/profiles.js.map +1 -1
  40. package/dist/commands/session.js +3 -3
  41. package/dist/commands/session.js.map +1 -1
  42. package/dist/config.d.ts +104 -49
  43. package/dist/config.d.ts.map +1 -1
  44. package/dist/config.js +306 -165
  45. package/dist/config.js.map +1 -1
  46. package/dist/index.js +127 -16
  47. package/dist/index.js.map +1 -1
  48. package/dist/plugin-registry.d.ts +45 -0
  49. package/dist/plugin-registry.d.ts.map +1 -0
  50. package/dist/plugin-registry.js +101 -0
  51. package/dist/plugin-registry.js.map +1 -0
  52. package/package.json +1 -1
package/README.md CHANGED
@@ -5,15 +5,22 @@ A minimal-dependency CLI for Camunda 8 operations built on top of `@camunda8/orc
5
5
  ## Features
6
6
 
7
7
  - **Minimal Dependencies**: Only one runtime dependency (`@camunda8/orchestration-cluster-api`)
8
- - **Native TypeScript**: Runs directly with Node.js 22.18+ (no compilation needed)
9
8
  - **Multi-Tenant Support**: Full support for multi-tenancy across all operations
10
9
  - **Profile Management**: Store and manage multiple cluster configurations
11
10
  - **Camunda Modeler Integration**: Automatically import and use profiles from Camunda Modeler
12
11
  - **Plugin System**: Extend c8ctl with custom commands via npm packages
13
- - **Session State**: Maintain active profile, tenant, and output preferences
14
- - **Building Block Deployment**: Automatic prioritization of `_bb-` folders during deployment
12
+ - **Building Block Deployment**: Automatic prioritization of `*_bb-*` folders during deployment, marked with 🧱 in results
13
+ - **Process Application Support**: Resources in folders with `.process-application` file marked with 📦 in results
14
+ - **Enhanced Deployment Results**: Table view showing file paths, visual indicators, resource details, and versions
15
+ - **Watch Mode**: Monitors a folder for changes to `*.{bpmn,dmn,form}` and auto-redeploys
15
16
  - **Flexible Output**: Switch between human-readable text and JSON output modes
16
17
 
18
+ ## Beware the 🤖
19
+
20
+ *Full transparency*:
21
+ this cli is also a pilot-coding experiment.
22
+ Guided by humans, the codebase is (mostly) built by your friendly neighborhood LLM, fully dogfooding the Human-in-the-Loop pattern.
23
+
17
24
  ## Architecture
18
25
 
19
26
  ### Core Components
@@ -57,38 +64,103 @@ After installation, the CLI is available as `c8ctl` (or its alias `c8`).
57
64
 
58
65
  ## Usage
59
66
 
60
- ### Basic Commands
67
+ ### Getting Help
61
68
 
62
69
  ```bash
63
- # Show help
70
+ # Show general help
64
71
  c8ctl help
65
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
+
66
79
  # Show version
67
80
  c8ctl --version
81
+ ```
68
82
 
69
- # List process instances (using alias 'pi')
70
- c8ctl list pi
71
- # Or using full command name
72
- c8ctl list process-instances
83
+ ### Basic Commands
73
84
 
74
- # Get process instance by key
75
- c8ctl get pi 123456
76
- c8ctl get process-instance 123456
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 pi 123456 --variables # Get process instance with variables
91
+ c8ctl get pd 123456 --xml # Get process definition as XML
77
92
 
78
93
  # Create process instance
79
- c8ctl create pi --bpmnProcessId=myProcess
80
- c8ctl create process-instance --bpmnProcessId=myProcess
94
+ c8ctl create pi --id=myProcess
95
+ c8ctl create process-instance --id=myProcess
96
+
97
+ # Create process instance and wait for completion
98
+ c8ctl create pi --id=myProcess --awaitCompletion
99
+
100
+ # Await process instance completion (alias for create with --awaitCompletion)
101
+ c8ctl await pi --id=myProcess
102
+ c8ctl await process-instance --id=myProcess
81
103
 
82
- # Deploy BPMN file
83
- c8ctl deploy ./my-process.bpmn
104
+ # Cancel process instance
105
+ c8ctl cancel pi 123456
84
106
 
85
- # Deploy current directory
86
- c8ctl deploy
107
+ # Get forms
108
+ c8ctl get form 123456 # Get form (searches both user task and process definition)
109
+ c8ctl get form 123456 --ut # Get form for user task only
110
+ c8ctl get form 123456 --pd # Get start form for process definition only
87
111
 
88
- # Deploy and start process (run)
89
- c8ctl run ./my-process.bpmn
112
+ # Deploy and run
113
+ c8ctl deploy ./my-process.bpmn # Deploy a single file
114
+ c8ctl deploy # Deploy current directory
115
+ c8ctl run ./my-process.bpmn # Deploy and start process
116
+ c8ctl watch # Watch for changes and auto-deploy
90
117
  ```
91
118
 
119
+ For comprehensive examples of all commands and their flags, see [EXAMPLES.md](EXAMPLES.md).
120
+
121
+ ### Shell Completion
122
+
123
+ c8ctl supports shell completion for `bash`, `zsh`, and `fish`. To enable completion:
124
+
125
+ #### Bash
126
+
127
+ ```bash
128
+ # Generate and source completion script
129
+ c8ctl completion bash > ~/.c8ctl-completion.bash
130
+ echo 'source ~/.c8ctl-completion.bash' >> ~/.bashrc
131
+ source ~/.bashrc
132
+ ```
133
+
134
+ Or for immediate use in the current session:
135
+
136
+ ```bash
137
+ source <(c8ctl completion bash)
138
+ ```
139
+
140
+ #### Zsh
141
+
142
+ ```bash
143
+ # Generate and source completion script
144
+ c8ctl completion zsh > ~/.c8ctl-completion.zsh
145
+ echo 'source ~/.c8ctl-completion.zsh' >> ~/.zshrc
146
+ source ~/.zshrc
147
+ ```
148
+
149
+ Or for immediate use in the current session:
150
+
151
+ ```bash
152
+ source <(c8ctl completion zsh)
153
+ ```
154
+
155
+ #### Fish
156
+
157
+ ```bash
158
+ # Generate and install completion script
159
+ c8ctl completion fish > ~/.config/fish/completions/c8ctl.fish
160
+ ```
161
+
162
+ Fish will automatically load the completion on next shell start.
163
+
92
164
  ### Credential Resolution
93
165
 
94
166
  Credentials are resolved in the following order:
@@ -209,7 +281,7 @@ Debug output is written to stderr with timestamps and won't interfere with norma
209
281
 
210
282
  ### Plugin Management
211
283
 
212
- c8ctl supports a plugin system that allows extending the CLI with custom commands via npm packages.
284
+ 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.
213
285
 
214
286
  ```bash
215
287
  # Load a plugin from npm registry
@@ -224,13 +296,27 @@ c8ctl load plugin --from git://github.com/user/repo.git
224
296
  # Unload a plugin (wraps npm uninstall)
225
297
  c8ctl unload plugin <package-name>
226
298
 
227
- # List installed plugins
299
+ # List installed plugins (shows sync status)
228
300
  c8ctl list plugins
229
301
 
302
+ # Synchronize plugins from registry
303
+ # - First tries npm rebuild for installed plugins
304
+ # - Falls back to fresh npm install if rebuild fails
305
+ c8ctl sync plugins
306
+
230
307
  # View help including plugin commands
231
308
  c8ctl help
232
309
  ```
233
310
 
311
+ **Plugin Registry:**
312
+ - Plugins are tracked independently of `package.json` in a registry file
313
+ - The registry serves as the source of truth (local precedence)
314
+ - `c8ctl list plugins` shows sync status:
315
+ - `✓ Installed` - Plugin is in registry and installed
316
+ - `⚠ Not installed` - Plugin is in registry but not in node_modules (run `sync`)
317
+ - `⚠ Not in registry` - Plugin is in package.json but not tracked in registry
318
+ - `c8ctl sync plugins` synchronizes plugins from the registry, rebuilding or reinstalling as needed
319
+
234
320
  **Plugin Requirements:**
235
321
  - Plugin packages must be regular Node.js modules
236
322
  - They must include a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file in the root directory
@@ -265,6 +351,7 @@ When plugins are loaded, their commands automatically appear in `c8ctl help` out
265
351
  ### Resource Aliases
266
352
 
267
353
  - `pi` = process-instance(s)
354
+ - `pd` = process-definition(s)
268
355
  - `ut` = user-task(s)
269
356
  - `inc` = incident(s)
270
357
  - `msg` = message
@@ -275,9 +362,32 @@ When plugins are loaded, their commands automatically appear in `c8ctl help` out
275
362
  c8ctl <verb> <resource> [arguments] [flags]
276
363
  ```
277
364
 
278
- **Verbs**: list, get, create, cancel, complete, fail, activate, resolve, publish, correlate, deploy, run, add, remove, use, output
279
-
280
- **Resources**: process-instance, user-task, incident, job, message, topology, profile, tenant
365
+ **Verbs**:
366
+ - `list` - List resources
367
+ - `get` - Get resource by key
368
+ - `create` - Create resource
369
+ - `cancel` - Cancel resource
370
+ - `complete` - Complete resource
371
+ - `fail` - Fail a job
372
+ - `activate` - Activate jobs
373
+ - `resolve` - Resolve incident
374
+ - `publish` - Publish message
375
+ - `correlate` - Correlate message
376
+ - `deploy` - Deploy BPMN/DMN/forms
377
+ - `run` - Deploy and start process
378
+ - `watch` (alias: `w`) - Watch for changes and auto-deploy
379
+ - `add` - Add a profile
380
+ - `remove` (alias: `rm`) - Remove a profile
381
+ - `load` - Load a plugin
382
+ - `unload` - Unload a plugin
383
+ - `sync` - Synchronize plugins
384
+ - `use` - Set active profile or tenant
385
+ - `output` - Set output format
386
+ - `completion` - Generate shell completion script
387
+
388
+ **Resources**: process-instance (pi), process-definition (pd), user-task (ut), incident (inc), job, jobs, message (msg), topology, profile, tenant, plugin
389
+
390
+ **Tip**: Run `c8ctl help <command>` to see detailed help for specific commands with all available flags.
281
391
 
282
392
  ## Testing
283
393
 
@@ -302,6 +412,9 @@ Integration tests require a running Camunda 8 instance at `http://localhost:8080
302
412
 
303
413
  ## Development
304
414
 
415
+ - **Native TypeScript**: Runs directly with Node.js 22.18+ (no compilation needed)
416
+
417
+
305
418
  ### Project Structure
306
419
 
307
420
  ```
@@ -354,7 +467,7 @@ c8ctl <command>
354
467
  - `CAMUNDA_BASE_URL`: Cluster base URL
355
468
  - `CAMUNDA_CLIENT_ID`: OAuth client ID
356
469
  - `CAMUNDA_CLIENT_SECRET`: OAuth client secret
357
- - `CAMUNDA_AUDIENCE`: OAuth audience
470
+ - `CAMUNDA_TOKEN_AUDIENCE`: OAuth token audience
358
471
  - `CAMUNDA_OAUTH_URL`: OAuth token endpoint
359
472
  - `CAMUNDA_DEFAULT_TENANT_ID`: Default tenant ID
360
473
 
@@ -364,13 +477,14 @@ c8ctl <command>
364
477
 
365
478
  Configuration is stored in platform-specific user data directories:
366
479
 
367
- - **Linux**: `~/.local/share/c8ctl/`
480
+ - **Linux**: `~/.config/c8ctl/`
368
481
  - **macOS**: `~/Library/Application Support/c8ctl/`
369
482
  - **Windows**: `%APPDATA%\c8ctl\`
370
483
 
371
484
  Files:
372
485
  - `profiles.json`: Saved cluster configurations
373
486
  - `session.json`: Active profile, tenant, and output mode
487
+ - `plugins.json`: Plugin registry tracking installed plugins
374
488
 
375
489
  ### Camunda Modeler Configuration
376
490
 
@@ -388,7 +502,7 @@ Modeler profiles are:
388
502
 
389
503
  ## License
390
504
 
391
- MIT
505
+ Apache 2.0 - see LICENSE.md
392
506
 
393
507
  ## Contributing
394
508
 
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAG9F;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,CAgChE"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAuB,KAAK,aAAa,EAAuB,MAAM,qCAAqC,CAAC;AAGnH;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,CAgChE"}
package/dist/client.js CHANGED
@@ -18,7 +18,7 @@ export function createClient(profileFlag) {
18
18
  sdkConfig.CAMUNDA_CLIENT_ID = config.clientId;
19
19
  sdkConfig.CAMUNDA_CLIENT_SECRET = config.clientSecret;
20
20
  if (config.audience) {
21
- sdkConfig.CAMUNDA_OAUTH_AUDIENCE = config.audience;
21
+ sdkConfig.CAMUNDA_TOKEN_AUDIENCE = config.audience;
22
22
  }
23
23
  if (config.oAuthUrl) {
24
24
  sdkConfig.CAMUNDA_OAUTH_URL = config.oAuthUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAsB,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,aA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
+ */
7
+ export declare function showCompletion(shell?: string): void;
8
+ //# sourceMappingURL=completion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8pBH;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CA0BnD"}