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

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 (41) hide show
  1. package/README.md +102 -22
  2. package/dist/commands/completion.d.ts +8 -0
  3. package/dist/commands/completion.d.ts.map +1 -0
  4. package/dist/commands/completion.js +596 -0
  5. package/dist/commands/completion.js.map +1 -0
  6. package/dist/commands/deployments.d.ts.map +1 -1
  7. package/dist/commands/deployments.js +155 -35
  8. package/dist/commands/deployments.js.map +1 -1
  9. package/dist/commands/help.d.ts.map +1 -1
  10. package/dist/commands/help.js +23 -5
  11. package/dist/commands/help.js.map +1 -1
  12. package/dist/commands/process-definitions.d.ts +17 -0
  13. package/dist/commands/process-definitions.d.ts.map +1 -0
  14. package/dist/commands/process-definitions.js +61 -0
  15. package/dist/commands/process-definitions.js.map +1 -0
  16. package/dist/commands/profiles.d.ts +17 -8
  17. package/dist/commands/profiles.d.ts.map +1 -1
  18. package/dist/commands/profiles.js +74 -35
  19. package/dist/commands/profiles.js.map +1 -1
  20. package/dist/commands/session.d.ts.map +1 -1
  21. package/dist/commands/session.js +7 -7
  22. package/dist/commands/session.js.map +1 -1
  23. package/dist/config.d.ts +109 -52
  24. package/dist/config.d.ts.map +1 -1
  25. package/dist/config.js +350 -179
  26. package/dist/config.js.map +1 -1
  27. package/dist/index.js +35 -6
  28. package/dist/index.js.map +1 -1
  29. package/dist/logger.d.ts +1 -2
  30. package/dist/logger.d.ts.map +1 -1
  31. package/dist/logger.js +20 -14
  32. package/dist/logger.js.map +1 -1
  33. package/dist/plugin-loader.d.ts +9 -0
  34. package/dist/plugin-loader.d.ts.map +1 -1
  35. package/dist/plugin-loader.js +82 -23
  36. package/dist/plugin-loader.js.map +1 -1
  37. package/dist/runtime.d.ts +18 -5
  38. package/dist/runtime.d.ts.map +1 -1
  39. package/dist/runtime.js +31 -6
  40. package/dist/runtime.js.map +1 -1
  41. package/package.json +12 -12
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
@@ -55,12 +62,6 @@ After installation, the CLI is available as `c8ctl` (or its alias `c8`).
55
62
 
56
63
  **Note**: The `c8` alias provides typing ergonomics for common keyboard layouts - the `c` key (left index finger) followed by `8` (right middle finger) makes for a comfortable typing experience on both QWERTY and QWERTZ keyboards.
57
64
 
58
- ### Local Development
59
-
60
- ```bash
61
- npm install
62
- ```
63
-
64
65
  ## Usage
65
66
 
66
67
  ### Basic Commands
@@ -77,10 +78,21 @@ c8ctl list pi
77
78
  # Or using full command name
78
79
  c8ctl list process-instances
79
80
 
81
+ # List process definitions (using alias 'pd')
82
+ c8ctl list pd
83
+ c8ctl list process-definitions
84
+
80
85
  # Get process instance by key
81
86
  c8ctl get pi 123456
82
87
  c8ctl get process-instance 123456
83
88
 
89
+ # Get process definition by key
90
+ c8ctl get pd 123456
91
+ c8ctl get process-definition 123456
92
+
93
+ # Get process definition XML
94
+ c8ctl get pd 123456 --xml
95
+
84
96
  # Create process instance
85
97
  c8ctl create pi --bpmnProcessId=myProcess
86
98
  c8ctl create process-instance --bpmnProcessId=myProcess
@@ -91,10 +103,60 @@ c8ctl deploy ./my-process.bpmn
91
103
  # Deploy current directory
92
104
  c8ctl deploy
93
105
 
106
+ # Deploy from multiple paths
107
+ c8ctl deploy ./processes ./forms ./building-blocks
108
+
109
+ # Watch mode (using alias 'w')
110
+ c8ctl w
111
+ c8ctl watch
112
+
94
113
  # Deploy and start process (run)
95
114
  c8ctl run ./my-process.bpmn
96
115
  ```
97
116
 
117
+ ### Shell Completion
118
+
119
+ c8ctl supports shell completion for `bash`, `zsh`, and `fish`. To enable completion:
120
+
121
+ #### Bash
122
+
123
+ ```bash
124
+ # Generate and source completion script
125
+ c8ctl completion bash > ~/.c8ctl-completion.bash
126
+ echo 'source ~/.c8ctl-completion.bash' >> ~/.bashrc
127
+ source ~/.bashrc
128
+ ```
129
+
130
+ Or for immediate use in the current session:
131
+
132
+ ```bash
133
+ source <(c8ctl completion bash)
134
+ ```
135
+
136
+ #### Zsh
137
+
138
+ ```bash
139
+ # Generate and source completion script
140
+ c8ctl completion zsh > ~/.c8ctl-completion.zsh
141
+ echo 'source ~/.c8ctl-completion.zsh' >> ~/.zshrc
142
+ source ~/.zshrc
143
+ ```
144
+
145
+ Or for immediate use in the current session:
146
+
147
+ ```bash
148
+ source <(c8ctl completion zsh)
149
+ ```
150
+
151
+ #### Fish
152
+
153
+ ```bash
154
+ # Generate and install completion script
155
+ c8ctl completion fish > ~/.config/fish/completions/c8ctl.fish
156
+ ```
157
+
158
+ Fish will automatically load the completion on next shell start.
159
+
98
160
  ### Credential Resolution
99
161
 
100
162
  Credentials are resolved in the following order:
@@ -232,18 +294,33 @@ c8ctl unload plugin <package-name>
232
294
 
233
295
  # List installed plugins
234
296
  c8ctl list plugins
297
+
298
+ # View help including plugin commands
299
+ c8ctl help
235
300
  ```
236
301
 
237
302
  **Plugin Requirements:**
238
303
  - Plugin packages must be regular Node.js modules
239
304
  - They must include a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file in the root directory
240
305
  - The plugin file must export a `commands` object
306
+ - Optionally export a `metadata` object to provide help text
241
307
  - Plugins are installed in `node_modules` like regular npm packages
242
308
  - The runtime object `c8ctl` provides environment information to plugins
309
+ - **Important**: `c8ctl-plugin.js` must be JavaScript. Node.js doesn't support type stripping in `node_modules`. If writing in TypeScript, transpile to JS before publishing.
243
310
 
244
311
  **Example Plugin Structure:**
245
312
  ```typescript
246
313
  // c8ctl-plugin.ts
314
+ export const metadata = {
315
+ name: 'my-plugin',
316
+ description: 'My custom c8ctl plugin',
317
+ commands: {
318
+ analyze: {
319
+ description: 'Analyze BPMN processes'
320
+ }
321
+ }
322
+ };
323
+
247
324
  export const commands = {
248
325
  analyze: async (args: string[]) => {
249
326
  console.log('Analyzing...', args);
@@ -251,9 +328,12 @@ export const commands = {
251
328
  };
252
329
  ```
253
330
 
331
+ When plugins are loaded, their commands automatically appear in `c8ctl help` output. See [PLUGIN-HELP.md](PLUGIN-HELP.md) for detailed documentation on plugin help integration.
332
+
254
333
  ### Resource Aliases
255
334
 
256
335
  - `pi` = process-instance(s)
336
+ - `pd` = process-definition(s)
257
337
  - `ut` = user-task(s)
258
338
  - `inc` = incident(s)
259
339
  - `msg` = message
@@ -266,7 +346,7 @@ c8ctl <verb> <resource> [arguments] [flags]
266
346
 
267
347
  **Verbs**: list, get, create, cancel, complete, fail, activate, resolve, publish, correlate, deploy, run, add, remove, use, output
268
348
 
269
- **Resources**: process-instance, user-task, incident, job, message, topology, profile, tenant
349
+ **Resources**: process-instance, process-definition, user-task, incident, job, message, topology, profile, tenant
270
350
 
271
351
  ## Testing
272
352
 
@@ -291,6 +371,9 @@ Integration tests require a running Camunda 8 instance at `http://localhost:8080
291
371
 
292
372
  ## Development
293
373
 
374
+ - **Native TypeScript**: Runs directly with Node.js 22.18+ (no compilation needed)
375
+
376
+
294
377
  ### Project Structure
295
378
 
296
379
  ```
@@ -301,17 +384,7 @@ c8ctl/
301
384
  │ ├── config.ts # Configuration management
302
385
  │ ├── client.ts # SDK client factory
303
386
  │ └── commands/ # Command handlers
304
- ├── help.ts
305
- │ ├── session.ts
306
- │ ├── profiles.ts
307
- │ ├── process-instances.ts
308
- │ ├── user-tasks.ts
309
- │ ├── incidents.ts
310
- │ ├── jobs.ts
311
- │ ├── messages.ts
312
- │ ├── topology.ts
313
- │ ├── deployments.ts
314
- │ └── run.ts
387
+ └── ...
315
388
  ├── tests/
316
389
  │ ├── unit/ # Unit tests
317
390
  │ ├── integration/ # Integration tests
@@ -331,8 +404,15 @@ c8 <command>
331
404
 
332
405
  # For local development with Node.js 22.18+ (native TypeScript)
333
406
  node src/index.ts <command>
407
+
408
+ # Testing with npm link (requires build first)
409
+ npm run build
410
+ npm link
411
+ c8ctl <command>
334
412
  ```
335
413
 
414
+ **Note**: The build step is only required for publishing or using `npm link`. Development uses native TypeScript execution via `node src/index.ts`.
415
+
336
416
  ### Adding New Commands
337
417
 
338
418
  1. Create command handler in `src/commands/`
@@ -380,7 +460,7 @@ Modeler profiles are:
380
460
 
381
461
  ## License
382
462
 
383
- MIT
463
+ Apache 2.0 - see LICENSE.md
384
464
 
385
465
  ## Contributing
386
466
 
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shell completion commands
3
+ */
4
+ /**
5
+ * Show completion command
6
+ */
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;AA2jBH;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CA0BnD"}