@camunda8/cli 2.0.0-alpha.1 → 2.0.0-alpha.11
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 +157 -28
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/commands/completion.d.ts +8 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +799 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/deployments.d.ts.map +1 -1
- package/dist/commands/deployments.js +289 -49
- package/dist/commands/deployments.js.map +1 -1
- package/dist/commands/forms.d.ts +26 -0
- package/dist/commands/forms.d.ts.map +1 -0
- package/dist/commands/forms.js +125 -0
- package/dist/commands/forms.js.map +1 -0
- package/dist/commands/help.d.ts +24 -0
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +293 -10
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/incidents.d.ts +6 -0
- package/dist/commands/incidents.d.ts.map +1 -1
- package/dist/commands/incidents.js +15 -0
- package/dist/commands/incidents.js.map +1 -1
- package/dist/commands/plugins.d.ts +5 -0
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +190 -23
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/process-definitions.d.ts +17 -0
- package/dist/commands/process-definitions.d.ts.map +1 -0
- package/dist/commands/process-definitions.js +61 -0
- package/dist/commands/process-definitions.js.map +1 -0
- package/dist/commands/process-instances.d.ts +12 -2
- package/dist/commands/process-instances.d.ts.map +1 -1
- package/dist/commands/process-instances.js +55 -4
- package/dist/commands/process-instances.js.map +1 -1
- package/dist/commands/profiles.d.ts +17 -8
- package/dist/commands/profiles.d.ts.map +1 -1
- package/dist/commands/profiles.js +74 -35
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/search.d.ts +105 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +438 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/session.js +3 -3
- package/dist/commands/session.js.map +1 -1
- package/dist/config.d.ts +104 -49
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +306 -165
- package/dist/config.js.map +1 -1
- package/dist/index.js +224 -16
- package/dist/index.js.map +1 -1
- package/dist/plugin-registry.d.ts +45 -0
- package/dist/plugin-registry.d.ts.map +1 -0
- package/dist/plugin-registry.js +101 -0
- package/dist/plugin-registry.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,15 +5,23 @@ 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
|
-
- **
|
|
14
|
-
- **
|
|
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
|
|
16
|
+
- **Search**: Powerful search across process definitions, process instances, user tasks, incidents, jobs, and variables with filter, wildcard, and case-insensitive support
|
|
15
17
|
- **Flexible Output**: Switch between human-readable text and JSON output modes
|
|
16
18
|
|
|
19
|
+
## Beware the 🤖
|
|
20
|
+
|
|
21
|
+
*Full transparency*:
|
|
22
|
+
this cli is also a pilot-coding experiment.
|
|
23
|
+
Guided by humans, the codebase is (mostly) built by your friendly neighborhood LLM, fully dogfooding the Human-in-the-Loop pattern.
|
|
24
|
+
|
|
17
25
|
## Architecture
|
|
18
26
|
|
|
19
27
|
### Core Components
|
|
@@ -57,38 +65,116 @@ After installation, the CLI is available as `c8ctl` (or its alias `c8`).
|
|
|
57
65
|
|
|
58
66
|
## Usage
|
|
59
67
|
|
|
60
|
-
###
|
|
68
|
+
### Getting Help
|
|
61
69
|
|
|
62
70
|
```bash
|
|
63
|
-
# Show help
|
|
71
|
+
# Show general help
|
|
64
72
|
c8ctl help
|
|
65
73
|
|
|
74
|
+
# Show detailed help for specific commands with all flags
|
|
75
|
+
c8ctl help list # Shows all list resources and their flags
|
|
76
|
+
c8ctl help get # Shows all get resources and their flags
|
|
77
|
+
c8ctl help create # Shows all create resources and their flags
|
|
78
|
+
c8ctl help complete # Shows all complete resources and their flags
|
|
79
|
+
|
|
66
80
|
# Show version
|
|
67
81
|
c8ctl --version
|
|
82
|
+
```
|
|
68
83
|
|
|
69
|
-
|
|
70
|
-
c8ctl list pi
|
|
71
|
-
# Or using full command name
|
|
72
|
-
c8ctl list process-instances
|
|
84
|
+
### Basic Commands
|
|
73
85
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
c8ctl
|
|
86
|
+
```bash
|
|
87
|
+
# List and get resources (use aliases pi, pd, ut, inc for convenience)
|
|
88
|
+
c8ctl list pi # List process instances
|
|
89
|
+
c8ctl list pd # List process definitions
|
|
90
|
+
c8ctl get pi 123456 # Get process instance by key
|
|
91
|
+
c8ctl get pi 123456 --variables # Get process instance with variables
|
|
92
|
+
c8ctl get pd 123456 --xml # Get process definition as XML
|
|
77
93
|
|
|
78
94
|
# Create process instance
|
|
79
|
-
c8ctl create pi --
|
|
80
|
-
c8ctl create process-instance --
|
|
95
|
+
c8ctl create pi --id=myProcess
|
|
96
|
+
c8ctl create process-instance --id=myProcess
|
|
97
|
+
|
|
98
|
+
# Create process instance and wait for completion
|
|
99
|
+
c8ctl create pi --id=myProcess --awaitCompletion
|
|
100
|
+
|
|
101
|
+
# Await process instance completion (alias for create with --awaitCompletion)
|
|
102
|
+
c8ctl await pi --id=myProcess
|
|
103
|
+
c8ctl await process-instance --id=myProcess
|
|
104
|
+
|
|
105
|
+
# Cancel process instance
|
|
106
|
+
c8ctl cancel pi 123456
|
|
107
|
+
|
|
108
|
+
# Get forms
|
|
109
|
+
c8ctl get form 123456 # Get form (searches both user task and process definition)
|
|
110
|
+
c8ctl get form 123456 --ut # Get form for user task only
|
|
111
|
+
c8ctl get form 123456 --pd # Get start form for process definition only
|
|
112
|
+
|
|
113
|
+
# Search resources with filters
|
|
114
|
+
c8ctl search pi --state=ACTIVE # Search active process instances
|
|
115
|
+
c8ctl search pd --id=myProcess # Search process definitions by ID
|
|
116
|
+
c8ctl search pd --name='*order*' # Wildcard search (* = any chars, ? = single char)
|
|
117
|
+
c8ctl search pd --id='process-v?' # Single-char wildcard (matches process-v1, process-v2, …)
|
|
118
|
+
c8ctl search pd --iname='*ORDER*' # Case-insensitive search (--i prefix)
|
|
119
|
+
c8ctl search ut --iassignee=John # Case-insensitive assignee search
|
|
120
|
+
c8ctl search ut --assignee=john # Search user tasks by assignee
|
|
121
|
+
c8ctl search inc --state=ACTIVE # Search active incidents
|
|
122
|
+
c8ctl search jobs --type='*service*' # Search jobs with type containing "service"
|
|
123
|
+
c8ctl search variables --name=myVar # Search variables by name
|
|
124
|
+
c8ctl search variables --fullValue # Search with full (non-truncated) values
|
|
125
|
+
|
|
126
|
+
# Deploy and run
|
|
127
|
+
c8ctl deploy ./my-process.bpmn # Deploy a single file
|
|
128
|
+
c8ctl deploy # Deploy current directory
|
|
129
|
+
c8ctl run ./my-process.bpmn # Deploy and start process
|
|
130
|
+
c8ctl watch # Watch for changes and auto-deploy
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
For comprehensive examples of all commands and their flags, see [EXAMPLES.md](EXAMPLES.md).
|
|
134
|
+
|
|
135
|
+
### Shell Completion
|
|
136
|
+
|
|
137
|
+
c8ctl supports shell completion for `bash`, `zsh`, and `fish`. To enable completion:
|
|
138
|
+
|
|
139
|
+
#### Bash
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Generate and source completion script
|
|
143
|
+
c8ctl completion bash > ~/.c8ctl-completion.bash
|
|
144
|
+
echo 'source ~/.c8ctl-completion.bash' >> ~/.bashrc
|
|
145
|
+
source ~/.bashrc
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Or for immediate use in the current session:
|
|
81
149
|
|
|
82
|
-
|
|
83
|
-
c8ctl
|
|
150
|
+
```bash
|
|
151
|
+
source <(c8ctl completion bash)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### Zsh
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Generate and source completion script
|
|
158
|
+
c8ctl completion zsh > ~/.c8ctl-completion.zsh
|
|
159
|
+
echo 'source ~/.c8ctl-completion.zsh' >> ~/.zshrc
|
|
160
|
+
source ~/.zshrc
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Or for immediate use in the current session:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
source <(c8ctl completion zsh)
|
|
167
|
+
```
|
|
84
168
|
|
|
85
|
-
|
|
86
|
-
c8ctl deploy
|
|
169
|
+
#### Fish
|
|
87
170
|
|
|
88
|
-
|
|
89
|
-
|
|
171
|
+
```bash
|
|
172
|
+
# Generate and install completion script
|
|
173
|
+
c8ctl completion fish > ~/.config/fish/completions/c8ctl.fish
|
|
90
174
|
```
|
|
91
175
|
|
|
176
|
+
Fish will automatically load the completion on next shell start.
|
|
177
|
+
|
|
92
178
|
### Credential Resolution
|
|
93
179
|
|
|
94
180
|
Credentials are resolved in the following order:
|
|
@@ -209,7 +295,7 @@ Debug output is written to stderr with timestamps and won't interfere with norma
|
|
|
209
295
|
|
|
210
296
|
### Plugin Management
|
|
211
297
|
|
|
212
|
-
c8ctl supports a plugin system that allows extending the CLI with custom commands via npm packages.
|
|
298
|
+
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
299
|
|
|
214
300
|
```bash
|
|
215
301
|
# Load a plugin from npm registry
|
|
@@ -224,13 +310,27 @@ c8ctl load plugin --from git://github.com/user/repo.git
|
|
|
224
310
|
# Unload a plugin (wraps npm uninstall)
|
|
225
311
|
c8ctl unload plugin <package-name>
|
|
226
312
|
|
|
227
|
-
# List installed plugins
|
|
313
|
+
# List installed plugins (shows sync status)
|
|
228
314
|
c8ctl list plugins
|
|
229
315
|
|
|
316
|
+
# Synchronize plugins from registry
|
|
317
|
+
# - First tries npm rebuild for installed plugins
|
|
318
|
+
# - Falls back to fresh npm install if rebuild fails
|
|
319
|
+
c8ctl sync plugins
|
|
320
|
+
|
|
230
321
|
# View help including plugin commands
|
|
231
322
|
c8ctl help
|
|
232
323
|
```
|
|
233
324
|
|
|
325
|
+
**Plugin Registry:**
|
|
326
|
+
- Plugins are tracked independently of `package.json` in a registry file
|
|
327
|
+
- The registry serves as the source of truth (local precedence)
|
|
328
|
+
- `c8ctl list plugins` shows sync status:
|
|
329
|
+
- `✓ Installed` - Plugin is in registry and installed
|
|
330
|
+
- `⚠ Not installed` - Plugin is in registry but not in node_modules (run `sync`)
|
|
331
|
+
- `⚠ Not in registry` - Plugin is in package.json but not tracked in registry
|
|
332
|
+
- `c8ctl sync plugins` synchronizes plugins from the registry, rebuilding or reinstalling as needed
|
|
333
|
+
|
|
234
334
|
**Plugin Requirements:**
|
|
235
335
|
- Plugin packages must be regular Node.js modules
|
|
236
336
|
- They must include a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file in the root directory
|
|
@@ -265,6 +365,7 @@ When plugins are loaded, their commands automatically appear in `c8ctl help` out
|
|
|
265
365
|
### Resource Aliases
|
|
266
366
|
|
|
267
367
|
- `pi` = process-instance(s)
|
|
368
|
+
- `pd` = process-definition(s)
|
|
268
369
|
- `ut` = user-task(s)
|
|
269
370
|
- `inc` = incident(s)
|
|
270
371
|
- `msg` = message
|
|
@@ -275,9 +376,33 @@ When plugins are loaded, their commands automatically appear in `c8ctl help` out
|
|
|
275
376
|
c8ctl <verb> <resource> [arguments] [flags]
|
|
276
377
|
```
|
|
277
378
|
|
|
278
|
-
**Verbs**:
|
|
279
|
-
|
|
280
|
-
|
|
379
|
+
**Verbs**:
|
|
380
|
+
- `list` - List resources
|
|
381
|
+
- `search` - Search resources with filters
|
|
382
|
+
- `get` - Get resource by key
|
|
383
|
+
- `create` - Create resource
|
|
384
|
+
- `cancel` - Cancel resource
|
|
385
|
+
- `complete` - Complete resource
|
|
386
|
+
- `fail` - Fail a job
|
|
387
|
+
- `activate` - Activate jobs
|
|
388
|
+
- `resolve` - Resolve incident
|
|
389
|
+
- `publish` - Publish message
|
|
390
|
+
- `correlate` - Correlate message
|
|
391
|
+
- `deploy` - Deploy BPMN/DMN/forms
|
|
392
|
+
- `run` - Deploy and start process
|
|
393
|
+
- `watch` (alias: `w`) - Watch for changes and auto-deploy
|
|
394
|
+
- `add` - Add a profile
|
|
395
|
+
- `remove` (alias: `rm`) - Remove a profile
|
|
396
|
+
- `load` - Load a plugin
|
|
397
|
+
- `unload` - Unload a plugin
|
|
398
|
+
- `sync` - Synchronize plugins
|
|
399
|
+
- `use` - Set active profile or tenant
|
|
400
|
+
- `output` - Set output format
|
|
401
|
+
- `completion` - Generate shell completion script
|
|
402
|
+
|
|
403
|
+
**Resources**: process-instance (pi), process-definition (pd), user-task (ut), incident (inc), job, jobs, variables, message (msg), topology, profile, tenant, plugin
|
|
404
|
+
|
|
405
|
+
**Tip**: Run `c8ctl help <command>` to see detailed help for specific commands with all available flags.
|
|
281
406
|
|
|
282
407
|
## Testing
|
|
283
408
|
|
|
@@ -302,6 +427,9 @@ Integration tests require a running Camunda 8 instance at `http://localhost:8080
|
|
|
302
427
|
|
|
303
428
|
## Development
|
|
304
429
|
|
|
430
|
+
- **Native TypeScript**: Runs directly with Node.js 22.18+ (no compilation needed)
|
|
431
|
+
|
|
432
|
+
|
|
305
433
|
### Project Structure
|
|
306
434
|
|
|
307
435
|
```
|
|
@@ -354,7 +482,7 @@ c8ctl <command>
|
|
|
354
482
|
- `CAMUNDA_BASE_URL`: Cluster base URL
|
|
355
483
|
- `CAMUNDA_CLIENT_ID`: OAuth client ID
|
|
356
484
|
- `CAMUNDA_CLIENT_SECRET`: OAuth client secret
|
|
357
|
-
- `
|
|
485
|
+
- `CAMUNDA_TOKEN_AUDIENCE`: OAuth token audience
|
|
358
486
|
- `CAMUNDA_OAUTH_URL`: OAuth token endpoint
|
|
359
487
|
- `CAMUNDA_DEFAULT_TENANT_ID`: Default tenant ID
|
|
360
488
|
|
|
@@ -364,13 +492,14 @@ c8ctl <command>
|
|
|
364
492
|
|
|
365
493
|
Configuration is stored in platform-specific user data directories:
|
|
366
494
|
|
|
367
|
-
- **Linux**: `~/.
|
|
495
|
+
- **Linux**: `~/.config/c8ctl/`
|
|
368
496
|
- **macOS**: `~/Library/Application Support/c8ctl/`
|
|
369
497
|
- **Windows**: `%APPDATA%\c8ctl\`
|
|
370
498
|
|
|
371
499
|
Files:
|
|
372
500
|
- `profiles.json`: Saved cluster configurations
|
|
373
501
|
- `session.json`: Active profile, tenant, and output mode
|
|
502
|
+
- `plugins.json`: Plugin registry tracking installed plugins
|
|
374
503
|
|
|
375
504
|
### Camunda Modeler Configuration
|
|
376
505
|
|
|
@@ -388,7 +517,7 @@ Modeler profiles are:
|
|
|
388
517
|
|
|
389
518
|
## License
|
|
390
519
|
|
|
391
|
-
|
|
520
|
+
Apache 2.0 - see LICENSE.md
|
|
392
521
|
|
|
393
522
|
## Contributing
|
|
394
523
|
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAuB,KAAK,aAAa,
|
|
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.
|
|
21
|
+
sdkConfig.CAMUNDA_TOKEN_AUDIENCE = config.audience;
|
|
22
22
|
}
|
|
23
23
|
if (config.oAuthUrl) {
|
|
24
24
|
sdkConfig.CAMUNDA_OAUTH_URL = config.oAuthUrl;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAA2C,MAAM,qCAAqC,CAAC;AACnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,WAAoB;IAC/C,MAAM,MAAM,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAEjD,kCAAkC;IAClC,MAAM,SAAS,GAAsC;QACnD,oBAAoB,EAAE,MAAM,CAAC,OAAO;KACrC,CAAC;IAEF,qCAAqC;IACrC,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC3C,SAAS,CAAC,qBAAqB,GAAG,OAAO,CAAC;QAC1C,SAAS,CAAC,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC9C,SAAS,CAAC,qBAAqB,GAAG,MAAM,CAAC,YAAY,CAAC;QACtD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,QAAQ,CAAC;QACrD,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,SAAS,CAAC,iBAAiB,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChD,CAAC;IACH,CAAC;IACD,0CAA0C;SACrC,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC5C,SAAS,CAAC,qBAAqB,GAAG,OAAO,CAAC;QAC1C,SAAS,CAAC,2BAA2B,GAAG,MAAM,CAAC,QAAQ,CAAC;QACxD,SAAS,CAAC,2BAA2B,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC1D,CAAC;IACD,oBAAoB;SACf,CAAC;QACJ,SAAS,CAAC,qBAAqB,GAAG,MAAM,CAAC;IAC3C,CAAC;IAED,OAAO,mBAAmB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/commands/completion.ts"],"names":[],"mappings":"AAAA;;GAEG;AAswBH;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CA0BnD"}
|