@camunda8/cli 2.1.0 → 2.2.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.
Files changed (64) hide show
  1. package/README.md +18 -1
  2. package/dist/client.d.ts +30 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +55 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/commands/completion.d.ts.map +1 -1
  7. package/dist/commands/completion.js +31 -2
  8. package/dist/commands/completion.js.map +1 -1
  9. package/dist/commands/help.d.ts.map +1 -1
  10. package/dist/commands/help.js +60 -0
  11. package/dist/commands/help.js.map +1 -1
  12. package/dist/commands/incidents.d.ts +4 -0
  13. package/dist/commands/incidents.d.ts.map +1 -1
  14. package/dist/commands/incidents.js +6 -4
  15. package/dist/commands/incidents.js.map +1 -1
  16. package/dist/commands/jobs.d.ts +4 -0
  17. package/dist/commands/jobs.d.ts.map +1 -1
  18. package/dist/commands/jobs.js +6 -4
  19. package/dist/commands/jobs.js.map +1 -1
  20. package/dist/commands/plugins.d.ts.map +1 -1
  21. package/dist/commands/plugins.js +31 -148
  22. package/dist/commands/plugins.js.map +1 -1
  23. package/dist/commands/process-definitions.d.ts +4 -0
  24. package/dist/commands/process-definitions.d.ts.map +1 -1
  25. package/dist/commands/process-definitions.js +6 -4
  26. package/dist/commands/process-definitions.js.map +1 -1
  27. package/dist/commands/process-instances.d.ts +4 -0
  28. package/dist/commands/process-instances.d.ts.map +1 -1
  29. package/dist/commands/process-instances.js +8 -6
  30. package/dist/commands/process-instances.js.map +1 -1
  31. package/dist/commands/profiles.d.ts +4 -0
  32. package/dist/commands/profiles.d.ts.map +1 -1
  33. package/dist/commands/profiles.js +15 -1
  34. package/dist/commands/profiles.js.map +1 -1
  35. package/dist/commands/search.d.ts +20 -1
  36. package/dist/commands/search.d.ts.map +1 -1
  37. package/dist/commands/search.js +36 -43
  38. package/dist/commands/search.js.map +1 -1
  39. package/dist/commands/user-tasks.d.ts +4 -0
  40. package/dist/commands/user-tasks.d.ts.map +1 -1
  41. package/dist/commands/user-tasks.js +6 -4
  42. package/dist/commands/user-tasks.js.map +1 -1
  43. package/dist/default-plugins/hello-world/README.md +3 -0
  44. package/dist/default-plugins/hello-world/c8ctl-plugin.js +4 -0
  45. package/dist/index.js +49 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/logger.d.ts +7 -0
  48. package/dist/logger.d.ts.map +1 -1
  49. package/dist/logger.js +36 -0
  50. package/dist/logger.js.map +1 -1
  51. package/dist/plugin-loader.d.ts.map +1 -1
  52. package/dist/plugin-loader.js +7 -3
  53. package/dist/plugin-loader.js.map +1 -1
  54. package/dist/runtime.d.ts +20 -2
  55. package/dist/runtime.d.ts.map +1 -1
  56. package/dist/runtime.js.map +1 -1
  57. package/dist/templates/AGENTS.md +77 -0
  58. package/dist/templates/README.md +49 -0
  59. package/dist/templates/c8ctl-plugin.js +2 -0
  60. package/dist/templates/c8ctl-plugin.ts +50 -0
  61. package/dist/templates/init-plugin-next-steps.txt +9 -0
  62. package/dist/templates/package.json +22 -0
  63. package/dist/templates/tsconfig.json +15 -0
  64. package/package.json +3 -2
@@ -0,0 +1,50 @@
1
+ /**
2
+ * {{PLUGIN_NAME}} - A c8ctl plugin
3
+ */
4
+
5
+ import type { C8ctlPluginRuntime } from '@camunda8/cli/runtime';
6
+
7
+ // The c8ctl runtime is always populated by the host before plugin code runs
8
+ const c8ctl = globalThis.c8ctl as C8ctlPluginRuntime;
9
+
10
+ // Optional metadata for help text
11
+ export const metadata = {
12
+ name: '{{PLUGIN_NAME}}',
13
+ description: 'A c8ctl plugin',
14
+ commands: {
15
+ hello: {
16
+ description: 'Say hello from the plugin',
17
+ },
18
+ },
19
+ };
20
+
21
+ // Required commands export
22
+ export const commands = {
23
+ hello: async (args: string[]) => {
24
+ const logger = c8ctl.getLogger();
25
+ const tenantId = c8ctl.resolveTenantId();
26
+ console.log('Hello from {{PLUGIN_NAME}}!');
27
+ console.log('c8ctl version:', c8ctl.version);
28
+ console.log('Node version:', c8ctl.nodeVersion);
29
+ console.log('Platform:', c8ctl.platform, c8ctl.arch);
30
+ console.log('Tenant:', tenantId);
31
+
32
+ if (args.length > 0) {
33
+ console.log('Arguments:', args.join(', '));
34
+ }
35
+
36
+ // Example: Access c8ctl runtime
37
+ console.log('Current directory:', c8ctl.cwd);
38
+ console.log('Output mode:', c8ctl.outputMode);
39
+
40
+ if (c8ctl.activeProfile) {
41
+ console.log('Active profile:', c8ctl.activeProfile);
42
+ }
43
+
44
+ logger.info('Plugin logger is ready');
45
+
46
+ // Example: create SDK client from current profile/session config
47
+ const client = c8ctl.createClient();
48
+ console.log('Client available:', typeof client === 'object');
49
+ },
50
+ };
@@ -0,0 +1,9 @@
1
+
2
+ Next steps:
3
+ 1. cd {{PLUGIN_NAME}}
4
+ 2. npm install
5
+ 3. npm run build
6
+ 4. c8ctl load plugin --from file://${PWD}
7
+ 5. c8ctl hello
8
+
9
+ Edit src/c8ctl-plugin.ts to add your plugin logic.
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "{{PLUGIN_NAME}}",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "description": "A c8ctl plugin",
6
+ "keywords": ["c8ctl", "c8ctl-plugin"],
7
+ "main": "c8ctl-plugin.js",
8
+ "files": [
9
+ "dist/**",
10
+ "c8ctl-plugin.js",
11
+ "README.md",
12
+ "AGENTS.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "watch": "tsc --watch"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "^5.0.0",
20
+ "@types/node": "^22.0.0"
21
+ }
22
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ES2022",
5
+ "moduleResolution": "node",
6
+ "outDir": "dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true
12
+ },
13
+ "include": ["src/**/*"],
14
+ "exclude": ["node_modules"]
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda8/cli",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Camunda 8 CLI - minimal-dependency CLI for Camunda 8 operations",
5
5
  "type": "module",
6
6
  "engines": {
@@ -19,9 +19,10 @@
19
19
  "LICENSE"
20
20
  ],
21
21
  "scripts": {
22
- "build": "npm run clean && tsc && npm run copy-plugins",
22
+ "build": "npm run clean && tsc && npm run copy-plugins && npm run copy-templates",
23
23
  "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
24
24
  "copy-plugins": "node -e \"const fs=require('fs');const path=require('path');const src='default-plugins';const dest='dist/default-plugins';if(fs.existsSync(src)){fs.cpSync(src,dest,{recursive:true})}\"",
25
+ "copy-templates": "node -e \"const fs=require('fs');const src='src/templates';const dest='dist/templates';if(fs.existsSync(src)){fs.cpSync(src,dest,{recursive:true})}\"",
25
26
  "prepublishOnly": "npm run build",
26
27
  "test": "node --test tests/unit/setup.test.ts tests/unit/*.test.ts tests/integration/*.test.ts",
27
28
  "test:unit": "node --test tests/unit/setup.test.ts tests/unit/*.test.ts",