@cargo-ai/cli 1.0.1

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 (218) hide show
  1. package/README.md +114 -0
  2. package/build/api.d.ts +4 -0
  3. package/build/api.d.ts.map +1 -0
  4. package/build/api.js +10 -0
  5. package/build/commands/ai/agent.d.ts +4 -0
  6. package/build/commands/ai/agent.d.ts.map +1 -0
  7. package/build/commands/ai/agent.js +83 -0
  8. package/build/commands/ai/chat.d.ts +4 -0
  9. package/build/commands/ai/chat.d.ts.map +1 -0
  10. package/build/commands/ai/chat.js +71 -0
  11. package/build/commands/ai/document.d.ts +4 -0
  12. package/build/commands/ai/document.d.ts.map +1 -0
  13. package/build/commands/ai/document.js +59 -0
  14. package/build/commands/ai/file.d.ts +4 -0
  15. package/build/commands/ai/file.d.ts.map +1 -0
  16. package/build/commands/ai/file.js +74 -0
  17. package/build/commands/ai/index.d.ts +4 -0
  18. package/build/commands/ai/index.d.ts.map +1 -0
  19. package/build/commands/ai/index.js +33 -0
  20. package/build/commands/ai/mcpClient.d.ts +4 -0
  21. package/build/commands/ai/mcpClient.d.ts.map +1 -0
  22. package/build/commands/ai/mcpClient.js +31 -0
  23. package/build/commands/ai/mcpServer.d.ts +4 -0
  24. package/build/commands/ai/mcpServer.d.ts.map +1 -0
  25. package/build/commands/ai/mcpServer.js +62 -0
  26. package/build/commands/ai/memory.d.ts +4 -0
  27. package/build/commands/ai/memory.d.ts.map +1 -0
  28. package/build/commands/ai/memory.js +50 -0
  29. package/build/commands/ai/message.d.ts +4 -0
  30. package/build/commands/ai/message.d.ts.map +1 -0
  31. package/build/commands/ai/message.js +86 -0
  32. package/build/commands/ai/prompt.d.ts +4 -0
  33. package/build/commands/ai/prompt.d.ts.map +1 -0
  34. package/build/commands/ai/prompt.js +34 -0
  35. package/build/commands/ai/release.d.ts +4 -0
  36. package/build/commands/ai/release.d.ts.map +1 -0
  37. package/build/commands/ai/release.js +150 -0
  38. package/build/commands/ai/skill.d.ts +4 -0
  39. package/build/commands/ai/skill.d.ts.map +1 -0
  40. package/build/commands/ai/skill.js +96 -0
  41. package/build/commands/ai/suggestedAction.d.ts +4 -0
  42. package/build/commands/ai/suggestedAction.d.ts.map +1 -0
  43. package/build/commands/ai/suggestedAction.js +37 -0
  44. package/build/commands/ai/template.d.ts +4 -0
  45. package/build/commands/ai/template.d.ts.map +1 -0
  46. package/build/commands/ai/template.js +14 -0
  47. package/build/commands/ai/vote.d.ts +4 -0
  48. package/build/commands/ai/vote.d.ts.map +1 -0
  49. package/build/commands/ai/vote.js +28 -0
  50. package/build/commands/auth.d.ts +3 -0
  51. package/build/commands/auth.d.ts.map +1 -0
  52. package/build/commands/auth.js +73 -0
  53. package/build/commands/billing/index.d.ts +4 -0
  54. package/build/commands/billing/index.d.ts.map +1 -0
  55. package/build/commands/billing/index.js +9 -0
  56. package/build/commands/billing/subscription.d.ts +4 -0
  57. package/build/commands/billing/subscription.d.ts.map +1 -0
  58. package/build/commands/billing/subscription.js +119 -0
  59. package/build/commands/billing/usage.d.ts +4 -0
  60. package/build/commands/billing/usage.d.ts.map +1 -0
  61. package/build/commands/billing/usage.js +33 -0
  62. package/build/commands/connection/connector.d.ts +4 -0
  63. package/build/commands/connection/connector.d.ts.map +1 -0
  64. package/build/commands/connection/connector.js +129 -0
  65. package/build/commands/connection/index.d.ts +4 -0
  66. package/build/commands/connection/index.d.ts.map +1 -0
  67. package/build/commands/connection/index.js +11 -0
  68. package/build/commands/connection/integration.d.ts +4 -0
  69. package/build/commands/connection/integration.d.ts.map +1 -0
  70. package/build/commands/connection/integration.js +35 -0
  71. package/build/commands/connection/nativeIntegration.d.ts +4 -0
  72. package/build/commands/connection/nativeIntegration.d.ts.map +1 -0
  73. package/build/commands/connection/nativeIntegration.js +14 -0
  74. package/build/commands/expression/expressionEval.d.ts +4 -0
  75. package/build/commands/expression/expressionEval.d.ts.map +1 -0
  76. package/build/commands/expression/expressionEval.js +32 -0
  77. package/build/commands/expression/favoriteRecipe.d.ts +4 -0
  78. package/build/commands/expression/favoriteRecipe.d.ts.map +1 -0
  79. package/build/commands/expression/favoriteRecipe.js +24 -0
  80. package/build/commands/expression/index.d.ts +4 -0
  81. package/build/commands/expression/index.d.ts.map +1 -0
  82. package/build/commands/expression/index.js +11 -0
  83. package/build/commands/expression/recipe.d.ts +4 -0
  84. package/build/commands/expression/recipe.d.ts.map +1 -0
  85. package/build/commands/expression/recipe.js +98 -0
  86. package/build/commands/init.d.ts +4 -0
  87. package/build/commands/init.d.ts.map +1 -0
  88. package/build/commands/init.js +11 -0
  89. package/build/commands/orchestration/batch.d.ts +4 -0
  90. package/build/commands/orchestration/batch.d.ts.map +1 -0
  91. package/build/commands/orchestration/batch.js +106 -0
  92. package/build/commands/orchestration/draftRelease.d.ts +4 -0
  93. package/build/commands/orchestration/draftRelease.d.ts.map +1 -0
  94. package/build/commands/orchestration/draftRelease.js +73 -0
  95. package/build/commands/orchestration/index.d.ts +4 -0
  96. package/build/commands/orchestration/index.d.ts.map +1 -0
  97. package/build/commands/orchestration/index.js +25 -0
  98. package/build/commands/orchestration/node.d.ts +4 -0
  99. package/build/commands/orchestration/node.d.ts.map +1 -0
  100. package/build/commands/orchestration/node.js +44 -0
  101. package/build/commands/orchestration/play.d.ts +4 -0
  102. package/build/commands/orchestration/play.d.ts.map +1 -0
  103. package/build/commands/orchestration/play.js +63 -0
  104. package/build/commands/orchestration/record.d.ts +4 -0
  105. package/build/commands/orchestration/record.d.ts.map +1 -0
  106. package/build/commands/orchestration/record.js +194 -0
  107. package/build/commands/orchestration/release.d.ts +4 -0
  108. package/build/commands/orchestration/release.d.ts.map +1 -0
  109. package/build/commands/orchestration/release.js +27 -0
  110. package/build/commands/orchestration/run.d.ts +4 -0
  111. package/build/commands/orchestration/run.d.ts.map +1 -0
  112. package/build/commands/orchestration/run.js +196 -0
  113. package/build/commands/orchestration/template.d.ts +4 -0
  114. package/build/commands/orchestration/template.d.ts.map +1 -0
  115. package/build/commands/orchestration/template.js +22 -0
  116. package/build/commands/orchestration/tool.d.ts +4 -0
  117. package/build/commands/orchestration/tool.d.ts.map +1 -0
  118. package/build/commands/orchestration/tool.js +72 -0
  119. package/build/commands/orchestration/workflow.d.ts +4 -0
  120. package/build/commands/orchestration/workflow.d.ts.map +1 -0
  121. package/build/commands/orchestration/workflow.js +14 -0
  122. package/build/commands/revenueOrganization/allocation.d.ts +4 -0
  123. package/build/commands/revenueOrganization/allocation.d.ts.map +1 -0
  124. package/build/commands/revenueOrganization/allocation.js +45 -0
  125. package/build/commands/revenueOrganization/capacity.d.ts +4 -0
  126. package/build/commands/revenueOrganization/capacity.d.ts.map +1 -0
  127. package/build/commands/revenueOrganization/capacity.js +94 -0
  128. package/build/commands/revenueOrganization/index.d.ts +4 -0
  129. package/build/commands/revenueOrganization/index.d.ts.map +1 -0
  130. package/build/commands/revenueOrganization/index.js +13 -0
  131. package/build/commands/revenueOrganization/member.d.ts +4 -0
  132. package/build/commands/revenueOrganization/member.d.ts.map +1 -0
  133. package/build/commands/revenueOrganization/member.js +62 -0
  134. package/build/commands/revenueOrganization/territory.d.ts +4 -0
  135. package/build/commands/revenueOrganization/territory.d.ts.map +1 -0
  136. package/build/commands/revenueOrganization/territory.js +72 -0
  137. package/build/commands/runHandler.d.ts +4 -0
  138. package/build/commands/runHandler.d.ts.map +1 -0
  139. package/build/commands/runHandler.js +33 -0
  140. package/build/commands/segmentation/change.d.ts +4 -0
  141. package/build/commands/segmentation/change.d.ts.map +1 -0
  142. package/build/commands/segmentation/change.js +61 -0
  143. package/build/commands/segmentation/index.d.ts +4 -0
  144. package/build/commands/segmentation/index.d.ts.map +1 -0
  145. package/build/commands/segmentation/index.js +11 -0
  146. package/build/commands/segmentation/record.d.ts +4 -0
  147. package/build/commands/segmentation/record.d.ts.map +1 -0
  148. package/build/commands/segmentation/record.js +21 -0
  149. package/build/commands/segmentation/segment.d.ts +4 -0
  150. package/build/commands/segmentation/segment.d.ts.map +1 -0
  151. package/build/commands/segmentation/segment.js +130 -0
  152. package/build/commands/storage/column.d.ts +4 -0
  153. package/build/commands/storage/column.d.ts.map +1 -0
  154. package/build/commands/storage/column.js +84 -0
  155. package/build/commands/storage/dataset.d.ts +4 -0
  156. package/build/commands/storage/dataset.d.ts.map +1 -0
  157. package/build/commands/storage/dataset.js +20 -0
  158. package/build/commands/storage/index.d.ts +4 -0
  159. package/build/commands/storage/index.d.ts.map +1 -0
  160. package/build/commands/storage/index.js +17 -0
  161. package/build/commands/storage/model.d.ts +4 -0
  162. package/build/commands/storage/model.d.ts.map +1 -0
  163. package/build/commands/storage/model.js +141 -0
  164. package/build/commands/storage/record.d.ts +4 -0
  165. package/build/commands/storage/record.d.ts.map +1 -0
  166. package/build/commands/storage/record.js +15 -0
  167. package/build/commands/storage/relationship.d.ts +4 -0
  168. package/build/commands/storage/relationship.d.ts.map +1 -0
  169. package/build/commands/storage/relationship.js +27 -0
  170. package/build/commands/storage/run.d.ts +4 -0
  171. package/build/commands/storage/run.d.ts.map +1 -0
  172. package/build/commands/storage/run.js +42 -0
  173. package/build/commands/systemOfRecordIntegration/client.d.ts +4 -0
  174. package/build/commands/systemOfRecordIntegration/client.d.ts.map +1 -0
  175. package/build/commands/systemOfRecordIntegration/client.js +46 -0
  176. package/build/commands/systemOfRecordIntegration/index.d.ts +4 -0
  177. package/build/commands/systemOfRecordIntegration/index.d.ts.map +1 -0
  178. package/build/commands/systemOfRecordIntegration/index.js +11 -0
  179. package/build/commands/systemOfRecordIntegration/log.d.ts +4 -0
  180. package/build/commands/systemOfRecordIntegration/log.d.ts.map +1 -0
  181. package/build/commands/systemOfRecordIntegration/log.js +36 -0
  182. package/build/commands/systemOfRecordIntegration/systemOfRecord.d.ts +4 -0
  183. package/build/commands/systemOfRecordIntegration/systemOfRecord.d.ts.map +1 -0
  184. package/build/commands/systemOfRecordIntegration/systemOfRecord.js +72 -0
  185. package/build/commands/userManagement/index.d.ts +4 -0
  186. package/build/commands/userManagement/index.d.ts.map +1 -0
  187. package/build/commands/userManagement/index.js +32 -0
  188. package/build/commands/workspace/file.d.ts +4 -0
  189. package/build/commands/workspace/file.d.ts.map +1 -0
  190. package/build/commands/workspace/file.js +44 -0
  191. package/build/commands/workspace/folder.d.ts +4 -0
  192. package/build/commands/workspace/folder.d.ts.map +1 -0
  193. package/build/commands/workspace/folder.js +64 -0
  194. package/build/commands/workspace/index.d.ts +4 -0
  195. package/build/commands/workspace/index.d.ts.map +1 -0
  196. package/build/commands/workspace/index.js +17 -0
  197. package/build/commands/workspace/role.d.ts +4 -0
  198. package/build/commands/workspace/role.d.ts.map +1 -0
  199. package/build/commands/workspace/role.js +12 -0
  200. package/build/commands/workspace/token.d.ts +4 -0
  201. package/build/commands/workspace/token.d.ts.map +1 -0
  202. package/build/commands/workspace/token.js +31 -0
  203. package/build/commands/workspace/user.d.ts +4 -0
  204. package/build/commands/workspace/user.d.ts.map +1 -0
  205. package/build/commands/workspace/user.js +105 -0
  206. package/build/commands/workspace/workspaces.d.ts +4 -0
  207. package/build/commands/workspace/workspaces.d.ts.map +1 -0
  208. package/build/commands/workspace/workspaces.js +74 -0
  209. package/build/config.d.ts +7 -0
  210. package/build/config.d.ts.map +1 -0
  211. package/build/config.js +45 -0
  212. package/build/credentials.d.ts +10 -0
  213. package/build/credentials.d.ts.map +1 -0
  214. package/build/credentials.js +31 -0
  215. package/build/index.d.ts +2 -0
  216. package/build/index.d.ts.map +1 -0
  217. package/build/index.js +37 -0
  218. package/package.json +44 -0
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # Cargo CLI
2
+
3
+ Command-line interface for the [Cargo API](https://docs.getcargo.ai/api-reference/introduction). Manage workspaces, storage, orchestration, connections, billing, and more from the terminal.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 22.x
8
+ - A Cargo API token (create in your workspace under **Settings → API**)
9
+
10
+ ## Installation
11
+
12
+ Install from npm (global):
13
+
14
+ ```bash
15
+ npm install -g @cargo-ai/cli
16
+ ```
17
+
18
+ Or run once with `npx` without installing:
19
+
20
+ ```bash
21
+ npx @cargo-ai/cli orchestration workflow list
22
+ ```
23
+
24
+ ## Authentication
25
+
26
+ ### Login (recommended)
27
+
28
+ ```bash
29
+ cargo-ai login --token <your-api-token>
30
+ ```
31
+
32
+ Credentials are stored in `~/.config/cargo-ai/credentials.json` (file mode `0600`).
33
+
34
+ ```bash
35
+ # Check current auth status
36
+ cargo-ai whoami
37
+
38
+ # Remove saved credentials
39
+ cargo-ai logout
40
+ ```
41
+
42
+ ### Environment variables (override)
43
+
44
+ Environment variables take precedence over saved credentials, useful for CI or temporary overrides.
45
+
46
+ | Variable | Default | Description |
47
+ | ---------------------- | ------------------------- | ------------------------------------------------------------------------------------------- |
48
+ | `CARGO_API_TOKEN` | — | Your Cargo API token (Bearer auth) |
49
+ | `CARGO_BASE_URL` | `https://api.getcargo.io` | API base URL |
50
+ | `CARGO_WORKSPACE_UUID` | — | Workspace UUID for workspace-scoped commands (some commands also accept `--workspace-uuid`) |
51
+
52
+ ## Usage
53
+
54
+ Command structure: `cargo-ai <domain> <sub> <action>`.
55
+
56
+ After a global install, run:
57
+
58
+ ```bash
59
+ cargo-ai <domain> <sub> <action>
60
+ ```
61
+
62
+ Without installing, use `npx`:
63
+
64
+ ```bash
65
+ npx @cargo-ai/cli <domain> <sub> <action>
66
+ ```
67
+
68
+ All commands output JSON to stdout.
69
+
70
+ ### Help
71
+
72
+ ```bash
73
+ cargo-ai --help
74
+ cargo-ai orchestration --help
75
+ cargo-ai orchestration workflow --help
76
+ ```
77
+
78
+ ### Domains and example commands
79
+
80
+ | Domain | Description | Example commands |
81
+ | ------------------------ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
82
+ | **init** | Workspace initialisation (user, workspace, datasets, etc.) | `cargo-ai init` |
83
+ | **orchestration** | Workflows, plays, runs, batches, tools, templates | `cargo-ai orchestration workflow list`, `cargo-ai orchestration run list --workflow-uuid <uuid>` |
84
+ | **workspace** | Workspaces, users, tokens, roles, folders | `cargo-ai workspace workspaces list`, `cargo-ai workspace token list` |
85
+ | **storage** | Datasets, models, relationships, runs, records | `cargo-ai storage dataset list`, `cargo-ai storage model list` |
86
+ | **connection** | Connectors and integrations | `cargo-ai connection connector list`, `cargo-ai connection integration list` |
87
+ | **billing** | Usage and subscription | `cargo-ai billing subscription get`, `cargo-ai billing usage get-metrics --payload '{"from":"2025-01-01","to":"2025-01-31"}'` |
88
+ | **segmentation** | Segments and changes | `cargo-ai segmentation segment list`, `cargo-ai segmentation change list --payload '{}'` |
89
+ | **revenue-organization** | Allocations, capacities, members, territories | `cargo-ai revenue-organization member list`, `cargo-ai revenue-organization territory list` |
90
+ | **expression** | Recipes and expression evaluation | `cargo-ai expression recipe list`, `cargo-ai expression eval evaluate --payload '{}'` |
91
+ | **system-of-record** | System of record, client, logs | `cargo-ai system-of-record sor list`, `cargo-ai system-of-record log list --payload '{}'` |
92
+ | **user-management** | Current user (no workspace context) | `cargo-ai user-management user get-current` |
93
+ | **ai** | AI templates, agents, releases, chats, MCP, files | `cargo-ai ai template list`, `cargo-ai ai agent list`, `cargo-ai ai file list` |
94
+
95
+ Commands that accept complex payloads use a `--payload <json>` option (e.g. `cargo-ai orchestration play create --payload '{"name":"My Play",...}'`). Use `--help` on any subcommand for options.
96
+
97
+ ## Development
98
+
99
+ ```bash
100
+ # Build
101
+ npm run build
102
+
103
+ # Run with tsx (no build)
104
+ npm run dev
105
+ # then in another terminal: npx tsx src/index.ts orchestration workflow list
106
+
107
+ # Type-check and lint
108
+ npm run type:check
109
+ npm run lint:check
110
+ ```
111
+
112
+ ## License
113
+
114
+ See the project for license information.
package/build/api.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { type Api } from "@cargo-ai/api";
2
+ export type { Api };
3
+ export declare function createApi(): Api;
4
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,eAAe,CAAC;AAInD,YAAY,EAAE,GAAG,EAAE,CAAC;AAEpB,wBAAgB,SAAS,IAAI,GAAG,CAO/B"}
package/build/api.js ADDED
@@ -0,0 +1,10 @@
1
+ import { buildApi } from "@cargo-ai/api";
2
+ import { getConfig } from "./config.js";
3
+ export function createApi() {
4
+ const { baseUrl, accessToken, workspaceUuid } = getConfig();
5
+ return buildApi({
6
+ baseUrl,
7
+ workspaceUuid,
8
+ getAccessToken: async () => accessToken,
9
+ });
10
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerAgentCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAiIN"}
@@ -0,0 +1,83 @@
1
+ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
+ export function registerAgentCommands(parent, getApi) {
3
+ const agent = parent.command("agent").description("Agent operations");
4
+ agent
5
+ .command("list")
6
+ .description("List all agents")
7
+ .action(async () => {
8
+ const api = getApi();
9
+ const result = await handleApiCall(() => api.ai.agent.all());
10
+ outputJson(result);
11
+ });
12
+ agent
13
+ .command("get <uuid>")
14
+ .description("Get agent by UUID")
15
+ .action(async (uuid) => {
16
+ const api = getApi();
17
+ const result = await handleApiCall(() => api.ai.agent.get(uuid));
18
+ outputJson(result);
19
+ });
20
+ agent
21
+ .command("create")
22
+ .description("Create an agent")
23
+ .requiredOption("--name <name>", "Agent name")
24
+ .requiredOption("--icon-color <color>", "Icon color (grey, green, purple, yellow, blue, red)")
25
+ .requiredOption("--icon-face <face>", "Icon face identifier")
26
+ .option("--description <text>", "Agent description")
27
+ .option("--folder-uuid <uuid>", "Folder UUID")
28
+ .option("--triggers <json>", 'Triggers (JSON array, e.g. [{"name":"Daily","type":"cron","cron":"0 9 * * *","text":"Run daily","description":null}])')
29
+ .action(async (opts) => {
30
+ const api = getApi();
31
+ const result = await handleApiCall(() => api.ai.agent.create({
32
+ name: opts.name,
33
+ icon: {
34
+ color: opts.iconColor,
35
+ face: opts.iconFace,
36
+ },
37
+ description: opts.description,
38
+ folderUuid: opts.folderUuid,
39
+ triggers: opts.triggers !== undefined
40
+ ? parseJson(opts.triggers, "--triggers")
41
+ : undefined,
42
+ }));
43
+ outputJson(result);
44
+ });
45
+ agent
46
+ .command("remove <uuid>")
47
+ .description("Remove an agent")
48
+ .action(async (uuid) => {
49
+ const api = getApi();
50
+ await handleApiCall(() => api.ai.agent.remove(uuid));
51
+ outputJson({ ok: true });
52
+ });
53
+ agent
54
+ .command("update")
55
+ .description("Update an agent")
56
+ .requiredOption("--uuid <uuid>", "Agent UUID")
57
+ .option("--name <name>", "Agent name")
58
+ .option("--icon-color <color>", "Icon color (grey, green, purple, yellow, blue, red)")
59
+ .option("--icon-face <face>", "Icon face identifier")
60
+ .option("--description <text>", "Agent description")
61
+ .option("--folder-uuid <uuid>", "Folder UUID")
62
+ .option("--triggers <json>", 'Triggers (JSON array, e.g. [{"name":"Daily","type":"cron","cron":"0 9 * * *","text":"Run daily","description":null}])')
63
+ .action(async (opts) => {
64
+ const api = getApi();
65
+ const icon = opts.iconColor !== undefined && opts.iconFace !== undefined
66
+ ? {
67
+ color: opts.iconColor,
68
+ face: opts.iconFace,
69
+ }
70
+ : undefined;
71
+ const result = await handleApiCall(() => api.ai.agent.update({
72
+ uuid: opts.uuid,
73
+ name: opts.name,
74
+ icon: icon,
75
+ description: opts.description,
76
+ folderUuid: opts.folderUuid,
77
+ triggers: opts.triggers !== undefined
78
+ ? parseJson(opts.triggers, "--triggers")
79
+ : undefined,
80
+ }));
81
+ outputJson(result);
82
+ });
83
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerChatCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAuG7E"}
@@ -0,0 +1,71 @@
1
+ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
+ export function registerChatCommands(parent, getApi) {
3
+ const chat = parent.command("chat").description("Chat operations");
4
+ chat
5
+ .command("list")
6
+ .description("List chats")
7
+ .option("--agent-uuid <uuid>", "Agent UUID")
8
+ .option("--release-uuid <uuid>", "Release UUID")
9
+ .option("--user-uuid <uuid>", "User UUID")
10
+ .option("--trigger-type <type>", "Trigger type")
11
+ .option("--limit <n>", "Limit")
12
+ .option("--offset <n>", "Offset")
13
+ .action(async (opts) => {
14
+ const api = getApi();
15
+ const result = await handleApiCall(() => api.ai.chat.list({
16
+ agentUuid: opts.agentUuid,
17
+ releaseUuid: opts.releaseUuid,
18
+ userUuid: opts.userUuid,
19
+ triggerType: opts.triggerType,
20
+ limit: opts.limit !== undefined ? parseInt(opts.limit, 10) : undefined,
21
+ offset: opts.offset !== undefined ? parseInt(opts.offset, 10) : undefined,
22
+ }));
23
+ outputJson(result);
24
+ });
25
+ chat
26
+ .command("get <uuid>")
27
+ .description("Get chat by UUID")
28
+ .action(async (uuid) => {
29
+ const api = getApi();
30
+ const result = await handleApiCall(() => api.ai.chat.get(uuid));
31
+ outputJson(result);
32
+ });
33
+ chat
34
+ .command("create")
35
+ .description("Create a chat")
36
+ .requiredOption("--trigger <json>", 'Chat trigger (JSON, e.g. {"type":"chat","uuid":"...","agentUuid":null,"messageUuid":null} or {"type":"draft"})')
37
+ .option("--name <name>", "Chat name")
38
+ .option("--agent-uuid <uuid>", "Agent UUID")
39
+ .option("--release-uuid <uuid>", "Release UUID")
40
+ .action(async (opts) => {
41
+ const api = getApi();
42
+ const result = await handleApiCall(() => api.ai.chat.create({
43
+ trigger: parseJson(opts.trigger, "--trigger"),
44
+ name: opts.name,
45
+ agentUuid: opts.agentUuid,
46
+ releaseUuid: opts.releaseUuid,
47
+ }));
48
+ outputJson(result);
49
+ });
50
+ chat
51
+ .command("remove <uuid>")
52
+ .description("Remove a chat")
53
+ .action(async (uuid) => {
54
+ const api = getApi();
55
+ await handleApiCall(() => api.ai.chat.remove(uuid));
56
+ outputJson({ ok: true });
57
+ });
58
+ chat
59
+ .command("update")
60
+ .description("Update a chat")
61
+ .requiredOption("--uuid <uuid>", "Chat UUID")
62
+ .option("--name <name>", "Chat name")
63
+ .action(async (opts) => {
64
+ const api = getApi();
65
+ const result = await handleApiCall(() => api.ai.chat.update({
66
+ uuid: opts.uuid,
67
+ name: opts.name,
68
+ }));
69
+ outputJson(result);
70
+ });
71
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerDocumentCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA8EN"}
@@ -0,0 +1,59 @@
1
+ import { handleApiCall, outputJson } from "../runHandler.js";
2
+ export function registerDocumentCommands(parent, getApi) {
3
+ const document = parent
4
+ .command("document")
5
+ .description("Document operations");
6
+ document
7
+ .command("get <uuid>")
8
+ .description("Get document by UUID")
9
+ .action(async (uuid) => {
10
+ const api = getApi();
11
+ const result = await handleApiCall(() => api.ai.document.get(uuid));
12
+ outputJson(result);
13
+ });
14
+ document
15
+ .command("list")
16
+ .description("List documents")
17
+ .requiredOption("--uuid <uuid>", "Document UUID")
18
+ .option("--limit <n>", "Limit")
19
+ .option("--offset <n>", "Offset")
20
+ .action(async (opts) => {
21
+ const api = getApi();
22
+ const result = await handleApiCall(() => api.ai.document.list({
23
+ uuid: opts.uuid,
24
+ limit: opts.limit !== undefined ? parseInt(opts.limit, 10) : undefined,
25
+ offset: opts.offset !== undefined ? parseInt(opts.offset, 10) : undefined,
26
+ }));
27
+ outputJson(result);
28
+ });
29
+ document
30
+ .command("create")
31
+ .description("Create a document")
32
+ .requiredOption("--uuid <uuid>", "Document UUID")
33
+ .requiredOption("--kind <kind>", "Document kind")
34
+ .requiredOption("--title <title>", "Document title")
35
+ .requiredOption("--content <content>", "Document content")
36
+ .action(async (opts) => {
37
+ const api = getApi();
38
+ const result = await handleApiCall(() => api.ai.document.create({
39
+ uuid: opts.uuid,
40
+ kind: opts.kind,
41
+ title: opts.title,
42
+ content: opts.content,
43
+ }));
44
+ outputJson(result);
45
+ });
46
+ document
47
+ .command("reset")
48
+ .description("Reset a document")
49
+ .requiredOption("--uuid <uuid>", "Document UUID")
50
+ .requiredOption("--created-at <date>", "Created at date")
51
+ .action(async (opts) => {
52
+ const api = getApi();
53
+ const result = await handleApiCall(() => api.ai.document.reset({
54
+ uuid: opts.uuid,
55
+ createdAt: opts.createdAt,
56
+ }));
57
+ outputJson(result);
58
+ });
59
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerFileCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/file.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAkF7E"}
@@ -0,0 +1,74 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { basename } from "node:path";
3
+ import { handleApiCall, outputJson } from "../runHandler.js";
4
+ export function registerFileCommands(parent, getApi) {
5
+ const file = parent.command("file").description("AI file operations");
6
+ file
7
+ .command("list")
8
+ .description("List all AI files")
9
+ .action(async () => {
10
+ const api = getApi();
11
+ const result = await handleApiCall(() => api.ai.file.all());
12
+ outputJson(result);
13
+ });
14
+ file
15
+ .command("get <uuid>")
16
+ .description("Get file by UUID")
17
+ .action(async (uuid) => {
18
+ const api = getApi();
19
+ const result = await handleApiCall(() => api.ai.file.get(uuid));
20
+ outputJson(result);
21
+ });
22
+ file
23
+ .command("update")
24
+ .description("Update a file")
25
+ .requiredOption("--uuid <uuid>", "File UUID")
26
+ .option("--name <name>", "File name")
27
+ .option("--folder-uuid <uuid>", "Folder UUID")
28
+ .action(async (opts) => {
29
+ const api = getApi();
30
+ const result = await handleApiCall(() => api.ai.file.update({
31
+ uuid: opts.uuid,
32
+ name: opts.name,
33
+ folderUuid: opts.folderUuid,
34
+ }));
35
+ outputJson(result);
36
+ });
37
+ file
38
+ .command("remove <uuid>")
39
+ .description("Remove a file")
40
+ .action(async (uuid) => {
41
+ const api = getApi();
42
+ await handleApiCall(() => api.ai.file.remove(uuid));
43
+ outputJson({ ok: true });
44
+ });
45
+ file
46
+ .command("upload")
47
+ .description("Upload a file")
48
+ .requiredOption("--file-path <path>", "Path to the file to upload")
49
+ .option("--folder-uuid <uuid>", "Folder UUID")
50
+ .action(async (opts) => {
51
+ const buffer = await readFile(opts.filePath);
52
+ const name = basename(opts.filePath);
53
+ const fileObj = new File([buffer], name);
54
+ const api = getApi();
55
+ await handleApiCall(() => new Promise((resolve, reject) => {
56
+ api.ai.file.upload({
57
+ file: fileObj,
58
+ folderUuid: opts.folderUuid,
59
+ onProgress: (pct) => {
60
+ process.stderr.write(`\rUpload progress: ${pct}%`);
61
+ },
62
+ onComplete: (result) => {
63
+ process.stderr.write("\n");
64
+ outputJson(result);
65
+ resolve();
66
+ },
67
+ onError: () => {
68
+ process.stderr.write("\n");
69
+ reject(new Error("Upload failed"));
70
+ },
71
+ });
72
+ }));
73
+ });
74
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerAiCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAgBxC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,CAmB3E"}
@@ -0,0 +1,33 @@
1
+ import { registerAgentCommands } from "./agent.js";
2
+ import { registerChatCommands } from "./chat.js";
3
+ import { registerDocumentCommands } from "./document.js";
4
+ import { registerFileCommands } from "./file.js";
5
+ import { registerMcpClientCommands } from "./mcpClient.js";
6
+ import { registerMcpServerCommands } from "./mcpServer.js";
7
+ import { registerMemoryCommands } from "./memory.js";
8
+ import { registerMessageCommands } from "./message.js";
9
+ import { registerPromptCommands } from "./prompt.js";
10
+ import { registerReleaseCommands } from "./release.js";
11
+ import { registerSkillCommands } from "./skill.js";
12
+ import { registerSuggestedActionCommands } from "./suggestedAction.js";
13
+ import { registerTemplateCommands } from "./template.js";
14
+ import { registerVoteCommands } from "./vote.js";
15
+ export function registerAiCommands(parent, getApi) {
16
+ const ai = parent
17
+ .command("ai")
18
+ .description("AI templates, agents, releases, chats, MCP, files, skills");
19
+ registerTemplateCommands(ai, getApi);
20
+ registerAgentCommands(ai, getApi);
21
+ registerReleaseCommands(ai, getApi);
22
+ registerChatCommands(ai, getApi);
23
+ registerMcpServerCommands(ai, getApi);
24
+ registerFileCommands(ai, getApi);
25
+ registerMessageCommands(ai, getApi);
26
+ registerVoteCommands(ai, getApi);
27
+ registerDocumentCommands(ai, getApi);
28
+ registerMcpClientCommands(ai, getApi);
29
+ registerPromptCommands(ai, getApi);
30
+ registerMemoryCommands(ai, getApi);
31
+ registerSuggestedActionCommands(ai, getApi);
32
+ registerSkillCommands(ai, getApi);
33
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerMcpClientCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=mcpClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpClient.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/mcpClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA+CN"}
@@ -0,0 +1,31 @@
1
+ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
+ export function registerMcpClientCommands(parent, getApi) {
3
+ const mcpClient = parent
4
+ .command("mcp-client")
5
+ .description("MCP client operations");
6
+ mcpClient
7
+ .command("connect")
8
+ .description("Connect an MCP client")
9
+ .requiredOption("--name <name>", "MCP client name")
10
+ .requiredOption("--url <url>", "MCP client URL")
11
+ .option("--authentication <json>", 'Authentication (JSON or "null", e.g. {"issuedAt":"...","accessToken":"..."})')
12
+ .option("--disabled-tool-slugs <list>", "Disabled tool slugs (comma-separated)")
13
+ .action(async (opts) => {
14
+ const api = getApi();
15
+ const result = await handleApiCall(() => api.ai.mcpClient.connect({
16
+ mcpClient: {
17
+ name: opts.name,
18
+ url: opts.url,
19
+ authentication: opts.authentication === undefined
20
+ ? null
21
+ : opts.authentication === "null"
22
+ ? null
23
+ : parseJson(opts.authentication, "--authentication"),
24
+ disabledToolSlugs: opts.disabledToolSlugs !== undefined
25
+ ? opts.disabledToolSlugs.split(",").map((s) => s.trim())
26
+ : [],
27
+ },
28
+ }));
29
+ outputJson(result);
30
+ });
31
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerMcpServerCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=mcpServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpServer.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/mcpServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA6EN"}
@@ -0,0 +1,62 @@
1
+ import { handleApiCall, outputJson, parseJson } from "../runHandler.js";
2
+ export function registerMcpServerCommands(parent, getApi) {
3
+ const mcpServer = parent
4
+ .command("mcp-server")
5
+ .description("MCP server operations");
6
+ mcpServer
7
+ .command("list")
8
+ .description("List all MCP servers")
9
+ .action(async () => {
10
+ const api = getApi();
11
+ const result = await handleApiCall(() => api.ai.mcpServer.all());
12
+ outputJson(result);
13
+ });
14
+ mcpServer
15
+ .command("get <uuid>")
16
+ .description("Get MCP server by UUID")
17
+ .action(async (uuid) => {
18
+ const api = getApi();
19
+ const result = await handleApiCall(() => api.ai.mcpServer.get(uuid));
20
+ outputJson(result);
21
+ });
22
+ mcpServer
23
+ .command("create")
24
+ .description("Create an MCP server")
25
+ .requiredOption("--name <name>", "MCP server name")
26
+ .option("--tools <json>", 'Tools (JSON array, e.g. [{"slug":"my-tool","kind":"tool","name":null,"description":null,"isBulkAllowed":false,"config":{}}])')
27
+ .action(async (opts) => {
28
+ const api = getApi();
29
+ const result = await handleApiCall(() => api.ai.mcpServer.create({
30
+ name: opts.name,
31
+ tools: opts.tools !== undefined
32
+ ? parseJson(opts.tools, "--tools")
33
+ : undefined,
34
+ }));
35
+ outputJson(result);
36
+ });
37
+ mcpServer
38
+ .command("remove <uuid>")
39
+ .description("Remove an MCP server")
40
+ .action(async (uuid) => {
41
+ const api = getApi();
42
+ await handleApiCall(() => api.ai.mcpServer.remove(uuid));
43
+ outputJson({ ok: true });
44
+ });
45
+ mcpServer
46
+ .command("update")
47
+ .description("Update an MCP server")
48
+ .requiredOption("--uuid <uuid>", "MCP server UUID")
49
+ .option("--name <name>", "MCP server name")
50
+ .option("--tools <json>", 'Tools (JSON array, e.g. [{"slug":"my-tool","kind":"tool","name":null,"description":null,"isBulkAllowed":false,"config":{}}])')
51
+ .action(async (opts) => {
52
+ const api = getApi();
53
+ const result = await handleApiCall(() => api.ai.mcpServer.update({
54
+ uuid: opts.uuid,
55
+ name: opts.name,
56
+ tools: opts.tools !== undefined
57
+ ? parseJson(opts.tools, "--tools")
58
+ : undefined,
59
+ }));
60
+ outputJson(result);
61
+ });
62
+ }
@@ -0,0 +1,4 @@
1
+ import type { Command } from "commander";
2
+ import type { Api } from "../../api.js";
3
+ export declare function registerMemoryCommands(parent: Command, getApi: () => Api): void;
4
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../src/commands/ai/memory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAmEN"}