@bussolabs/closeyourit-cli 0.0.17 → 0.0.19

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/README.md CHANGED
@@ -105,6 +105,14 @@ organization are stored locally.
105
105
  | `servers tokens list` | List the fleet enrollment tokens. |
106
106
  | `servers tokens create <name>` | Create an enrollment token (secret shown once). |
107
107
  | `servers tokens revoke <id> --confirm` | Revoke an enrollment token. |
108
+ | `agents list [--kind claude\|shell] [--page]` | List the automation agents in your org. |
109
+ | `agents show <id>` | Show one automation agent. |
110
+ | `agents create --name --slug --run --schedule [--kind] [--timeout] [--model] [--permission-mode] [--allowed-tool…] [--on-failure] [--project <id\|key>…] [--group <id\|name>…] [--catch-up] [--no-enabled]` | Create an agent (executed by closeyourit-automator). |
111
+ | `agents update <id> [--name] [--slug] [--kind] [--run] [--schedule] [--timeout] [--model] [--permission-mode] [--allowed-tool…] [--on-failure] [--enabled\|--no-enabled] [--catch-up\|--no-catch-up]` | Update an agent (only the passed fields change). |
112
+ | `agents assign <id> [--project <id\|key>…] [--group <id\|name>…]` | Assign the agent to projects/groups (replaces targets). |
113
+ | `agents delete <id> --confirm` | Delete an agent and its run history. |
114
+ | `agents runs list <agent-id> [--page]` | List an agent's run history. |
115
+ | `agents runs show <agent-id> <run-id>` | Show a single run (with output). |
108
116
  | `monitors create --project <id\|key> --url <url> [--environment] [--http-method] [--interval-seconds] [--expected-status] [--timeout-seconds] [--expected-body-keyword] [--ssl-expiry-warn-days] [--group-id]` | Create an uptime monitor (one per environment). |
109
117
  | `monitors update <id> --project <id\|key> [--url] [--http-method] [--interval-seconds] [--expected-status] [--timeout-seconds] [--expected-body-keyword] [--ssl-expiry-warn-days] [--group-id]` | Update an uptime monitor. |
110
118
  | `monitors publish\|unpublish <id> --project <id\|key>` | Publish / unpublish the monitor's public status page. |
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class AgentsAssign extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ group: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ };
12
+ run(): Promise<unknown>;
13
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ class AgentsAssign extends base_1.BaseCommand {
6
+ static args = {
7
+ id: core_1.Args.string({ description: 'Agent id', required: true }),
8
+ };
9
+ static description = 'Assign an agent to projects/groups (replaces the current targets)';
10
+ static examples = ['<%= config.bin %> agents assign <agent-id> --project CYI --project DR'];
11
+ static flags = {
12
+ project: core_1.Flags.string({ description: 'Target project key/id (repeatable)', multiple: true }),
13
+ group: core_1.Flags.string({ description: 'Target group name/id (repeatable)', multiple: true }),
14
+ };
15
+ async run() {
16
+ const { args, flags } = await this.parse(AgentsAssign);
17
+ const projectIds = await Promise.all((flags.project ?? []).map((value) => this.resolveProjectId(value)));
18
+ const groupIds = await Promise.all((flags.group ?? []).map((value) => this.resolveGroupId(value)));
19
+ const res = await this.api.put(`/cli/v1/agents/${encodeURIComponent(args.id)}/assign`, { project_ids: projectIds, group_ids: groupIds });
20
+ if (!this.jsonEnabled())
21
+ this.log(`Assigned agent ${args.id} to ${projectIds.length} project(s), ${groupIds.length} group(s)`);
22
+ return res;
23
+ }
24
+ }
25
+ exports.default = AgentsAssign;
@@ -0,0 +1,22 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class AgentsCreate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ slug: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ kind: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ run: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ schedule: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ timeout: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ model: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'permission-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ 'allowed-tool': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'on-failure': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ group: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'catch-up': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ 'no-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ };
21
+ run(): Promise<unknown>;
22
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const PERMISSION_MODES = ['plan', 'acceptEdits', 'auto', 'manual', 'dontAsk', 'bypassPermissions'];
6
+ class AgentsCreate extends base_1.BaseCommand {
7
+ static description = 'Create an automation agent';
8
+ static examples = [
9
+ '<%= config.bin %> agents create --name Triage --slug triage --run "/closeyourit-ticket review" --schedule "every 15m" --project CYI',
10
+ ];
11
+ static flags = {
12
+ name: core_1.Flags.string({ description: 'Display name', required: true }),
13
+ slug: core_1.Flags.string({ description: 'Slug (a-z, 0-9, dashes)', required: true }),
14
+ kind: core_1.Flags.string({ description: 'Agent kind', options: ['claude', 'shell'], default: 'claude' }),
15
+ run: core_1.Flags.string({ description: 'Prompt / "/skill" (claude) or shell command (shell)', required: true }),
16
+ schedule: core_1.Flags.string({ description: 'Cron (UTC) or shorthand like "every 15m"', required: true }),
17
+ timeout: core_1.Flags.integer({ description: 'Timeout in seconds' }),
18
+ model: core_1.Flags.string({ description: 'Claude model override' }),
19
+ 'permission-mode': core_1.Flags.string({ description: 'Claude permission mode', options: PERMISSION_MODES }),
20
+ 'allowed-tool': core_1.Flags.string({ description: 'Allowed tool (repeatable)', multiple: true }),
21
+ 'on-failure': core_1.Flags.string({ description: 'Shell command run on failure' }),
22
+ project: core_1.Flags.string({ description: 'Target project key/id (repeatable)', multiple: true }),
23
+ group: core_1.Flags.string({ description: 'Target group name/id (repeatable)', multiple: true }),
24
+ 'catch-up': core_1.Flags.boolean({ description: 'Run missed schedules on start', default: false }),
25
+ 'no-enabled': core_1.Flags.boolean({ description: 'Create the agent disabled', default: false }),
26
+ };
27
+ async run() {
28
+ const { flags } = await this.parse(AgentsCreate);
29
+ const projectIds = await Promise.all((flags.project ?? []).map((value) => this.resolveProjectId(value)));
30
+ const groupIds = await Promise.all((flags.group ?? []).map((value) => this.resolveGroupId(value)));
31
+ const body = {
32
+ name: flags.name,
33
+ slug: flags.slug,
34
+ kind: flags.kind,
35
+ run: flags.run,
36
+ schedule: flags.schedule,
37
+ enabled: !flags['no-enabled'],
38
+ catch_up: flags['catch-up'],
39
+ project_ids: projectIds,
40
+ group_ids: groupIds,
41
+ };
42
+ if (flags.timeout !== undefined)
43
+ body.timeout_seconds = flags.timeout;
44
+ if (flags.model)
45
+ body.model = flags.model;
46
+ if (flags['permission-mode'])
47
+ body.permission_mode = flags['permission-mode'];
48
+ if (flags['allowed-tool'])
49
+ body.allowed_tools = flags['allowed-tool'];
50
+ if (flags['on-failure'])
51
+ body.on_failure_run = flags['on-failure'];
52
+ const res = await this.api.post('/cli/v1/agents', body);
53
+ if (!this.jsonEnabled())
54
+ this.log(`Created agent ${res.data?.id ?? ''} (${res.data?.slug ?? flags.slug})`);
55
+ return res;
56
+ }
57
+ }
58
+ exports.default = AgentsCreate;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class AgentsDelete extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ confirm: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ class AgentsDelete extends base_1.BaseCommand {
6
+ static args = {
7
+ id: core_1.Args.string({ description: 'Agent id', required: true }),
8
+ };
9
+ static description = 'Delete an automation agent and its run history';
10
+ static examples = ['<%= config.bin %> agents delete <agent-id> --confirm'];
11
+ static flags = {
12
+ confirm: core_1.Flags.boolean({ description: 'Required: confirm the deletion' }),
13
+ };
14
+ async run() {
15
+ const { args, flags } = await this.parse(AgentsDelete);
16
+ if (!flags.confirm) {
17
+ this.error('Refusing to delete without --confirm.', { exit: 2 });
18
+ }
19
+ await this.api.delete(`/cli/v1/agents/${encodeURIComponent(args.id)}`);
20
+ if (!this.jsonEnabled())
21
+ this.log(`Deleted agent ${args.id}`);
22
+ return { deleted: args.id };
23
+ }
24
+ }
25
+ exports.default = AgentsDelete;
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class AgentsList extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ kind: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ page: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ };
9
+ run(): Promise<unknown>;
10
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class AgentsList extends base_1.BaseCommand {
7
+ static description = 'List the automation agents in your organization';
8
+ static examples = ['<%= config.bin %> agents list', '<%= config.bin %> agents list --kind shell --json'];
9
+ static flags = {
10
+ ...base_1.pageFlag,
11
+ kind: core_1.Flags.string({ description: 'Filter by kind (repeatable)', multiple: true, options: ['claude', 'shell'] }),
12
+ };
13
+ async run() {
14
+ const { flags } = await this.parse(AgentsList);
15
+ const params = new URLSearchParams({ page: String(flags.page) });
16
+ for (const kind of flags.kind ?? [])
17
+ params.append('kind[]', kind);
18
+ const res = await this.api.get(`/cli/v1/agents?${params.toString()}`);
19
+ const agents = res.data ?? [];
20
+ if (!this.jsonEnabled()) {
21
+ this.log((0, output_1.renderTable)(['NAME', 'SLUG', 'KIND', 'SCHEDULE', 'ENABLED', 'LAST RUN', 'ID'], agents.map((agent) => [
22
+ String(agent.name ?? ''),
23
+ String(agent.slug ?? ''),
24
+ String(agent.kind ?? ''),
25
+ String(agent.schedule ?? ''),
26
+ String(agent.enabled ?? ''),
27
+ String(agent.last_run_status ?? '-'),
28
+ String(agent.id ?? ''),
29
+ ])));
30
+ }
31
+ return res;
32
+ }
33
+ }
34
+ exports.default = AgentsList;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../base';
2
+ export default class AgentsRunsList extends BaseCommand {
3
+ static args: {
4
+ agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ page: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../../base");
5
+ const output_1 = require("../../../lib/output");
6
+ class AgentsRunsList extends base_1.BaseCommand {
7
+ static args = {
8
+ agentId: core_1.Args.string({ description: 'Agent id', required: true }),
9
+ };
10
+ static description = 'List the run history of an automation agent';
11
+ static examples = ['<%= config.bin %> agents runs list <agent-id>'];
12
+ static flags = {
13
+ ...base_1.pageFlag,
14
+ };
15
+ async run() {
16
+ const { args, flags } = await this.parse(AgentsRunsList);
17
+ const params = new URLSearchParams({ page: String(flags.page) });
18
+ const res = await this.api.get(`/cli/v1/agents/${encodeURIComponent(args.agentId)}/runs?${params.toString()}`);
19
+ const runs = res.data ?? [];
20
+ if (!this.jsonEnabled()) {
21
+ this.log((0, output_1.renderTable)(['STATUS', 'PROJECT', 'DURATION', 'STARTED', 'ID'], runs.map((run) => [
22
+ String(run.status ?? ''),
23
+ String(run.project_id ?? '-'),
24
+ run.duration_ms == null ? '-' : `${run.duration_ms} ms`,
25
+ String(run.started_at ?? '-'),
26
+ String(run.id ?? ''),
27
+ ])));
28
+ }
29
+ return res;
30
+ }
31
+ }
32
+ exports.default = AgentsRunsList;
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../../base';
2
+ export default class AgentsRunsShow extends BaseCommand {
3
+ static args: {
4
+ agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ run(): Promise<unknown>;
10
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../../base");
5
+ const output_1 = require("../../../lib/output");
6
+ class AgentsRunsShow extends base_1.BaseCommand {
7
+ static args = {
8
+ agentId: core_1.Args.string({ description: 'Agent id', required: true }),
9
+ id: core_1.Args.string({ description: 'Run id', required: true }),
10
+ };
11
+ static description = 'Show a single run of an automation agent (output included)';
12
+ static examples = ['<%= config.bin %> agents runs show <agent-id> <run-id>'];
13
+ async run() {
14
+ const { args } = await this.parse(AgentsRunsShow);
15
+ const res = await this.api.get(`/cli/v1/agents/${encodeURIComponent(args.agentId)}/runs/${encodeURIComponent(args.id)}`);
16
+ if (!this.jsonEnabled())
17
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
18
+ return res;
19
+ }
20
+ }
21
+ exports.default = AgentsRunsShow;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class AgentsShow extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ run(): Promise<unknown>;
9
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const output_1 = require("../../lib/output");
6
+ class AgentsShow extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Agent id', required: true }),
9
+ };
10
+ static description = 'Show an automation agent';
11
+ static examples = ['<%= config.bin %> agents show <agent-id>'];
12
+ async run() {
13
+ const { args } = await this.parse(AgentsShow);
14
+ const res = await this.api.get(`/cli/v1/agents/${encodeURIComponent(args.id)}`);
15
+ if (!this.jsonEnabled())
16
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
17
+ return res;
18
+ }
19
+ }
20
+ exports.default = AgentsShow;
@@ -0,0 +1,23 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class AgentsUpdate extends BaseCommand {
3
+ static args: {
4
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ slug: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ run: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ schedule: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ timeout: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ model: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ 'permission-mode': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ 'allowed-tool': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'on-failure': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ enabled: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
20
+ 'catch-up': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ run(): Promise<unknown>;
23
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_1 = require("../../base");
5
+ const PERMISSION_MODES = ['plan', 'acceptEdits', 'auto', 'manual', 'dontAsk', 'bypassPermissions'];
6
+ class AgentsUpdate extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Agent id', required: true }),
9
+ };
10
+ static description = 'Update an automation agent (only the flags you pass are changed)';
11
+ static examples = ['<%= config.bin %> agents update <agent-id> --name "New name" --no-enabled'];
12
+ static flags = {
13
+ name: core_1.Flags.string({ description: 'Display name' }),
14
+ slug: core_1.Flags.string({ description: 'Slug' }),
15
+ kind: core_1.Flags.string({ description: 'Agent kind', options: ['claude', 'shell'] }),
16
+ run: core_1.Flags.string({ description: 'Prompt / "/skill" or shell command' }),
17
+ schedule: core_1.Flags.string({ description: 'Cron (UTC) or shorthand' }),
18
+ timeout: core_1.Flags.integer({ description: 'Timeout in seconds' }),
19
+ model: core_1.Flags.string({ description: 'Claude model override' }),
20
+ 'permission-mode': core_1.Flags.string({ description: 'Claude permission mode', options: PERMISSION_MODES }),
21
+ 'allowed-tool': core_1.Flags.string({ description: 'Allowed tool (repeatable, replaces the list)', multiple: true }),
22
+ 'on-failure': core_1.Flags.string({ description: 'Shell command run on failure' }),
23
+ enabled: core_1.Flags.boolean({ description: 'Enable/disable the agent', allowNo: true }),
24
+ 'catch-up': core_1.Flags.boolean({ description: 'Run missed schedules on start', allowNo: true }),
25
+ };
26
+ async run() {
27
+ const { args, flags } = await this.parse(AgentsUpdate);
28
+ const body = {};
29
+ if (flags.name !== undefined)
30
+ body.name = flags.name;
31
+ if (flags.slug !== undefined)
32
+ body.slug = flags.slug;
33
+ if (flags.kind !== undefined)
34
+ body.kind = flags.kind;
35
+ if (flags.run !== undefined)
36
+ body.run = flags.run;
37
+ if (flags.schedule !== undefined)
38
+ body.schedule = flags.schedule;
39
+ if (flags.timeout !== undefined)
40
+ body.timeout_seconds = flags.timeout;
41
+ if (flags.model !== undefined)
42
+ body.model = flags.model;
43
+ if (flags['permission-mode'] !== undefined)
44
+ body.permission_mode = flags['permission-mode'];
45
+ if (flags['allowed-tool'] !== undefined)
46
+ body.allowed_tools = flags['allowed-tool'];
47
+ if (flags['on-failure'] !== undefined)
48
+ body.on_failure_run = flags['on-failure'];
49
+ if (flags.enabled !== undefined)
50
+ body.enabled = flags.enabled;
51
+ if (flags['catch-up'] !== undefined)
52
+ body.catch_up = flags['catch-up'];
53
+ const res = await this.api.put(`/cli/v1/agents/${encodeURIComponent(args.id)}`, body);
54
+ if (!this.jsonEnabled())
55
+ this.log(`Updated agent ${args.id}`);
56
+ return res;
57
+ }
58
+ }
59
+ exports.default = AgentsUpdate;
@@ -3,15 +3,23 @@ export default class TicketsCreate extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
- title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
- kind: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
8
6
  description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ 'technical-analysis': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ scenarios: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
9
  'step-given': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
10
  'step-when': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
11
  'step-then': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
12
  'step-expected': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ condition: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ weight: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ 'due-at': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
16
  'status-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
17
  'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ 'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ 'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
+ title: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
22
+ kind: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
23
  project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
16
24
  };
17
25
  run(): Promise<unknown>;
@@ -3,47 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const base_1 = require("../../base");
5
5
  const output_1 = require("../../lib/output");
6
+ const ticket_body_1 = require("../../lib/ticket-body");
6
7
  class TicketsCreate extends base_1.BaseCommand {
7
8
  static description = 'Create a ticket';
8
9
  static examples = [
9
10
  '<%= config.bin %> tickets create --project acme-api --title "Checkout fails"',
10
11
  '<%= config.bin %> tickets create -p acme-api --title "Login bug" --kind bug --step-given "logged out" --step-when "I submit" --step-then "it 500s"',
12
+ '<%= config.bin %> tickets create -p acme-api --title "Checkout" --scenarios \'[{"title":"Happy","step_given":"logged in","step_when":"I pay","step_then":"order created"}]\' --condition "confirmation email is sent"',
11
13
  ];
12
14
  static flags = {
13
15
  ...base_1.projectFlag,
14
16
  title: core_1.Flags.string({ description: 'Ticket title', required: true }),
15
- kind: core_1.Flags.string({ description: 'Ticket kind', default: 'bug' }),
16
- description: core_1.Flags.string({ description: 'Free-form description' }),
17
- 'step-given': core_1.Flags.string({ description: 'Given (precondition)' }),
18
- 'step-when': core_1.Flags.string({ description: 'When (action)' }),
19
- 'step-then': core_1.Flags.string({ description: 'Then (outcome)' }),
20
- 'step-expected': core_1.Flags.string({ description: 'Expected result' }),
21
- 'status-id': core_1.Flags.string({ description: 'Status lookup id' }),
22
- 'priority-id': core_1.Flags.string({ description: 'Priority lookup id' }),
17
+ kind: core_1.Flags.string({ description: 'Ticket kind (bug, feature, improvement)', default: 'bug' }),
18
+ ...ticket_body_1.ticketBodyFlags,
23
19
  };
24
20
  async run() {
25
21
  const { flags } = await this.parse(TicketsCreate);
26
22
  const projectId = await this.resolveProjectId(flags.project);
27
23
  const body = { title: flags.title, kind: flags.kind };
28
- if (flags.description !== undefined)
29
- body.description = flags.description;
30
- if (flags['step-given'] !== undefined)
31
- body.step_given = flags['step-given'];
32
- if (flags['step-when'] !== undefined)
33
- body.step_when = flags['step-when'];
34
- if (flags['step-then'] !== undefined)
35
- body.step_then = flags['step-then'];
36
- if (flags['step-expected'] !== undefined)
37
- body.step_expected = flags['step-expected'];
38
- if (flags['status-id'] !== undefined)
39
- body.status_id = flags['status-id'];
40
- if (flags['priority-id'] !== undefined)
41
- body.priority_id = flags['priority-id'];
24
+ (0, ticket_body_1.applyTicketBody)(body, flags);
42
25
  const res = await this.api.post(`/cli/v1/projects/${projectId}/tickets`, body);
43
26
  if (!this.jsonEnabled()) {
44
- const ticket = res.data ?? {};
45
27
  this.log('Ticket created:');
46
- this.log((0, output_1.renderRecord)(ticket));
28
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
47
29
  }
48
30
  return res;
49
31
  }
@@ -14,4 +14,6 @@ export default class TicketsShow extends BaseCommand {
14
14
  private renderAttachments;
15
15
  private renderComments;
16
16
  private renderTicket;
17
+ private renderScenarios;
18
+ private renderConditions;
17
19
  }
@@ -88,20 +88,46 @@ class TicketsShow extends base_1.BaseCommand {
88
88
  created_at: ticket.created_at,
89
89
  updated_at: ticket.updated_at,
90
90
  }));
91
- // Multi-line body blocks: description first, then the 4 BDD clauses (only those present).
92
- const blocks = [
91
+ // Body: description + technical analysis (only if present).
92
+ const scalarBlocks = [
93
93
  ['Description', ticket.description],
94
- ['Given', ticket.step_given],
95
- ['When', ticket.step_when],
96
- ['Then', ticket.step_then],
97
- ['Expected', ticket.step_expected],
94
+ ['Technical analysis', ticket.technical_analysis],
98
95
  ];
99
- for (const [label, value] of blocks) {
96
+ for (const [label, value] of scalarBlocks) {
100
97
  if (value === null || value === undefined || String(value).trim() === '')
101
98
  continue;
102
99
  this.log(`\n${label}\n${'-'.repeat(label.length)}`);
103
100
  this.log((0, output_1.sanitizeMultiline)(value));
104
101
  }
102
+ this.renderScenarios(Array.isArray(ticket.scenarios) ? ticket.scenarios : []);
103
+ this.renderConditions(Array.isArray(ticket.conditions) ? ticket.conditions : []);
104
+ }
105
+ // BDD scenarios: one block per scenario, only the steps present.
106
+ renderScenarios(scenarios) {
107
+ const steps = [
108
+ ['Given', 'step_given'],
109
+ ['When', 'step_when'],
110
+ ['Then', 'step_then'],
111
+ ['Expected', 'step_expected'],
112
+ ];
113
+ scenarios.forEach((scenario, index) => {
114
+ const title = scenario.title ? `Scenario ${index + 1}: ${(0, output_1.sanitize)(scenario.title)}` : `Scenario ${index + 1}`;
115
+ this.log(`\n${title}\n${'-'.repeat(title.length)}`);
116
+ for (const [label, key] of steps) {
117
+ const value = scenario[key];
118
+ if (value === null || value === undefined || String(value).trim() === '')
119
+ continue;
120
+ this.log(`${label}: ${(0, output_1.sanitizeMultiline)(value)}`);
121
+ }
122
+ });
123
+ }
124
+ // Definition of Done: one bullet per condition.
125
+ renderConditions(conditions) {
126
+ if (conditions.length === 0)
127
+ return;
128
+ this.log('\nDefinition of Done\n------------------');
129
+ for (const condition of conditions)
130
+ this.log(`- ${(0, output_1.sanitizeMultiline)(condition.text ?? '')}`);
105
131
  }
106
132
  }
107
133
  exports.default = TicketsShow;
@@ -6,19 +6,23 @@ export default class TicketsUpdate extends BaseCommand {
6
6
  id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
7
  };
8
8
  static flags: {
9
- title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
- kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
9
  description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
- weight: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ 'technical-analysis': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ scenarios: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
12
  'step-given': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
13
  'step-when': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
14
  'step-then': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
15
  'step-expected': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ condition: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ weight: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'due-at': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
19
  'status-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
20
  'priority-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
21
  'assignee-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
22
  'milestone-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
21
23
  'platform-id': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
24
+ title: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
25
+ kind: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
22
26
  project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
23
27
  };
24
28
  run(): Promise<unknown>;