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

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 +97 -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 +2 -1
  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,20 @@ 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
13
+ - **Watch Mode**: Monitors a folder for changes to `*.{bpmn,dmn,form}` and auto-redeploys
15
14
  - **Flexible Output**: Switch between human-readable text and JSON output modes
16
15
 
16
+ ## Beware the 🤖
17
+
18
+ *Full transparency*:
19
+ this cli is also a pilot-coding experiment.
20
+ Guided by humans, the codebase is (mostly) built by your friendly neighborhood LLM, fully dogfooding the Human-in-the-Loop pattern.
21
+
17
22
  ## Architecture
18
23
 
19
24
  ### Core Components
@@ -55,12 +60,6 @@ After installation, the CLI is available as `c8ctl` (or its alias `c8`).
55
60
 
56
61
  **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
62
 
58
- ### Local Development
59
-
60
- ```bash
61
- npm install
62
- ```
63
-
64
63
  ## Usage
65
64
 
66
65
  ### Basic Commands
@@ -77,10 +76,21 @@ c8ctl list pi
77
76
  # Or using full command name
78
77
  c8ctl list process-instances
79
78
 
79
+ # List process definitions (using alias 'pd')
80
+ c8ctl list pd
81
+ c8ctl list process-definitions
82
+
80
83
  # Get process instance by key
81
84
  c8ctl get pi 123456
82
85
  c8ctl get process-instance 123456
83
86
 
87
+ # Get process definition by key
88
+ c8ctl get pd 123456
89
+ c8ctl get process-definition 123456
90
+
91
+ # Get process definition XML
92
+ c8ctl get pd 123456 --xml
93
+
84
94
  # Create process instance
85
95
  c8ctl create pi --bpmnProcessId=myProcess
86
96
  c8ctl create process-instance --bpmnProcessId=myProcess
@@ -91,10 +101,57 @@ c8ctl deploy ./my-process.bpmn
91
101
  # Deploy current directory
92
102
  c8ctl deploy
93
103
 
104
+ # Watch mode (using alias 'w')
105
+ c8ctl w
106
+ c8ctl watch
107
+
94
108
  # Deploy and start process (run)
95
109
  c8ctl run ./my-process.bpmn
96
110
  ```
97
111
 
112
+ ### Shell Completion
113
+
114
+ c8ctl supports shell completion for `bash`, `zsh`, and `fish`. To enable completion:
115
+
116
+ #### Bash
117
+
118
+ ```bash
119
+ # Generate and source completion script
120
+ c8ctl completion bash > ~/.c8ctl-completion.bash
121
+ echo 'source ~/.c8ctl-completion.bash' >> ~/.bashrc
122
+ source ~/.bashrc
123
+ ```
124
+
125
+ Or for immediate use in the current session:
126
+
127
+ ```bash
128
+ source <(c8ctl completion bash)
129
+ ```
130
+
131
+ #### Zsh
132
+
133
+ ```bash
134
+ # Generate and source completion script
135
+ c8ctl completion zsh > ~/.c8ctl-completion.zsh
136
+ echo 'source ~/.c8ctl-completion.zsh' >> ~/.zshrc
137
+ source ~/.zshrc
138
+ ```
139
+
140
+ Or for immediate use in the current session:
141
+
142
+ ```bash
143
+ source <(c8ctl completion zsh)
144
+ ```
145
+
146
+ #### Fish
147
+
148
+ ```bash
149
+ # Generate and install completion script
150
+ c8ctl completion fish > ~/.config/fish/completions/c8ctl.fish
151
+ ```
152
+
153
+ Fish will automatically load the completion on next shell start.
154
+
98
155
  ### Credential Resolution
99
156
 
100
157
  Credentials are resolved in the following order:
@@ -232,18 +289,33 @@ c8ctl unload plugin <package-name>
232
289
 
233
290
  # List installed plugins
234
291
  c8ctl list plugins
292
+
293
+ # View help including plugin commands
294
+ c8ctl help
235
295
  ```
236
296
 
237
297
  **Plugin Requirements:**
238
298
  - Plugin packages must be regular Node.js modules
239
299
  - They must include a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file in the root directory
240
300
  - The plugin file must export a `commands` object
301
+ - Optionally export a `metadata` object to provide help text
241
302
  - Plugins are installed in `node_modules` like regular npm packages
242
303
  - The runtime object `c8ctl` provides environment information to plugins
304
+ - **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
305
 
244
306
  **Example Plugin Structure:**
245
307
  ```typescript
246
308
  // c8ctl-plugin.ts
309
+ export const metadata = {
310
+ name: 'my-plugin',
311
+ description: 'My custom c8ctl plugin',
312
+ commands: {
313
+ analyze: {
314
+ description: 'Analyze BPMN processes'
315
+ }
316
+ }
317
+ };
318
+
247
319
  export const commands = {
248
320
  analyze: async (args: string[]) => {
249
321
  console.log('Analyzing...', args);
@@ -251,9 +323,12 @@ export const commands = {
251
323
  };
252
324
  ```
253
325
 
326
+ 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.
327
+
254
328
  ### Resource Aliases
255
329
 
256
330
  - `pi` = process-instance(s)
331
+ - `pd` = process-definition(s)
257
332
  - `ut` = user-task(s)
258
333
  - `inc` = incident(s)
259
334
  - `msg` = message
@@ -266,7 +341,7 @@ c8ctl <verb> <resource> [arguments] [flags]
266
341
 
267
342
  **Verbs**: list, get, create, cancel, complete, fail, activate, resolve, publish, correlate, deploy, run, add, remove, use, output
268
343
 
269
- **Resources**: process-instance, user-task, incident, job, message, topology, profile, tenant
344
+ **Resources**: process-instance, process-definition, user-task, incident, job, message, topology, profile, tenant
270
345
 
271
346
  ## Testing
272
347
 
@@ -291,6 +366,9 @@ Integration tests require a running Camunda 8 instance at `http://localhost:8080
291
366
 
292
367
  ## Development
293
368
 
369
+ - **Native TypeScript**: Runs directly with Node.js 22.18+ (no compilation needed)
370
+
371
+
294
372
  ### Project Structure
295
373
 
296
374
  ```
@@ -301,17 +379,7 @@ c8ctl/
301
379
  │ ├── config.ts # Configuration management
302
380
  │ ├── client.ts # SDK client factory
303
381
  │ └── 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
382
+ └── ...
315
383
  ├── tests/
316
384
  │ ├── unit/ # Unit tests
317
385
  │ ├── integration/ # Integration tests
@@ -331,8 +399,15 @@ c8 <command>
331
399
 
332
400
  # For local development with Node.js 22.18+ (native TypeScript)
333
401
  node src/index.ts <command>
402
+
403
+ # Testing with npm link (requires build first)
404
+ npm run build
405
+ npm link
406
+ c8ctl <command>
334
407
  ```
335
408
 
409
+ **Note**: The build step is only required for publishing or using `npm link`. Development uses native TypeScript execution via `node src/index.ts`.
410
+
336
411
  ### Adding New Commands
337
412
 
338
413
  1. Create command handler in `src/commands/`
@@ -380,7 +455,7 @@ Modeler profiles are:
380
455
 
381
456
  ## License
382
457
 
383
- MIT
458
+ Apache 2.0 - see LICENSE.md
384
459
 
385
460
  ## Contributing
386
461
 
@@ -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"}