@camunda8/cli 1.0.0 → 1.1.0

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
@@ -55,12 +55,6 @@ After installation, the CLI is available as `c8ctl` (or its alias `c8`).
55
55
 
56
56
  **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
57
 
58
- ### Local Development
59
-
60
- ```bash
61
- npm install
62
- ```
63
-
64
58
  ## Usage
65
59
 
66
60
  ### Basic Commands
@@ -77,10 +71,21 @@ c8ctl list pi
77
71
  # Or using full command name
78
72
  c8ctl list process-instances
79
73
 
74
+ # List process definitions (using alias 'pd')
75
+ c8ctl list pd
76
+ c8ctl list process-definitions
77
+
80
78
  # Get process instance by key
81
79
  c8ctl get pi 123456
82
80
  c8ctl get process-instance 123456
83
81
 
82
+ # Get process definition by key
83
+ c8ctl get pd 123456
84
+ c8ctl get process-definition 123456
85
+
86
+ # Get process definition XML
87
+ c8ctl get pd 123456 --xml
88
+
84
89
  # Create process instance
85
90
  c8ctl create pi --bpmnProcessId=myProcess
86
91
  c8ctl create process-instance --bpmnProcessId=myProcess
@@ -95,6 +100,49 @@ c8ctl deploy
95
100
  c8ctl run ./my-process.bpmn
96
101
  ```
97
102
 
103
+ ### Shell Completion
104
+
105
+ c8ctl supports shell completion for bash, zsh, and fish. To enable completion:
106
+
107
+ #### Bash
108
+
109
+ ```bash
110
+ # Generate and source completion script
111
+ c8ctl completion bash > ~/.c8ctl-completion.bash
112
+ echo 'source ~/.c8ctl-completion.bash' >> ~/.bashrc
113
+ source ~/.bashrc
114
+ ```
115
+
116
+ Or for immediate use in the current session:
117
+
118
+ ```bash
119
+ source <(c8ctl completion bash)
120
+ ```
121
+
122
+ #### Zsh
123
+
124
+ ```bash
125
+ # Generate and source completion script
126
+ c8ctl completion zsh > ~/.c8ctl-completion.zsh
127
+ echo 'source ~/.c8ctl-completion.zsh' >> ~/.zshrc
128
+ source ~/.zshrc
129
+ ```
130
+
131
+ Or for immediate use in the current session:
132
+
133
+ ```bash
134
+ source <(c8ctl completion zsh)
135
+ ```
136
+
137
+ #### Fish
138
+
139
+ ```bash
140
+ # Generate and install completion script
141
+ c8ctl completion fish > ~/.config/fish/completions/c8ctl.fish
142
+ ```
143
+
144
+ Fish will automatically load the completion on next shell start.
145
+
98
146
  ### Credential Resolution
99
147
 
100
148
  Credentials are resolved in the following order:
@@ -232,18 +280,33 @@ c8ctl unload plugin <package-name>
232
280
 
233
281
  # List installed plugins
234
282
  c8ctl list plugins
283
+
284
+ # View help including plugin commands
285
+ c8ctl help
235
286
  ```
236
287
 
237
288
  **Plugin Requirements:**
238
289
  - Plugin packages must be regular Node.js modules
239
290
  - They must include a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file in the root directory
240
291
  - The plugin file must export a `commands` object
292
+ - Optionally export a `metadata` object to provide help text
241
293
  - Plugins are installed in `node_modules` like regular npm packages
242
294
  - The runtime object `c8ctl` provides environment information to plugins
295
+ - **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
296
 
244
297
  **Example Plugin Structure:**
245
298
  ```typescript
246
299
  // c8ctl-plugin.ts
300
+ export const metadata = {
301
+ name: 'my-plugin',
302
+ description: 'My custom c8ctl plugin',
303
+ commands: {
304
+ analyze: {
305
+ description: 'Analyze BPMN processes'
306
+ }
307
+ }
308
+ };
309
+
247
310
  export const commands = {
248
311
  analyze: async (args: string[]) => {
249
312
  console.log('Analyzing...', args);
@@ -251,9 +314,12 @@ export const commands = {
251
314
  };
252
315
  ```
253
316
 
317
+ 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.
318
+
254
319
  ### Resource Aliases
255
320
 
256
321
  - `pi` = process-instance(s)
322
+ - `pd` = process-definition(s)
257
323
  - `ut` = user-task(s)
258
324
  - `inc` = incident(s)
259
325
  - `msg` = message
@@ -266,7 +332,7 @@ c8ctl <verb> <resource> [arguments] [flags]
266
332
 
267
333
  **Verbs**: list, get, create, cancel, complete, fail, activate, resolve, publish, correlate, deploy, run, add, remove, use, output
268
334
 
269
- **Resources**: process-instance, user-task, incident, job, message, topology, profile, tenant
335
+ **Resources**: process-instance, process-definition, user-task, incident, job, message, topology, profile, tenant
270
336
 
271
337
  ## Testing
272
338
 
@@ -301,17 +367,7 @@ c8ctl/
301
367
  │ ├── config.ts # Configuration management
302
368
  │ ├── client.ts # SDK client factory
303
369
  │ └── 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
370
+ └── ...
315
371
  ├── tests/
316
372
  │ ├── unit/ # Unit tests
317
373
  │ ├── integration/ # Integration tests
@@ -331,8 +387,15 @@ c8 <command>
331
387
 
332
388
  # For local development with Node.js 22.18+ (native TypeScript)
333
389
  node src/index.ts <command>
390
+
391
+ # Testing with npm link (requires build first)
392
+ npm run build
393
+ npm link
394
+ c8ctl <command>
334
395
  ```
335
396
 
397
+ **Note**: The build step is only required for publishing or using `npm link`. Development uses native TypeScript execution via `node src/index.ts`.
398
+
336
399
  ### Adding New Commands
337
400
 
338
401
  1. Create command handler in `src/commands/`
@@ -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"}