@imbrace/cli 0.1.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 (70) hide show
  1. package/bin/run.js +5 -0
  2. package/dist/base-command.d.ts +8 -0
  3. package/dist/base-command.js +48 -0
  4. package/dist/commands/ai-agent/create.d.ts +28 -0
  5. package/dist/commands/ai-agent/create.js +86 -0
  6. package/dist/commands/ai-agent/delete.d.ts +13 -0
  7. package/dist/commands/ai-agent/delete.js +39 -0
  8. package/dist/commands/ai-agent/get.d.ts +12 -0
  9. package/dist/commands/ai-agent/get.js +42 -0
  10. package/dist/commands/ai-agent/list-models.d.ts +10 -0
  11. package/dist/commands/ai-agent/list-models.js +36 -0
  12. package/dist/commands/ai-agent/list-providers.d.ts +9 -0
  13. package/dist/commands/ai-agent/list-providers.js +37 -0
  14. package/dist/commands/ai-agent/list.d.ts +9 -0
  15. package/dist/commands/ai-agent/list.js +36 -0
  16. package/dist/commands/ai-agent/update.d.ts +30 -0
  17. package/dist/commands/ai-agent/update.js +100 -0
  18. package/dist/commands/data-board/create-field.d.ts +14 -0
  19. package/dist/commands/data-board/create-field.js +46 -0
  20. package/dist/commands/data-board/create-item.d.ts +13 -0
  21. package/dist/commands/data-board/create-item.js +72 -0
  22. package/dist/commands/data-board/create.d.ts +10 -0
  23. package/dist/commands/data-board/create.js +45 -0
  24. package/dist/commands/data-board/delete-item.d.ts +14 -0
  25. package/dist/commands/data-board/delete-item.js +42 -0
  26. package/dist/commands/data-board/export-csv.d.ts +10 -0
  27. package/dist/commands/data-board/export-csv.js +34 -0
  28. package/dist/commands/data-board/list-items.d.ts +13 -0
  29. package/dist/commands/data-board/list-items.js +47 -0
  30. package/dist/commands/data-board/list.d.ts +9 -0
  31. package/dist/commands/data-board/list.js +33 -0
  32. package/dist/commands/data-board/update-item.d.ts +14 -0
  33. package/dist/commands/data-board/update-item.js +57 -0
  34. package/dist/commands/login.d.ts +12 -0
  35. package/dist/commands/login.js +71 -0
  36. package/dist/commands/logout.d.ts +6 -0
  37. package/dist/commands/logout.js +10 -0
  38. package/dist/commands/whoami.d.ts +9 -0
  39. package/dist/commands/whoami.js +29 -0
  40. package/dist/commands/workflow/create.d.ts +12 -0
  41. package/dist/commands/workflow/create.js +45 -0
  42. package/dist/commands/workflow/delete.d.ts +13 -0
  43. package/dist/commands/workflow/delete.js +40 -0
  44. package/dist/commands/workflow/get.d.ts +12 -0
  45. package/dist/commands/workflow/get.js +54 -0
  46. package/dist/commands/workflow/list.d.ts +9 -0
  47. package/dist/commands/workflow/list.js +36 -0
  48. package/dist/commands/workflow/node/add.d.ts +20 -0
  49. package/dist/commands/workflow/node/add.js +72 -0
  50. package/dist/commands/workflow/node/delete.d.ts +14 -0
  51. package/dist/commands/workflow/node/delete.js +40 -0
  52. package/dist/commands/workflow/node/list.d.ts +12 -0
  53. package/dist/commands/workflow/node/list.js +40 -0
  54. package/dist/commands/workflow/node/update.d.ts +15 -0
  55. package/dist/commands/workflow/node/update.js +47 -0
  56. package/dist/commands/workflow/piece/detail.d.ts +13 -0
  57. package/dist/commands/workflow/piece/detail.js +60 -0
  58. package/dist/commands/workflow/piece/list.d.ts +10 -0
  59. package/dist/commands/workflow/piece/list.js +40 -0
  60. package/dist/commands/workflow/run-detail.d.ts +12 -0
  61. package/dist/commands/workflow/run-detail.js +50 -0
  62. package/dist/commands/workflow/runs.d.ts +10 -0
  63. package/dist/commands/workflow/runs.js +40 -0
  64. package/dist/config.d.ts +27 -0
  65. package/dist/config.js +36 -0
  66. package/dist/http.d.ts +9 -0
  67. package/dist/http.js +40 -0
  68. package/dist/select-board.d.ts +1 -0
  69. package/dist/select-board.js +12 -0
  70. package/package.json +71 -0
package/bin/run.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execute } from "@oclif/core";
4
+
5
+ await execute({ dir: import.meta.url });
@@ -0,0 +1,8 @@
1
+ import { Command } from "@oclif/core";
2
+ export declare abstract class BaseCommand extends Command {
3
+ static baseFlags: {
4
+ help: import("@oclif/core/interfaces").BooleanFlag<void>;
5
+ };
6
+ init(): Promise<void>;
7
+ private ensureLoggedIn;
8
+ }
@@ -0,0 +1,48 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { select, input, password } from "@inquirer/prompts";
3
+ import { getCredential, saveCredential } from "./config.js";
4
+ import { apiRequest } from "./http.js";
5
+ export class BaseCommand extends Command {
6
+ // Enable -h as alias for --help on every command (helps coding agents discover usage)
7
+ static baseFlags = {
8
+ help: Flags.help({ char: "h", description: "Show help for the command" }),
9
+ };
10
+ async init() {
11
+ await super.init();
12
+ await this.ensureLoggedIn();
13
+ }
14
+ async ensureLoggedIn() {
15
+ if (getCredential())
16
+ return;
17
+ this.log("\n⚠️ You are not logged in. Please login first.\n");
18
+ const method = await select({
19
+ message: "Login method:",
20
+ choices: [
21
+ { name: "API Key (recommended for CI/CD)", value: "api-key" },
22
+ { name: "Email + Password", value: "password" },
23
+ ],
24
+ });
25
+ let body;
26
+ if (method === "api-key") {
27
+ const apiKey = await input({ message: "API Key (sk-...):" });
28
+ body = { apiKey };
29
+ }
30
+ else {
31
+ const email = await input({ message: "Email:" });
32
+ const pass = await password({ message: "Password:" });
33
+ body = { email, password: pass };
34
+ }
35
+ try {
36
+ const res = await apiRequest("/auth/login", { method: "POST", body });
37
+ saveCredential({
38
+ credential: res.credential,
39
+ method: res.method,
40
+ email: res.email,
41
+ });
42
+ this.log(`\n✅ ${res.message}\n`);
43
+ }
44
+ catch (error) {
45
+ this.error(`Login failed: ${error.message}`);
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,28 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class AiAgentCreate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ instructions: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ model: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ "provider-id": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ mode: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ temperature: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ personality: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ "core-task": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ tone: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ "response-length": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ "banned-words": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ category: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ "guardrail-id": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ "preload-information": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ "show-thinking": import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
+ streaming: import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
+ "use-memory": import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
+ "id-only": import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
+ };
27
+ run(): Promise<void>;
28
+ }
@@ -0,0 +1,86 @@
1
+ import { Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { input } from "@inquirer/prompts";
4
+ import { apiRequest } from "../../http.js";
5
+ export default class AiAgentCreate extends BaseCommand {
6
+ static description = "Create a new AI agent";
7
+ static examples = [
8
+ 'imbrace ai-agent create --name "Sales Bot" --json',
9
+ 'imbrace ai-agent create --name "Support Bot" --instructions "You are a support agent" --json',
10
+ 'imbrace ai-agent create --name "Custom" --provider-id <id> --model qwen3.5-27b --temperature 0.7 --json',
11
+ ];
12
+ static flags = {
13
+ // Identity
14
+ name: Flags.string({ char: "n", description: "Agent name" }),
15
+ description: Flags.string({ char: "d", description: "Agent description" }),
16
+ instructions: Flags.string({ char: "i", description: "Agent instructions/prompt" }),
17
+ // Model — discover via list-providers / list-models
18
+ model: Flags.string({ description: "LLM model (e.g. gpt-4o, qwen3.5-27b). Default: gpt-4o" }),
19
+ "provider-id": Flags.string({ description: "LLM provider ID. Default 'system'. Use 'imbrace ai-agent list-providers' to discover." }),
20
+ mode: Flags.string({ description: "Agent mode (default: standard)", options: ["standard", "advanced"] }),
21
+ temperature: Flags.string({ description: "Model temperature 0.0-2.0 (default: 0.1). Lower = deterministic, higher = creative." }),
22
+ // Behavior Settings (UI tab)
23
+ personality: Flags.string({ description: "Agent personality / role (e.g. 'You are a friendly support rep')" }),
24
+ "core-task": Flags.string({ description: "Core task description" }),
25
+ tone: Flags.string({ description: "Tone and style (e.g. 'Polite, professional')" }),
26
+ "response-length": Flags.string({ description: "Response length", options: ["short", "medium", "long"] }),
27
+ "banned-words": Flags.string({ description: "Comma-separated banned words. Word-level filter on outputs (for topic refusal use --instructions)." }),
28
+ category: Flags.string({
29
+ description: "Agent category (default: Support).",
30
+ options: ["Support", "Sales", "Marketing", "Team", "Other"],
31
+ }),
32
+ "guardrail-id": Flags.string({ description: "Attach a guardrail by ID" }),
33
+ "preload-information": Flags.string({ description: "Static info auto-injected into context every chat" }),
34
+ // Behavior runtime toggles
35
+ "show-thinking": Flags.boolean({ description: "Show model's thinking process (default: false)", allowNo: true }),
36
+ streaming: Flags.boolean({ description: "Stream response token-by-token (default: true)", allowNo: true }),
37
+ "use-memory": Flags.boolean({ description: "Remember conversation context across turns (default: true)", allowNo: true }),
38
+ // Output
39
+ json: Flags.boolean({ description: "Output as JSON" }),
40
+ "id-only": Flags.boolean({ description: "Print only the new agent ID (for piping)" }),
41
+ };
42
+ async run() {
43
+ const { flags } = await this.parse(AiAgentCreate);
44
+ const nonInteractive = flags.json || flags["id-only"];
45
+ const name = flags.name ?? (nonInteractive ? this.error("--name is required with --json or --id-only") : await input({ message: "Agent name:" }));
46
+ const instructions = flags.instructions ?? (nonInteractive ? undefined : await input({ message: "Instructions (optional, press Enter to skip):", default: "" }));
47
+ const body = {
48
+ name,
49
+ ...(instructions && { instructions }),
50
+ ...(flags.description && { description: flags.description }),
51
+ ...(flags.model && { model: flags.model }),
52
+ ...(flags["provider-id"] && { provider_id: flags["provider-id"] }),
53
+ ...(flags.mode && { mode: flags.mode }),
54
+ ...(flags.temperature && { temperature: parseFloat(flags.temperature) }),
55
+ ...(flags.personality && { personality_role: flags.personality }),
56
+ ...(flags["core-task"] && { core_task: flags["core-task"] }),
57
+ ...(flags.tone && { tone_and_style: flags.tone }),
58
+ ...(flags["response-length"] && { response_length: flags["response-length"] }),
59
+ ...(flags["banned-words"] && { banned_words: flags["banned-words"] }),
60
+ ...(flags.category && { category: [flags.category] }),
61
+ ...(flags["guardrail-id"] && { guardrail_id: flags["guardrail-id"] }),
62
+ ...(flags["preload-information"] && { preload_information: flags["preload-information"] }),
63
+ ...(flags["show-thinking"] !== undefined && { show_thinking_process: flags["show-thinking"] }),
64
+ ...(flags.streaming !== undefined && { streaming: flags.streaming }),
65
+ ...(flags["use-memory"] !== undefined && { use_memory: flags["use-memory"] }),
66
+ };
67
+ try {
68
+ const res = await apiRequest("/ai-agent/create", { method: "POST", body });
69
+ if (flags["id-only"]) {
70
+ this.log(res.data?._id ?? "");
71
+ return;
72
+ }
73
+ if (flags.json) {
74
+ this.log(JSON.stringify(res, null, 2));
75
+ return;
76
+ }
77
+ this.log(`\n✅ ${res.message}`);
78
+ if (res.data?._id)
79
+ this.log(` ID: ${res.data._id}`);
80
+ this.log("");
81
+ }
82
+ catch (error) {
83
+ this.error(`Failed: ${error.message}`);
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class AiAgentDelete extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,39 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { input, confirm } from "@inquirer/prompts";
4
+ import { apiRequest } from "../../http.js";
5
+ export default class AiAgentDelete extends BaseCommand {
6
+ static description = "Delete an AI agent";
7
+ static examples = [
8
+ "imbrace ai-agent delete <id> --yes --json",
9
+ ];
10
+ static args = {
11
+ id: Args.string({ description: "Agent ID" }),
12
+ };
13
+ static flags = {
14
+ yes: Flags.boolean({ char: "y", description: "Skip confirmation" }),
15
+ json: Flags.boolean({ description: "Output as JSON" }),
16
+ };
17
+ async run() {
18
+ const { args, flags } = await this.parse(AiAgentDelete);
19
+ const id = args.id ?? (flags.json ? this.error("ID is required") : await input({ message: "Agent ID:" }));
20
+ if (!flags.yes) {
21
+ const ok = await confirm({ message: `Delete agent ${id}?`, default: false });
22
+ if (!ok) {
23
+ this.log("Cancelled.");
24
+ return;
25
+ }
26
+ }
27
+ try {
28
+ const res = await apiRequest(`/ai-agent/${id}`, { method: "DELETE" });
29
+ if (flags.json) {
30
+ this.log(JSON.stringify(res, null, 2));
31
+ return;
32
+ }
33
+ this.log(`\n✅ ${res.message}\n`);
34
+ }
35
+ catch (error) {
36
+ this.error(`Failed: ${error.message}`);
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class AiAgentGet extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,42 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { input } from "@inquirer/prompts";
4
+ import { apiRequest } from "../../http.js";
5
+ export default class AiAgentGet extends BaseCommand {
6
+ static description = "Get details of an AI agent";
7
+ static examples = [
8
+ "imbrace ai-agent get <id>",
9
+ "imbrace ai-agent get <id> --json",
10
+ ];
11
+ static args = {
12
+ id: Args.string({ description: "Agent ID" }),
13
+ };
14
+ static flags = {
15
+ json: Flags.boolean({ description: "Output as JSON" }),
16
+ };
17
+ async run() {
18
+ const { args, flags } = await this.parse(AiAgentGet);
19
+ const id = args.id ?? (flags.json ? this.error("ID is required") : await input({ message: "Agent ID:" }));
20
+ try {
21
+ const res = await apiRequest(`/ai-agent/${id}`);
22
+ if (flags.json) {
23
+ this.log(JSON.stringify(res, null, 2));
24
+ return;
25
+ }
26
+ // SDK returns { data: {...} } so res.data is { data: <template> }
27
+ const a = res.data?.data || res.data || {};
28
+ this.log(`\n ID: ${a._id || a.id || ""}`);
29
+ this.log(` Title: ${a.title || a.name || ""}`);
30
+ this.log(` Type: ${a.agent_type || ""}`);
31
+ this.log(` Version: ${a.version || ""}`);
32
+ this.log(` Assistant ID: ${a.assistant_id || ""}`);
33
+ this.log(` Channel ID: ${a.channel_id || ""}`);
34
+ this.log(` Demo URL: ${a.demo_url || ""}`);
35
+ this.log(` Description: ${(a.short_description || "").slice(0, 80)}${(a.short_description || "").length > 80 ? "..." : ""}`);
36
+ this.log("");
37
+ }
38
+ catch (error) {
39
+ this.error(`Failed: ${error.message}`);
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class AiAgentListModels extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ "provider-id": import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,36 @@
1
+ import { Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { apiRequest } from "../../http.js";
4
+ export default class AiAgentListModels extends BaseCommand {
5
+ static description = "List LLM models available for a specific provider";
6
+ static examples = [
7
+ "imbrace ai-agent list-models --provider-id system",
8
+ "imbrace ai-agent list-models --provider-id 69e84cde835c54bda1234567",
9
+ "imbrace ai-agent list-models --provider-id system --json",
10
+ ];
11
+ static flags = {
12
+ "provider-id": Flags.string({
13
+ description: "Provider ID. Use 'imbrace ai-agent list-providers' to discover. Use 'system' for the default provider.",
14
+ required: true,
15
+ }),
16
+ json: Flags.boolean({ description: "Output as JSON" }),
17
+ };
18
+ async run() {
19
+ const { flags } = await this.parse(AiAgentListModels);
20
+ try {
21
+ const res = await apiRequest(`/ai-agent/providers/${encodeURIComponent(flags["provider-id"])}/models`);
22
+ if (flags.json) {
23
+ this.log(JSON.stringify(res, null, 2));
24
+ return;
25
+ }
26
+ this.log(`\n Found ${res.count} model(s) for provider "${flags["provider-id"]}":\n`);
27
+ for (const m of res.data || []) {
28
+ this.log(` ${m}`);
29
+ }
30
+ this.log("");
31
+ }
32
+ catch (error) {
33
+ this.error(`Failed: ${error.message}`);
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class AiAgentListProviders extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,37 @@
1
+ import { Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { apiRequest } from "../../http.js";
4
+ export default class AiAgentListProviders extends BaseCommand {
5
+ static description = "List LLM providers (system + custom) configured for the org";
6
+ static examples = [
7
+ "imbrace ai-agent list-providers",
8
+ "imbrace ai-agent list-providers --json",
9
+ ];
10
+ static flags = {
11
+ json: Flags.boolean({ description: "Output as JSON" }),
12
+ };
13
+ async run() {
14
+ const { flags } = await this.parse(AiAgentListProviders);
15
+ try {
16
+ const res = await apiRequest("/ai-agent/providers");
17
+ if (flags.json) {
18
+ this.log(JSON.stringify(res, null, 2));
19
+ return;
20
+ }
21
+ this.log(`\n Found ${res.count} provider(s):\n`);
22
+ this.log(" ID NAME TYPE MODELS");
23
+ this.log(" ─────────────────────────────────────────────────────────────────────────────");
24
+ for (const p of res.data || []) {
25
+ const id = (p._id || "").padEnd(40);
26
+ const name = (p.name || "").padEnd(16);
27
+ const type = (p.type || "").padEnd(11);
28
+ const models = (p.models || []).slice(0, 3).join(", ") + ((p.models || []).length > 3 ? `, +${p.models.length - 3} more` : "");
29
+ this.log(` ${id} ${name} ${type} ${models}`);
30
+ }
31
+ this.log(`\n Use 'imbrace ai-agent list-models --provider-id <id>' for full model list.\n`);
32
+ }
33
+ catch (error) {
34
+ this.error(`Failed: ${error.message}`);
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class AiAgentList extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ };
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,36 @@
1
+ import { Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { apiRequest } from "../../http.js";
4
+ export default class AiAgentList extends BaseCommand {
5
+ static description = "List all AI agents";
6
+ static examples = [
7
+ "imbrace ai-agent list",
8
+ "imbrace ai-agent list --json",
9
+ ];
10
+ static flags = {
11
+ json: Flags.boolean({ description: "Output as JSON" }),
12
+ };
13
+ async run() {
14
+ const { flags } = await this.parse(AiAgentList);
15
+ try {
16
+ const res = await apiRequest("/ai-agent/list");
17
+ if (flags.json) {
18
+ this.log(JSON.stringify(res, null, 2));
19
+ return;
20
+ }
21
+ this.log(`\n Found ${res.count} agent(s):\n`);
22
+ this.log(" ID TITLE TYPE");
23
+ this.log(" ──────────────────────────────────────────────────────────────────");
24
+ for (const agent of res.data || []) {
25
+ const id = (agent._id || agent.id || "").padEnd(38);
26
+ const title = (agent.title || agent.name || "").padEnd(22);
27
+ const type = agent.agent_type || "";
28
+ this.log(` ${id} ${title} ${type}`);
29
+ }
30
+ this.log("");
31
+ }
32
+ catch (error) {
33
+ this.error(`Failed: ${error.message}`);
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,30 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class AiAgentUpdate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ instructions: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ model: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ "provider-id": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ mode: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ temperature: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
+ personality: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ "core-task": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ tone: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ "response-length": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
20
+ "banned-words": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ category: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ "guardrail-id": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ "preload-information": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
+ "show-thinking": import("@oclif/core/interfaces").BooleanFlag<boolean>;
25
+ streaming: import("@oclif/core/interfaces").BooleanFlag<boolean>;
26
+ "use-memory": import("@oclif/core/interfaces").BooleanFlag<boolean>;
27
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
28
+ };
29
+ run(): Promise<void>;
30
+ }
@@ -0,0 +1,100 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { input } from "@inquirer/prompts";
4
+ import { apiRequest } from "../../http.js";
5
+ export default class AiAgentUpdate extends BaseCommand {
6
+ static description = "Update an AI agent. Pass any subset of flags — others stay unchanged.";
7
+ static examples = [
8
+ 'imbrace ai-agent update <id> --name "New Name" --json',
9
+ 'imbrace ai-agent update <id> --instructions "Updated prompt" --json',
10
+ 'imbrace ai-agent update <id> --temperature 0.7 --tone "More casual" --json',
11
+ 'imbrace ai-agent update <id> --no-streaming --no-use-memory --json',
12
+ ];
13
+ static args = {
14
+ id: Args.string({ description: "Agent ID" }),
15
+ };
16
+ static flags = {
17
+ // Identity
18
+ name: Flags.string({ char: "n", description: "New name" }),
19
+ description: Flags.string({ char: "d", description: "New description" }),
20
+ instructions: Flags.string({ char: "i", description: "New instructions/prompt" }),
21
+ // Model
22
+ model: Flags.string({ description: "LLM model (e.g. gpt-4o, qwen3.5-27b)" }),
23
+ "provider-id": Flags.string({ description: "LLM provider ID" }),
24
+ mode: Flags.string({ description: "Agent mode", options: ["standard", "advanced"] }),
25
+ temperature: Flags.string({ description: "Model temperature 0.0-2.0" }),
26
+ // Behavior
27
+ personality: Flags.string({ description: "Personality / role" }),
28
+ "core-task": Flags.string({ description: "Core task description" }),
29
+ tone: Flags.string({ description: "Tone and style" }),
30
+ "response-length": Flags.string({ description: "Response length", options: ["short", "medium", "long"] }),
31
+ "banned-words": Flags.string({ description: "Comma-separated banned words" }),
32
+ category: Flags.string({
33
+ description: "Agent category",
34
+ options: ["Support", "Sales", "Marketing", "Team", "Other"],
35
+ }),
36
+ "guardrail-id": Flags.string({ description: "Guardrail ID (set to empty string to remove)" }),
37
+ "preload-information": Flags.string({ description: "Preload information" }),
38
+ // Runtime toggles
39
+ "show-thinking": Flags.boolean({ description: "Show thinking process", allowNo: true }),
40
+ streaming: Flags.boolean({ description: "Stream response", allowNo: true }),
41
+ "use-memory": Flags.boolean({ description: "Use conversation memory", allowNo: true }),
42
+ // Output
43
+ json: Flags.boolean({ description: "Output as JSON" }),
44
+ };
45
+ async run() {
46
+ const { args, flags } = await this.parse(AiAgentUpdate);
47
+ const id = args.id ?? (flags.json ? this.error("ID is required") : await input({ message: "Agent ID:" }));
48
+ const body = {};
49
+ if (flags.name)
50
+ body.name = flags.name;
51
+ if (flags.description)
52
+ body.description = flags.description;
53
+ if (flags.instructions)
54
+ body.instructions = flags.instructions;
55
+ if (flags.model)
56
+ body.model = flags.model;
57
+ if (flags["provider-id"])
58
+ body.provider_id = flags["provider-id"];
59
+ if (flags.mode)
60
+ body.mode = flags.mode;
61
+ if (flags.temperature)
62
+ body.temperature = parseFloat(flags.temperature);
63
+ if (flags.personality !== undefined)
64
+ body.personality_role = flags.personality;
65
+ if (flags["core-task"] !== undefined)
66
+ body.core_task = flags["core-task"];
67
+ if (flags.tone !== undefined)
68
+ body.tone_and_style = flags.tone;
69
+ if (flags["response-length"])
70
+ body.response_length = flags["response-length"];
71
+ if (flags["banned-words"] !== undefined)
72
+ body.banned_words = flags["banned-words"];
73
+ if (flags.category)
74
+ body.category = [flags.category];
75
+ if (flags["guardrail-id"] !== undefined)
76
+ body.guardrail_id = flags["guardrail-id"];
77
+ if (flags["preload-information"] !== undefined)
78
+ body.preload_information = flags["preload-information"];
79
+ if (flags["show-thinking"] !== undefined)
80
+ body.show_thinking_process = flags["show-thinking"];
81
+ if (flags.streaming !== undefined)
82
+ body.streaming = flags.streaming;
83
+ if (flags["use-memory"] !== undefined)
84
+ body.use_memory = flags["use-memory"];
85
+ if (Object.keys(body).length === 0) {
86
+ this.error("Provide at least one field to update. See: imbrace ai-agent update -h");
87
+ }
88
+ try {
89
+ const res = await apiRequest(`/ai-agent/${id}`, { method: "PUT", body });
90
+ if (flags.json) {
91
+ this.log(JSON.stringify(res, null, 2));
92
+ return;
93
+ }
94
+ this.log(`\n✅ ${res.message}\n`);
95
+ }
96
+ catch (error) {
97
+ this.error(`Failed: ${error.message}`);
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand } from "../../base-command.js";
2
+ export default class DataBoardCreateField extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ boardId: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,46 @@
1
+ import { Args, Flags } from "@oclif/core";
2
+ import { BaseCommand } from "../../base-command.js";
3
+ import { input, select } from "@inquirer/prompts";
4
+ import { apiRequest } from "../../http.js";
5
+ const FIELD_TYPES = [
6
+ "ShortText", "LongText", "Number", "Date",
7
+ "Email", "Phone", "Currency",
8
+ "SingleSelection", "MultipleSelection", "Checkbox",
9
+ "Assignee", "MultipleAssignee",
10
+ "Link", "Notes", "Origin", "Priority",
11
+ ];
12
+ export default class DataBoardCreateField extends BaseCommand {
13
+ static description = "Add a custom field to a board";
14
+ static examples = [
15
+ "imbrace data-board create-field",
16
+ 'imbrace data-board create-field <boardId> --name "Company" --type ShortText --json',
17
+ ];
18
+ static args = {
19
+ boardId: Args.string({ description: "Board ID" }),
20
+ };
21
+ static flags = {
22
+ name: Flags.string({ char: "n", description: "Field name" }),
23
+ type: Flags.string({ char: "t", description: `Field type: ${FIELD_TYPES.join(", ")}` }),
24
+ json: Flags.boolean({ description: "Output as JSON" }),
25
+ };
26
+ async run() {
27
+ const { args, flags } = await this.parse(DataBoardCreateField);
28
+ const boardId = args.boardId ?? await input({ message: "Board ID:" });
29
+ const name = flags.name ?? await input({ message: "Field name:" });
30
+ const type = flags.type ?? await select({
31
+ message: "Field type:",
32
+ choices: FIELD_TYPES.map((t) => ({ name: t, value: t })),
33
+ });
34
+ try {
35
+ const res = await apiRequest(`/data-board/${boardId}/fields`, { method: "POST", body: { name, type } });
36
+ if (flags.json) {
37
+ this.log(JSON.stringify(res, null, 2));
38
+ return;
39
+ }
40
+ this.log(`\n✅ ${res.message}\n`);
41
+ }
42
+ catch (error) {
43
+ this.error(`Failed: ${error.message}`);
44
+ }
45
+ }
46
+ }