@bussolabs/closeyourit-cli 0.0.19 → 0.0.21

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
@@ -39,6 +39,8 @@ organization are stored locally.
39
39
  | `projects unlink-server <link-id> --project <id\|key> --confirm` | Unlink a server host from the project. |
40
40
  | `projects settings show --project <id\|key>` | Show a project's settings (log/analytics retention + feature flags). |
41
41
  | `projects settings update --project <id\|key> [--logs-retention-days] [--analytics-retention-days] [--roadmap-enabled] [--quick-bug-report-enabled] [--analytics-enabled]` | Update a project's settings (only the passed fields change). |
42
+ | `projects github --project <id\|key>` | Show a project's GitHub integration (repo link + tag→release binding rules). |
43
+ | `projects github-update --project <id\|key> [--default-branch] [--production-environment-id] [--staging-environment-id] [--sync-enabled] [--tag-binding-enabled] [--autoclose-on-merge]` | Update a project's GitHub binding rules (only the passed fields change). |
42
44
  | `groups list [--page]` | List groups (macro-projects) in your org. |
43
45
  | `groups create <name> [--color] [--roadmap-enabled]` | Create a group (container of related projects, e.g. "DriverOne"). |
44
46
  | `groups update <id\|name> [--name] [--color] [--roadmap-enabled]` | Update a group (rename, recolor, toggle roadmap). |
@@ -78,6 +80,8 @@ organization are stored locally.
78
80
  | `tickets reviewer <id> --project <id\|key> --reviewer-id <account-id>` | Set the reviewer of a ticket (requires tickets.assign). |
79
81
  | `tickets unreviewer <id> --project <id\|key>` | Remove the reviewer of a ticket. |
80
82
  | `tickets watch\|unwatch <id> --project <id\|key>` | Watch / stop watching a ticket (its notifications). |
83
+ | `tickets branch <id\|code> --project <id\|key>` | Create a GitHub branch from a ticket (name prefixed with the ticket code). |
84
+ | `tickets pr <id\|code> --project <id\|key>` | Open a GitHub pull request from a ticket (head = the ticket branch). |
81
85
  | `ideas delete <id> --project <id\|key> --confirm` | Delete an idea (author always allowed; others need ideas.delete). |
82
86
  | `ideas archive\|unarchive <id> --project <id\|key>` | Archive an idea (open → archived) / reopen it. |
83
87
  | `ideas case-update <idea-id> <case-id> --project <id\|key> [--title] [--description]` | Update a case (example) of an idea. |
@@ -113,6 +117,9 @@ organization are stored locally.
113
117
  | `agents delete <id> --confirm` | Delete an agent and its run history. |
114
118
  | `agents runs list <agent-id> [--page]` | List an agent's run history. |
115
119
  | `agents runs show <agent-id> <run-id>` | Show a single run (with output). |
120
+ | `agents tokens list [--page]` | List the org automator tokens (cyi_a_). |
121
+ | `agents tokens create <name>` | Create an org automator token (secret shown only once). |
122
+ | `agents tokens revoke <id> --confirm` | Revoke an org automator token. |
116
123
  | `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). |
117
124
  | `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. |
118
125
  | `monitors publish\|unpublish <id> --project <id\|key>` | Publish / unpublish the monitor's public status page. |
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../../base';
2
+ export default class AgentsTokensCreate extends BaseCommand {
3
+ static args: {
4
+ name: 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,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 AgentsTokensCreate extends base_1.BaseCommand {
6
+ static args = {
7
+ name: core_1.Args.string({ description: 'Token name (e.g. automator)', required: true }),
8
+ };
9
+ static description = 'Create an org automator token (cyi_a_ — the secret is shown only once)';
10
+ static examples = ['<%= config.bin %> agents tokens create automator'];
11
+ async run() {
12
+ const { args } = await this.parse(AgentsTokensCreate);
13
+ const res = await this.api.post('/cli/v1/agents/tokens', { name: args.name });
14
+ const token = res.data ?? {};
15
+ if (!this.jsonEnabled()) {
16
+ this.log('Automator token created. Store the secret now — it is shown only once:');
17
+ this.log('');
18
+ this.log(` secret: ${token.secret ?? '-'}`);
19
+ this.log('');
20
+ this.warn('The secret cannot be retrieved again. If you lose it, revoke and create a new one.');
21
+ }
22
+ return res;
23
+ }
24
+ }
25
+ exports.default = AgentsTokensCreate;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../../base';
2
+ export default class AgentsTokensList extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ page: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ };
8
+ run(): Promise<unknown>;
9
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_1 = require("../../../base");
4
+ const output_1 = require("../../../lib/output");
5
+ class AgentsTokensList extends base_1.BaseCommand {
6
+ static description = 'List the org automator tokens (closeyourit-automator authenticates with these)';
7
+ static examples = ['<%= config.bin %> agents tokens list'];
8
+ static flags = { ...base_1.pageFlag };
9
+ async run() {
10
+ const { flags } = await this.parse(AgentsTokensList);
11
+ const res = await this.api.get(`/cli/v1/agents/tokens?page=${flags.page}`);
12
+ const tokens = res.data ?? [];
13
+ if (!this.jsonEnabled()) {
14
+ this.log((0, output_1.renderTable)(['NAME', 'PREFIX', 'LAST USED', 'REVOKED', 'ID'], tokens.map((token) => [
15
+ String(token.name ?? ''),
16
+ String(token.token_prefix ?? ''),
17
+ String(token.last_used_at ?? '-'),
18
+ String(token.revoked_at ?? '-'),
19
+ String(token.id ?? ''),
20
+ ])));
21
+ }
22
+ return res;
23
+ }
24
+ }
25
+ exports.default = AgentsTokensList;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../../base';
2
+ export default class AgentsTokensRevoke 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 AgentsTokensRevoke extends base_1.BaseCommand {
6
+ static args = {
7
+ id: core_1.Args.string({ description: 'Automator token id', required: true }),
8
+ };
9
+ static description = 'Revoke an org automator token (the automator using it stops syncing)';
10
+ static examples = ['<%= config.bin %> agents tokens revoke <token-id> --confirm'];
11
+ static flags = {
12
+ confirm: core_1.Flags.boolean({ description: 'Required: confirm the revocation' }),
13
+ };
14
+ async run() {
15
+ const { args, flags } = await this.parse(AgentsTokensRevoke);
16
+ if (!flags.confirm) {
17
+ this.error('Refusing to revoke without --confirm.', { exit: 2 });
18
+ }
19
+ await this.api.delete(`/cli/v1/agents/tokens/${encodeURIComponent(args.id)}`);
20
+ if (!this.jsonEnabled())
21
+ this.log(`Revoked automator token ${args.id}`);
22
+ return { revoked: args.id };
23
+ }
24
+ }
25
+ exports.default = AgentsTokensRevoke;
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class ProjectsGithubUpdate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ 'default-branch': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ 'production-environment-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ 'staging-environment-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ 'sync-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ 'tag-binding-enabled': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ 'autoclose-on-merge': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<unknown>;
15
+ }
@@ -0,0 +1,55 @@
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 ProjectsGithubUpdate extends base_1.BaseCommand {
7
+ static description = 'Update a project GitHub binding rules (environment mapping + sync/binding/autoclose flags); only the passed fields change';
8
+ static examples = [
9
+ '<%= config.bin %> projects github-update -p LBRA --production-environment-id <env-uuid>',
10
+ '<%= config.bin %> projects github-update -p LBRA --no-tag-binding-enabled',
11
+ '<%= config.bin %> projects github-update -p LBRA --default-branch main --autoclose-on-merge',
12
+ ];
13
+ static flags = {
14
+ ...base_1.projectFlag,
15
+ 'default-branch': core_1.Flags.string({ description: 'Default base branch used to create branches/PRs' }),
16
+ 'production-environment-id': core_1.Flags.string({
17
+ description: 'Environment id mapped to STABLE tags (production target)',
18
+ }),
19
+ 'staging-environment-id': core_1.Flags.string({
20
+ description: 'Environment id mapped to PRE-RELEASE tags (staging target)',
21
+ }),
22
+ 'sync-enabled': core_1.Flags.boolean({ allowNo: true, description: 'Enable/disable processing of webhook events' }),
23
+ 'tag-binding-enabled': core_1.Flags.boolean({ allowNo: true, description: 'Enable/disable tag→release live binding' }),
24
+ 'autoclose-on-merge': core_1.Flags.boolean({
25
+ allowNo: true,
26
+ description: 'Enable/disable moving the ticket to done on PR merge',
27
+ }),
28
+ };
29
+ async run() {
30
+ const { flags } = await this.parse(ProjectsGithubUpdate);
31
+ const projectId = await this.resolveProjectId(flags.project);
32
+ const body = {};
33
+ if (flags['default-branch'] !== undefined)
34
+ body.default_branch = flags['default-branch'];
35
+ if (flags['production-environment-id'] !== undefined)
36
+ body.production_environment_id = flags['production-environment-id'];
37
+ if (flags['staging-environment-id'] !== undefined)
38
+ body.staging_environment_id = flags['staging-environment-id'];
39
+ if (flags['sync-enabled'] !== undefined)
40
+ body.sync_enabled = flags['sync-enabled'];
41
+ if (flags['tag-binding-enabled'] !== undefined)
42
+ body.tag_binding_enabled = flags['tag-binding-enabled'];
43
+ if (flags['autoclose-on-merge'] !== undefined)
44
+ body.autoclose_on_merge = flags['autoclose-on-merge'];
45
+ // The GitHub action responds to both PATCH and PUT (Rails singleton `resource` update); the CLI
46
+ // transport speaks PUT — the backend applies only the keys present in the body either way.
47
+ const res = await this.api.put(`/cli/v1/projects/${encodeURIComponent(projectId)}/github`, body);
48
+ if (!this.jsonEnabled()) {
49
+ this.log('GitHub integration updated:');
50
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
51
+ }
52
+ return res;
53
+ }
54
+ }
55
+ exports.default = ProjectsGithubUpdate;
@@ -0,0 +1,9 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class ProjectsGithub extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ project: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ };
8
+ run(): Promise<unknown>;
9
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_1 = require("../../base");
4
+ const output_1 = require("../../lib/output");
5
+ class ProjectsGithub extends base_1.BaseCommand {
6
+ static description = 'Show a project GitHub integration (repo link + tag→release binding rules)';
7
+ static examples = [
8
+ '<%= config.bin %> projects github --project legalbloom-rails',
9
+ '<%= config.bin %> projects github -p LBRA',
10
+ '<%= config.bin %> projects github -p LBRA --json',
11
+ ];
12
+ static flags = { ...base_1.projectFlag };
13
+ async run() {
14
+ const { flags } = await this.parse(ProjectsGithub);
15
+ const projectId = await this.resolveProjectId(flags.project);
16
+ const res = await this.api.get(`/cli/v1/projects/${encodeURIComponent(projectId)}/github`);
17
+ if (!this.jsonEnabled()) {
18
+ const data = res.data ?? {};
19
+ // Flatten the repository block into a single record: unset fields render as `-` when not connected.
20
+ const repo = (data.repository ?? {});
21
+ this.log('GitHub integration:');
22
+ this.log((0, output_1.renderRecord)({
23
+ project_id: data.project_id,
24
+ installed: data.installed,
25
+ connected: data.connected,
26
+ full_name: repo.full_name,
27
+ default_branch: repo.default_branch,
28
+ sync_enabled: repo.sync_enabled,
29
+ tag_binding_enabled: repo.tag_binding_enabled,
30
+ autoclose_on_merge: repo.autoclose_on_merge,
31
+ production_environment_id: repo.production_environment_id,
32
+ staging_environment_id: repo.staging_environment_id,
33
+ }));
34
+ }
35
+ return res;
36
+ }
37
+ }
38
+ exports.default = ProjectsGithub;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class TicketsBranch 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, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,27 @@
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 TicketsBranch extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Ticket id or code (e.g. DRFL-3)', required: true }),
9
+ };
10
+ static description = 'Create a GitHub branch from a ticket (name prefixed with the ticket code)';
11
+ static examples = [
12
+ '<%= config.bin %> tickets branch DRFL-3 --project driverone-flutter',
13
+ '<%= config.bin %> tickets branch DRFL-3 -p driverone-flutter --json',
14
+ ];
15
+ static flags = { ...base_1.projectFlag };
16
+ async run() {
17
+ const { args, flags } = await this.parse(TicketsBranch);
18
+ const projectId = await this.resolveProjectId(flags.project);
19
+ const res = await this.api.post(`/cli/v1/projects/${encodeURIComponent(projectId)}/tickets/${encodeURIComponent(args.id)}/github/branch`);
20
+ if (!this.jsonEnabled()) {
21
+ this.log('Branch created:');
22
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
23
+ }
24
+ return res;
25
+ }
26
+ }
27
+ exports.default = TicketsBranch;
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class TicketsPr 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, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<unknown>;
12
+ }
@@ -0,0 +1,27 @@
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 TicketsPr extends base_1.BaseCommand {
7
+ static args = {
8
+ id: core_1.Args.string({ description: 'Ticket id or code (e.g. DRFL-3)', required: true }),
9
+ };
10
+ static description = 'Open a GitHub pull request from a ticket (head = the ticket branch, title prefixed with the code)';
11
+ static examples = [
12
+ '<%= config.bin %> tickets pr DRFL-3 --project driverone-flutter',
13
+ '<%= config.bin %> tickets pr DRFL-3 -p driverone-flutter --json',
14
+ ];
15
+ static flags = { ...base_1.projectFlag };
16
+ async run() {
17
+ const { args, flags } = await this.parse(TicketsPr);
18
+ const projectId = await this.resolveProjectId(flags.project);
19
+ const res = await this.api.post(`/cli/v1/projects/${encodeURIComponent(projectId)}/tickets/${encodeURIComponent(args.id)}/github/pull_request`);
20
+ if (!this.jsonEnabled()) {
21
+ this.log('Pull request opened:');
22
+ this.log((0, output_1.renderRecord)(res.data ?? {}));
23
+ }
24
+ return res;
25
+ }
26
+ }
27
+ exports.default = TicketsPr;