@@ -45,22 +45,20 @@ A minimal-dependency CLI for Camunda 8 operations built on top of `@camunda8/orc
4545
4646- Node.js >= 22.18.0 (for native TypeScript support)
4747
48- ### Install Dependencies
48+ ### Global Installation (Recommended)
4949
5050``` bash
51- npm install
51+ npm install @camunda8/cli -g
5252```
5353
54- ### Make CLI Executable
54+ After installation, the CLI is available as ` c8ctl ` (or its alias ` c8 ` ).
5555
56- The CLI runs directly with Node.js 22.18+ which has native TypeScript support:
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.
5757
58- ``` bash
59- # Run directly with Node.js
60- node src/index.ts < command>
58+ ### Local Development
6159
62- # Or add an alias to your shell (recommended)
63- alias c8= ' node src/index.ts '
60+ ``` bash
61+ npm install
6462```
6563
6664## Usage
@@ -69,28 +67,71 @@ alias c8='node src/index.ts'
6967
7068``` bash
7169# Show help
72- c8 help
70+ c8ctl help
7371
7472# Show version
75- c8 --version
73+ c8ctl --version
7674
77- # List process instances
78- c8 list pi
75+ # List process instances (using alias 'pi')
76+ c8ctl list pi
77+ # Or using full command name
78+ c8ctl list process-instances
7979
8080# Get process instance by key
81- c8 get pi 123456
81+ c8ctl get pi 123456
82+ c8ctl get process-instance 123456
8283
8384# Create process instance
84- c8 create pi --bpmnProcessId=myProcess
85+ c8ctl create pi --bpmnProcessId=myProcess
86+ c8ctl create process-instance --bpmnProcessId=myProcess
8587
8688# Deploy BPMN file
87- c8 deploy ./my-process.bpmn
89+ c8ctl deploy ./my-process.bpmn
8890
8991# Deploy current directory
90- c8 deploy
92+ c8ctl deploy
9193
9294# Deploy and start process (run)
93- c8 run ./my-process.bpmn
95+ c8ctl run ./my-process.bpmn
96+ ```
97+
98+ ### Credential Resolution
99+
100+ Credentials are resolved in the following order:
101+
102+ 1 . ` --profile ` flag (one-off override)
103+ 2 . Active profile from session state
104+ 3 . Environment variables (` CAMUNDA_* ` )
105+ 4 . Localhost fallback (` http://localhost:8080 ` )
106+
107+ ** Note** : Credential configuration via environment variables follows the same conventions as the ` @camunda8/orchestration-cluster-api ` module.
108+
109+ ``` bash
110+ # Using environment variables
111+ export CAMUNDA_BASE_URL=https://camunda.example.com
112+ export CAMUNDA_CLIENT_ID=your-client-id
113+ export CAMUNDA_CLIENT_SECRET=your-client-secret
114+ c8ctl list process-instances
115+
116+ # Using profile override
117+ c8ctl list process-instances --profile prod
118+ ```
119+
120+ ### Tenant Resolution
121+
122+ Tenants are resolved in the following order:
123+
124+ 1 . Active tenant from session state
125+ 2 . Default tenant from active profile
126+ 3 . ` CAMUNDA_DEFAULT_TENANT_ID ` environment variable
127+ 4 . ` <default> ` tenant
128+
129+ ``` bash
130+ # Set active tenant for the session
131+ c8ctl use tenant my-tenant-id
132+
133+ # Now all commands use this tenant
134+ c8ctl list process-instances
94135```
95136
96137### Profile Management
@@ -148,34 +189,55 @@ c8 list pi --profile=modeler:Cloud Cluster
148189### Session Management
149190
150191``` bash
151- # Set active tenant
152- c8 use tenant my-tenant-id
153-
154192# Switch to JSON output
155- c8 output json
193+ c8ctl output json
156194
157195# Switch back to text output
158- c8 output text
196+ c8ctl output text
159197```
160198
199+ ### Debug Mode
200+
201+ Enable debug logging to see detailed information about plugin loading and other internal operations:
202+
203+ ``` bash
204+ # Enable debug mode with environment variable
205+ DEBUG=1 c8 < command>
206+
207+ # Or use C8CTL_DEBUG
208+ C8CTL_DEBUG=true c8 < command>
209+
210+ # Example: See plugin loading details
211+ DEBUG=1 c8 list plugins
212+ ```
213+
214+ Debug output is written to stderr with timestamps and won't interfere with normal command output.
215+
161216### Plugin Management
162217
163218c8ctl supports a plugin system that allows extending the CLI with custom commands via npm packages.
164219
165220``` bash
166- # Load a plugin (wraps npm install)
167- c8 load plugin < package-name>
221+ # Load a plugin from npm registry
222+ c8ctl load plugin < package-name>
223+
224+ # Load a plugin from a URL (including file URLs)
225+ c8ctl load plugin --from < url>
226+ c8ctl load plugin --from file:///path/to/plugin
227+ c8ctl load plugin --from https://github.com/user/repo
228+ c8ctl load plugin --from git://github.com/user/repo.git
168229
169230# Unload a plugin (wraps npm uninstall)
170- c8 unload plugin < package-name>
231+ c8ctl unload plugin < package-name>
171232
172233# List installed plugins
173- c8 list plugins
234+ c8ctl list plugins
174235```
175236
176237** Plugin Requirements:**
177- - Plugin packages must include a ` c8ctl-plugin.js ` or ` c8ctl-plugin.ts ` file
178- - The plugin file should export custom commands
238+ - Plugin packages must be regular Node.js modules
239+ - They must include a ` c8ctl-plugin.js ` or ` c8ctl-plugin.ts ` file in the root directory
240+ - The plugin file must export a ` commands ` object
179241- Plugins are installed in ` node_modules ` like regular npm packages
180242- The runtime object ` c8ctl ` provides environment information to plugins
181243
@@ -199,7 +261,7 @@ export const commands = {
199261### Command Structure
200262
201263```
202- c8 <verb> <resource> [arguments] [flags]
264+ c8ctl <verb> <resource> [arguments] [flags]
203265```
204266
205267** Verbs** : list, get, create, cancel, complete, fail, activate, resolve, publish, correlate, deploy, run, add, remove, use, output
@@ -222,11 +284,10 @@ npm run test:unit
222284
223285### Run Integration Tests
224286
225- Integration tests are skipped by default as they require a running Camunda 8 instance at ` http://localhost:8080 ` . To run them:
287+ Integration tests require a running Camunda 8 instance at ` http://localhost:8080 ` .
226288
2272891 . Start a local Camunda 8 instance (e.g., using c8run)
228- 2 . Update the test files to remove ` .skip ` from the tests
229- 3 . Run: ` npm run test:integration `
290+ 2 . Run: ` npm run test:integration `
230291
231292## Development
232293
@@ -263,11 +324,13 @@ c8ctl/
263324### Running the CLI
264325
265326``` bash
266- # With Node.js 22.18+ (native TypeScript)
267- node src/index.ts < command>
268-
327+ # If installed globally
328+ c8ctl < command>
269329# Or using the alias
270330c8 < command>
331+
332+ # For local development with Node.js 22.18+ (native TypeScript)
333+ node src/index.ts < command>
271334```
272335
273336### Adding New Commands
0 commit comments