Skip to content

Commit 7cfabc8

Browse files
committed
Merge origin/main into fix/plugin-lifecycle-loading
2 parents 8c14f92 + 65317a8 commit 7cfabc8

File tree

1 file changed

+80
-53
lines changed

1 file changed

+80
-53
lines changed

README.md

Lines changed: 80 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,28 @@ A minimal-dependency CLI for Camunda 8 operations built on top of `@camunda8/orc
2222
- **Client** (`src/client.ts`): Factory for creating Camunda 8 SDK clients
2323
- **Commands** (`src/commands/`): Domain-specific command handlers
2424

25-
### Credential Resolution Order
2625

27-
1. `--profile` flag (one-off override)
28-
2. Active profile from session state
29-
3. Environment variables (`CAMUNDA_*`)
30-
4. Localhost fallback (`http://localhost:8080`)
31-
32-
### Tenant Resolution Order
33-
34-
1. Active tenant from session state
35-
2. Default tenant from active profile
36-
3. `CAMUNDA_DEFAULT_TENANT_ID` environment variable
37-
4. `<default>` tenant
3826

3927
## Installation
4028

4129
### Requirements
4230

4331
- Node.js >= 22.18.0 (for native TypeScript support)
4432

45-
### Install Dependencies
33+
### Global Installation (Recommended)
4634

4735
```bash
48-
npm install
36+
npm install @camunda8/cli -g
4937
```
5038

51-
### Make CLI Executable
39+
After installation, the CLI is available as `c8ctl` (or its alias `c8`).
5240

53-
The CLI runs directly with Node.js 22.18+ which has native TypeScript support:
41+
**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.
5442

55-
```bash
56-
# Run directly with Node.js
57-
node src/index.ts <command>
43+
### Local Development
5844

59-
# Or add an alias to your shell (recommended)
60-
alias c8='node src/index.ts'
45+
```bash
46+
npm install
6147
```
6248

6349
## Usage
@@ -66,57 +52,97 @@ alias c8='node src/index.ts'
6652

6753
```bash
6854
# Show help
69-
c8 help
55+
c8ctl help
7056

7157
# Show version
72-
c8 --version
58+
c8ctl --version
7359

74-
# List process instances
75-
c8 list pi
60+
# List process instances (using alias 'pi')
61+
c8ctl list pi
62+
# Or using full command name
63+
c8ctl list process-instances
7664

7765
# Get process instance by key
78-
c8 get pi 123456
66+
c8ctl get pi 123456
67+
c8ctl get process-instance 123456
7968

8069
# Create process instance
81-
c8 create pi --bpmnProcessId=myProcess
70+
c8ctl create pi --bpmnProcessId=myProcess
71+
c8ctl create process-instance --bpmnProcessId=myProcess
8272

8373
# Deploy BPMN file
84-
c8 deploy ./my-process.bpmn
74+
c8ctl deploy ./my-process.bpmn
8575

8676
# Deploy current directory
87-
c8 deploy
77+
c8ctl deploy
8878

8979
# Deploy and start process (run)
90-
c8 run ./my-process.bpmn
80+
c8ctl run ./my-process.bpmn
81+
```
82+
83+
### Credential Resolution
84+
85+
Credentials are resolved in the following order:
86+
87+
1. `--profile` flag (one-off override)
88+
2. Active profile from session state
89+
3. Environment variables (`CAMUNDA_*`)
90+
4. Localhost fallback (`http://localhost:8080`)
91+
92+
**Note**: Credential configuration via environment variables follows the same conventions as the `@camunda8/orchestration-cluster-api` module.
93+
94+
```bash
95+
# Using environment variables
96+
export CAMUNDA_BASE_URL=https://camunda.example.com
97+
export CAMUNDA_CLIENT_ID=your-client-id
98+
export CAMUNDA_CLIENT_SECRET=your-client-secret
99+
c8ctl list process-instances
100+
101+
# Using profile override
102+
c8ctl list process-instances --profile prod
103+
```
104+
105+
### Tenant Resolution
106+
107+
Tenants are resolved in the following order:
108+
109+
1. Active tenant from session state
110+
2. Default tenant from active profile
111+
3. `CAMUNDA_DEFAULT_TENANT_ID` environment variable
112+
4. `<default>` tenant
113+
114+
```bash
115+
# Set active tenant for the session
116+
c8ctl use tenant my-tenant-id
117+
118+
# Now all commands use this tenant
119+
c8ctl list process-instances
91120
```
92121

93122
### Profile Management
94123

95124
```bash
96125
# Add a profile
97-
c8 add profile prod --baseUrl=https://camunda.example.com --clientId=xxx --clientSecret=yyy
126+
c8ctl add profile prod --baseUrl=https://camunda.example.com --clientId=xxx --clientSecret=yyy
98127

99128
# List profiles
100-
c8 list profiles
129+
c8ctl list profiles
101130

102131
# Set active profile
103-
c8 use profile prod
132+
c8ctl use profile prod
104133

105134
# Remove profile
106-
c8 remove profile prod
135+
c8ctl remove profile prod
107136
```
108137

109138
### Session Management
110139

111140
```bash
112-
# Set active tenant
113-
c8 use tenant my-tenant-id
114-
115141
# Switch to JSON output
116-
c8 output json
142+
c8ctl output json
117143

118144
# Switch back to text output
119-
c8 output text
145+
c8ctl output text
120146
```
121147

122148
### Debug Mode
@@ -142,19 +168,19 @@ c8ctl supports a plugin system that allows extending the CLI with custom command
142168

143169
```bash
144170
# Load a plugin from npm registry
145-
c8 load plugin <package-name>
171+
c8ctl load plugin <package-name>
146172

147173
# Load a plugin from a URL (including file URLs)
148-
c8 load plugin --from <url>
149-
c8 load plugin --from file:///path/to/plugin
150-
c8 load plugin --from https://github.com/user/repo
151-
c8 load plugin --from git://github.com/user/repo.git
174+
c8ctl load plugin --from <url>
175+
c8ctl load plugin --from file:///path/to/plugin
176+
c8ctl load plugin --from https://github.com/user/repo
177+
c8ctl load plugin --from git://github.com/user/repo.git
152178

153179
# Unload a plugin (wraps npm uninstall)
154-
c8 unload plugin <package-name>
180+
c8ctl unload plugin <package-name>
155181

156182
# List installed plugins
157-
c8 list plugins
183+
c8ctl list plugins
158184
```
159185

160186
**Plugin Requirements:**
@@ -184,7 +210,7 @@ export const commands = {
184210
### Command Structure
185211

186212
```
187-
c8 <verb> <resource> [arguments] [flags]
213+
c8ctl <verb> <resource> [arguments] [flags]
188214
```
189215

190216
**Verbs**: list, get, create, cancel, complete, fail, activate, resolve, publish, correlate, deploy, run, add, remove, use, output
@@ -207,11 +233,10 @@ npm run test:unit
207233

208234
### Run Integration Tests
209235

210-
Integration tests are skipped by default as they require a running Camunda 8 instance at `http://localhost:8080`. To run them:
236+
Integration tests require a running Camunda 8 instance at `http://localhost:8080`.
211237

212238
1. Start a local Camunda 8 instance (e.g., using c8run)
213-
2. Update the test files to remove `.skip` from the tests
214-
3. Run: `npm run test:integration`
239+
2. Run: `npm run test:integration`
215240

216241
## Development
217242

@@ -248,11 +273,13 @@ c8ctl/
248273
### Running the CLI
249274

250275
```bash
251-
# With Node.js 22.18+ (native TypeScript)
252-
node src/index.ts <command>
253-
276+
# If installed globally
277+
c8ctl <command>
254278
# Or using the alias
255279
c8 <command>
280+
281+
# For local development with Node.js 22.18+ (native TypeScript)
282+
node src/index.ts <command>
256283
```
257284

258285
### Adding New Commands

0 commit comments

Comments
 (0)