@bpmnkit/cli 0.0.9 → 0.0.10

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 urbanisierung
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,113 +1,112 @@
1
- # casen
1
+ <div align="center">
2
+ <img src="https://raw.githubusercontent.com/bpmnkit/monorepo/main/doc/logos/logo-2-gateway.svg" width="72" height="72" alt="BPMN Kit logo">
3
+ <h1>@bpmnkit/cli</h1>
4
+ <p>Command-line interface for Camunda 8 — deploy, manage, and monitor processes from the terminal</p>
2
5
 
3
- CLI for the [Camunda 8 Orchestration Cluster REST API (v2)](https://docs.camunda.io/docs/apis-tools/orchestration-cluster-api-rest/orchestration-cluster-api-rest-overview/).
6
+ [![npm](https://img.shields.io/npm/v/@bpmnkit/cli?style=flat-square&color=6244d7)](https://www.npmjs.com/package/@bpmnkit/cli)
7
+ [![license](https://img.shields.io/npm/l/@bpmnkit/cli?style=flat-square)](https://github.com/bpmnkit/monorepo/blob/main/LICENSE)
8
+ [![typescript](https://img.shields.io/badge/TypeScript-strict-6244d7?style=flat-square&logo=typescript&logoColor=white)](https://github.com/bpmnkit/monorepo)
4
9
 
5
- Commands are auto-generated from the official OpenAPI specs — every resource and operation stays in sync automatically. See [DOCUMENTATION.md](./DOCUMENTATION.md) for the full command reference.
10
+ [Documentation](https://docs.bpmnkit.com) · [GitHub](https://github.com/bpmnkit/monorepo) · [Changelog](https://github.com/bpmnkit/monorepo/blob/main/apps/cli/CHANGELOG.md)
11
+ </div>
6
12
 
7
- ## Features
13
+ ---
8
14
 
9
- - **All API resources** — process instances, jobs, user tasks, decisions, users, groups, tenants, and more
10
- - **Multiple profiles** — store named connection configs and switch between them instantly
11
- - **Three output formats** — human-readable table (default), `--output json`, `--output yaml`
12
- - **Shell completions** — bash, zsh, and fish
13
- - **Zero dependencies** — no runtime requirements beyond Node.js
15
+ ## Overview
14
16
 
15
- ## Installation
17
+ `@bpmnkit/cli` provides the `casen` command-line tool for interacting with Camunda 8 clusters. Manage profiles, deploy processes, run queries, and generate connector templates — all from your terminal.
16
18
 
17
- ```bash
18
- # From the monorepo root
19
- pnpm build
19
+ ## Installation
20
20
 
21
- # Then link globally (optional)
22
- npm link ./apps/cli
21
+ ```sh
22
+ npm install -g @bpmnkit/cli
23
+ # or
24
+ pnpm add -g @bpmnkit/cli
23
25
  ```
24
26
 
25
- ## Quick start
26
-
27
- **1. Create a profile**
27
+ ## Quick Start
28
28
 
29
- ```bash
30
- # Bearer token (local / self-managed)
31
- casen profile create local \
32
- --base-url http://localhost:8080/v2 \
33
- --auth-type bearer \
34
- --token my-token
29
+ ### Configure a profile
35
30
 
36
- # OAuth2 (Camunda SaaS)
37
- casen profile create prod \
38
- --base-url https://<cluster-id>.camunda.io/v2 \
39
- --auth-type oauth2 \
40
- --client-id <client-id> \
41
- --client-secret <client-secret> \
42
- --token-url https://login.cloud.camunda.io/oauth/token
31
+ ```sh
32
+ casen profile add my-cluster
33
+ # Interactive prompts for base URL and auth type
43
34
  ```
44
35
 
45
- The first profile created becomes the active profile automatically.
36
+ ### Deploy a process
46
37
 
47
- **Import from a Camunda Cloud credentials file**
48
-
49
- When you create a client in Camunda Cloud, you can download a credentials file containing `export KEY='VALUE'` declarations. Import it directly:
38
+ ```sh
39
+ casen deploy order-process.bpmn
40
+ ```
50
41
 
51
- ```bash
52
- casen profile import prod ./camunda-credentials.sh
42
+ ### List process instances
53
43
 
54
- # or pipe via stdin
55
- cat camunda-credentials.sh | casen profile import prod -
44
+ ```sh
45
+ casen instances list --state active
56
46
  ```
57
47
 
58
- The file must contain at least:
48
+ ## Commands
59
49
 
60
- | Variable | Fallback |
61
- |----------|----------|
62
- | `ZEEBE_REST_ADDRESS` | _(required)_ |
63
- | `CAMUNDA_CLIENT_ID` | `ZEEBE_CLIENT_ID` |
64
- | `CAMUNDA_CLIENT_SECRET` | `ZEEBE_CLIENT_SECRET` |
65
- | `CAMUNDA_OAUTH_URL` | `ZEEBE_AUTHORIZATION_SERVER_URL` |
50
+ ### Profile management
66
51
 
67
- **2. Run a command**
52
+ | Command | Description |
53
+ |---------|-------------|
54
+ | `casen profile list` | List all configured profiles |
55
+ | `casen profile add <name>` | Add a new profile (interactive) |
56
+ | `casen profile use <name>` | Switch the active profile |
57
+ | `casen profile remove <name>` | Delete a profile |
68
58
 
69
- ```bash
70
- casen process-instance list --filter '{"state":"ACTIVE"}'
71
- casen user-task list --filter '{"assignee":"alice"}'
72
- casen process-instance create --data '{"processDefinitionId":"order-process"}'
73
- ```
74
-
75
- ## Profiles
59
+ ### Process & deployment
76
60
 
77
- Profiles store connection configuration in the OS config directory:
61
+ | Command | Description |
62
+ |---------|-------------|
63
+ | `casen deploy <file>` | Deploy a BPMN, DMN, or form file |
64
+ | `casen processes list` | List deployed process definitions |
65
+ | `casen instances list` | List process instances (--state filter) |
66
+ | `casen instances cancel <key>` | Cancel a running instance |
78
67
 
79
- | Platform | Location |
80
- |----------|----------|
81
- | Linux | `$XDG_CONFIG_HOME/casen/config.json` or `~/.config/casen/config.json` |
82
- | macOS | `~/Library/Application Support/casen/config.json` |
83
- | Windows | `%APPDATA%\casen\config.json` |
68
+ ### Incidents & jobs
84
69
 
85
- Use `--profile <name>` on any command to temporarily override the active profile.
70
+ | Command | Description |
71
+ |---------|-------------|
72
+ | `casen incidents list` | List open incidents |
73
+ | `casen incidents resolve <key>` | Resolve an incident |
74
+ | `casen jobs list` | List active jobs |
86
75
 
87
- ## Output formats
76
+ ### Connector generation
88
77
 
89
- Results can be printed as a table (default), JSON, or YAML via `--output json` / `--output yaml`. Colors and table formatting are automatically disabled when stdout is not a TTY or when `NO_COLOR` is set.
78
+ | Command | Description |
79
+ |---------|-------------|
80
+ | `casen connector generate <spec>` | Generate element templates from OpenAPI/Swagger |
90
81
 
91
- ## Shell completions
82
+ ## Global options
92
83
 
93
- ```bash
94
- # zsh
95
- mkdir -p ~/.zfunc && casen completion zsh > ~/.zfunc/_casen
96
- # add to ~/.zshrc: fpath=(~/.zfunc $fpath) && autoload -Uz compinit && compinit
84
+ | Flag | Description |
85
+ |------|-------------|
86
+ | `--profile <name>` | Use a specific profile for this command |
87
+ | `--json` | Output as JSON (machine-readable) |
88
+ | `--help` | Show help |
97
89
 
98
- # bash
99
- casen completion bash >> ~/.bash_completion
90
+ ---
100
91
 
101
- # fish
102
- casen completion fish > ~/.config/fish/completions/casen.fish
103
- ```
92
+ ## Related Packages
104
93
 
105
- ## Help
94
+ | Package | Description |
95
+ |---------|-------------|
96
+ | [`@bpmnkit/core`](https://www.npmjs.com/package/@bpmnkit/core) | BPMN/DMN/Form parser, builder, layout engine |
97
+ | [`@bpmnkit/canvas`](https://www.npmjs.com/package/@bpmnkit/canvas) | Zero-dependency SVG BPMN viewer |
98
+ | [`@bpmnkit/editor`](https://www.npmjs.com/package/@bpmnkit/editor) | Full-featured interactive BPMN editor |
99
+ | [`@bpmnkit/engine`](https://www.npmjs.com/package/@bpmnkit/engine) | Lightweight BPMN process execution engine |
100
+ | [`@bpmnkit/feel`](https://www.npmjs.com/package/@bpmnkit/feel) | FEEL expression language parser & evaluator |
101
+ | [`@bpmnkit/plugins`](https://www.npmjs.com/package/@bpmnkit/plugins) | 22 composable canvas plugins |
102
+ | [`@bpmnkit/api`](https://www.npmjs.com/package/@bpmnkit/api) | Camunda 8 REST API TypeScript client |
103
+ | [`@bpmnkit/ascii`](https://www.npmjs.com/package/@bpmnkit/ascii) | Render BPMN diagrams as Unicode ASCII art |
104
+ | [`@bpmnkit/ui`](https://www.npmjs.com/package/@bpmnkit/ui) | Shared design tokens and UI components |
105
+ | [`@bpmnkit/profiles`](https://www.npmjs.com/package/@bpmnkit/profiles) | Shared auth, profile storage, and client factories for CLI & proxy |
106
+ | [`@bpmnkit/operate`](https://www.npmjs.com/package/@bpmnkit/operate) | Monitoring & operations frontend for Camunda clusters |
107
+ | [`@bpmnkit/connector-gen`](https://www.npmjs.com/package/@bpmnkit/connector-gen) | Generate connector templates from OpenAPI specs |
108
+ | [`@bpmnkit/proxy`](https://www.npmjs.com/package/@bpmnkit/proxy) | Local AI bridge and Camunda API proxy server |
106
109
 
107
- ```bash
108
- casen --help # Global help
109
- casen <resource> --help # Resource-level help
110
- casen <resource> <command> --help # Command-level help
111
- ```
110
+ ## License
112
111
 
113
- For all available resources and commands see [DOCUMENTATION.md](./DOCUMENTATION.md).
112
+ [MIT](https://github.com/bpmnkit/monorepo/blob/main/LICENSE) © BPMN Kit
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,32 +1,50 @@
1
1
  {
2
- "name": "@bpmnkit/cli",
3
- "version": "0.0.9",
4
- "description": "Camunda v2 REST API command-line interface",
5
- "type": "module",
6
- "bin": {
7
- "casen": "./dist/index.js"
8
- },
9
- "files": ["dist/**/*.js"],
10
- "engines": {
11
- "node": ">=20"
12
- },
13
- "scripts": {
14
- "build": "tsc",
15
- "typecheck": "tsc --noEmit",
16
- "check": "biome check .",
17
- "test": "vitest run"
18
- },
19
- "dependencies": {
20
- "@bpmnkit/api": "workspace:*",
21
- "@bpmnkit/ascii": "workspace:*",
22
- "@bpmnkit/connector-gen": "workspace:*",
23
- "@bpmnkit/profiles": "workspace:*"
24
- },
25
- "publishConfig": {
26
- "access": "public"
27
- },
28
- "repository": {
29
- "type": "git",
30
- "url": "https://github.com/bpmnkit/monorepo"
31
- }
32
- }
2
+ "name": "@bpmnkit/cli",
3
+ "version": "0.0.10",
4
+ "description": "Command-line interface for Camunda 8 deploy, manage, and monitor processes from the terminal",
5
+ "type": "module",
6
+ "bin": {
7
+ "casen": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "README.md",
11
+ "dist/**/*.js"
12
+ ],
13
+ "engines": {
14
+ "node": ">=20"
15
+ },
16
+ "dependencies": {
17
+ "@bpmnkit/api": "0.0.9",
18
+ "@bpmnkit/ascii": "0.0.9",
19
+ "@bpmnkit/connector-gen": "0.0.3",
20
+ "@bpmnkit/profiles": "0.0.6"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/bpmnkit/monorepo"
28
+ },
29
+ "keywords": [
30
+ "camunda",
31
+ "bpmn",
32
+ "cli",
33
+ "terminal",
34
+ "zeebe",
35
+ "workflow",
36
+ "typescript",
37
+ "casen"
38
+ ],
39
+ "license": "MIT",
40
+ "homepage": "https://bpmnkit.com",
41
+ "bugs": {
42
+ "url": "https://github.com/bpmnkit/monorepo/issues"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc",
46
+ "typecheck": "tsc --noEmit",
47
+ "check": "biome check .",
48
+ "test": "vitest run"
49
+ }
50
+ }
package/dist/client.js DELETED
@@ -1,19 +0,0 @@
1
- import { AdminApiClient, CamundaClient } from "@bpmn-sdk/api";
2
- import { getActiveProfile, getProfile } from "./profile.js";
3
- function requireProfile(profileName) {
4
- const profile = profileName ? getProfile(profileName) : getActiveProfile();
5
- if (!profile) {
6
- if (profileName) {
7
- throw new Error(`Profile "${profileName}" not found. Run \`casen profile list\` to see available profiles.`);
8
- }
9
- throw new Error("No active profile. Create one with:\n\n casen profile create <name> --base-url <url> --auth-type bearer --token <token>\n");
10
- }
11
- return profile;
12
- }
13
- export function createClientFromProfile(profileName) {
14
- return new CamundaClient(requireProfile(profileName).config);
15
- }
16
- export function createAdminClientFromProfile(profileName) {
17
- return new AdminApiClient(requireProfile(profileName).config);
18
- }
19
- //# sourceMappingURL=client.js.map
package/dist/profile.js DELETED
@@ -1,103 +0,0 @@
1
- import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
- import { homedir, platform } from "node:os";
3
- import { join } from "node:path";
4
- // ─── Config directory ─────────────────────────────────────────────────────────
5
- function configDir() {
6
- const p = platform();
7
- if (p === "win32")
8
- return join(process.env.APPDATA ?? homedir(), "casen");
9
- if (p === "darwin")
10
- return join(homedir(), "Library", "Application Support", "casen");
11
- return join(process.env.XDG_CONFIG_HOME ?? join(homedir(), ".config"), "casen");
12
- }
13
- function configFilePath() {
14
- return join(configDir(), "config.json");
15
- }
16
- // ─── Read / write ─────────────────────────────────────────────────────────────
17
- function readStore() {
18
- try {
19
- const raw = readFileSync(configFilePath(), "utf8");
20
- const store = JSON.parse(raw);
21
- if (!store.meta)
22
- store.meta = {};
23
- return store;
24
- }
25
- catch {
26
- return { profiles: {}, active: null, meta: {} };
27
- }
28
- }
29
- function writeStore(store) {
30
- const dir = configDir();
31
- mkdirSync(dir, { recursive: true });
32
- writeFileSync(configFilePath(), JSON.stringify(store, null, 2), "utf8");
33
- }
34
- // ─── Public API ───────────────────────────────────────────────────────────────
35
- export function listProfiles() {
36
- const store = readStore();
37
- return Object.entries(store.profiles).map(([name, config]) => ({
38
- name,
39
- apiType: store.meta[name]?.apiType ?? "c8",
40
- config,
41
- createdAt: store.meta[name]?.createdAt ?? null,
42
- }));
43
- }
44
- export function getProfile(name) {
45
- const store = readStore();
46
- const config = store.profiles[name];
47
- if (!config)
48
- return undefined;
49
- return {
50
- name,
51
- apiType: store.meta[name]?.apiType ?? "c8",
52
- config,
53
- createdAt: store.meta[name]?.createdAt ?? null,
54
- };
55
- }
56
- export function getActiveProfile() {
57
- const store = readStore();
58
- if (!store.active)
59
- return undefined;
60
- return getProfile(store.active);
61
- }
62
- export function getActiveName() {
63
- return readStore().active;
64
- }
65
- export function saveProfile(name, config, apiType = "c8") {
66
- const store = readStore();
67
- store.profiles[name] = config;
68
- if (!store.meta[name]) {
69
- store.meta[name] = { createdAt: new Date().toISOString(), apiType };
70
- }
71
- else {
72
- store.meta[name].apiType = apiType;
73
- }
74
- // Auto-activate if this is the first profile
75
- if (store.active === null)
76
- store.active = name;
77
- writeStore(store);
78
- }
79
- export function deleteProfile(name) {
80
- const store = readStore();
81
- if (!(name in store.profiles))
82
- return false;
83
- const { [name]: _removed, ...rest } = store.profiles;
84
- store.profiles = rest;
85
- if (store.active === name) {
86
- const remaining = Object.keys(store.profiles);
87
- store.active = remaining.length > 0 ? (remaining[0] ?? null) : null;
88
- }
89
- writeStore(store);
90
- return true;
91
- }
92
- export function useProfile(name) {
93
- const store = readStore();
94
- if (!(name in store.profiles))
95
- return false;
96
- store.active = name;
97
- writeStore(store);
98
- return true;
99
- }
100
- export function getConfigFilePath() {
101
- return configFilePath();
102
- }
103
- //# sourceMappingURL=profile.js.map