@codiac.io/codiac-cli 1.3.36 → 1.3.38

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
@@ -21,7 +21,7 @@ $ npm install -g @codiac.io/codiac-cli
21
21
  $ codiac COMMAND
22
22
  running command...
23
23
  $ codiac (--version|-v)
24
- @codiac.io/codiac-cli/1.3.36 linux-x64 node-v16.17.1
24
+ @codiac.io/codiac-cli/1.3.38 linux-x64 node-v16.17.1
25
25
  $ codiac --help [COMMAND]
26
26
  USAGE
27
27
  $ codiac COMMAND
@@ -1,15 +1,30 @@
1
- import "reflect-metadata";
2
- import { CommandBaseEnterprise } from '../../command-base-enterprise';
3
- export default class CabinetCreate extends CommandBaseEnterprise {
1
+ import { Command } from '@oclif/core';
2
+ import { ISecurable } from "@codiac.io/codiac-common/security";
3
+ import { CabinetScope } from '../../apis/codiac-relay/contracts';
4
+ import { CommandBaseExec } from '../../command-base-exec';
5
+ import { InteractionModes } from "../../uilogic/config-ui-utils";
6
+ import { AtLeast } from '@codiac.io/codiac-common/contracts';
7
+ import { RootMap } from "../../apis/codiac-api/contracts";
8
+ export type CabinetCreateRequest = CabinetScope & ISecurable & {
9
+ enterprise: string;
10
+ cluster: string;
11
+ };
12
+ export default class CabinetCreate extends CommandBaseExec<CabinetCreateRequest> {
4
13
  static description: string;
5
14
  static aliases: string[];
6
15
  static args: {
7
16
  cabinet: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
8
17
  };
18
+ static examples: Command.Example[];
9
19
  static flags: {
10
20
  help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
11
21
  enterprise: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
22
  environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
23
+ cluster: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
24
+ silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
25
+ echo: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
26
+ "to-script": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
27
+ "take-defaults": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
28
  as: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
29
  remember: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
30
  rememberAs: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
@@ -17,5 +32,11 @@ export default class CabinetCreate extends CommandBaseEnterprise {
17
32
  withoutdefaults: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
33
  verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
34
  };
20
- run(): Promise<void>;
35
+ protected bootstrap(): void;
36
+ captureArgs(enterpriseCode: string): Promise<[AtLeast<CabinetCreateRequest, "enterprise">, (InteractionModes | undefined), boolean]>;
37
+ validatePartial(partial: CabinetCreateRequest, rootMap: RootMap): Promise<CabinetCreateRequest>;
38
+ buildCandidate_silently(partial: CabinetCreateRequest, rootMap: RootMap): Promise<CabinetCreateRequest>;
39
+ buildCandidate_interactively(partial: AtLeast<CabinetCreateRequest, "enterprise">, rootMap: RootMap, takeDefaults: boolean): Promise<CabinetCreateRequest>;
40
+ buildCommandString(candidate: CabinetCreateRequest, cmd: string[]): string[];
41
+ executeTask(candidate: CabinetCreateRequest): Promise<void>;
21
42
  }
@@ -1,115 +1,161 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- require("reflect-metadata");
5
4
  const core_1 = require("@oclif/core");
6
5
  const cli_common_1 = require("../../cli-common");
7
- const command_base_enterprise_1 = require("../../command-base-enterprise");
6
+ const command_base_exec_1 = require("../../command-base-exec");
8
7
  const cloud_provider_contextualizer_1 = require("../../uilogic/cloud-provider-contextualizer");
8
+ const config_ui_utils_1 = require("../../uilogic/config-ui-utils");
9
9
  const prettify_1 = require("../../prettify");
10
- class CabinetCreate extends command_base_enterprise_1.CommandBaseEnterprise {
11
- run() {
10
+ class CabinetCreate extends command_base_exec_1.CommandBaseExec {
11
+ bootstrap() {
12
+ super.bootstrap();
13
+ cloud_provider_contextualizer_1.CloudProviderContextualizer.bootstrap(this.ioc);
14
+ }
15
+ captureArgs(enterpriseCode) {
16
+ var _a, _b, _c;
17
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
+ const { args, flags } = yield this.parse(CabinetCreate);
19
+ //Defaults enterprise
20
+ let partial = { enterprise: enterpriseCode };
21
+ if (args.cabinet)
22
+ partial.cabinet = args.cabinet;
23
+ if (flags.environment)
24
+ partial.environment = flags.environment;
25
+ if (flags.cluster)
26
+ partial.cluster = flags.cluster;
27
+ //Overrides enterpriseCode if passed in
28
+ if (flags.enterprise)
29
+ partial.enterprise = flags.enterprise;
30
+ const interactionMode = (_b = (_a = (flags.echo ? config_ui_utils_1.InteractionModes.echo : undefined)) !== null && _a !== void 0 ? _a : (flags["to-script"] ? config_ui_utils_1.InteractionModes.toscript : undefined)) !== null && _b !== void 0 ? _b : (flags.silent ? config_ui_utils_1.InteractionModes.silent : undefined);
31
+ const takeDefaults = (_c = flags['take-defaults']) !== null && _c !== void 0 ? _c : false;
32
+ return [partial, interactionMode, takeDefaults];
33
+ });
34
+ }
35
+ validatePartial(partial, rootMap) {
36
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
37
+ if (!partial.cabinet)
38
+ throw new Error("Cabinet name must be set");
39
+ if (!partial.environment)
40
+ throw new Error("Environment must be set");
41
+ if (!partial.enterprise) {
42
+ if (rootMap.enterprises.length > 1)
43
+ throw new Error("Enterprise must be set");
44
+ else
45
+ partial.enterprise = rootMap.enterprises[0].name;
46
+ }
47
+ if (!partial.cluster)
48
+ throw new Error("Cluster must be set");
49
+ // Validate cabinet name
50
+ const cabinetNameRegex = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/;
51
+ if (!cabinetNameRegex.test(partial.cabinet)) {
52
+ throw new Error("Invalid cabinet name. It must consist of lowercase alphanumeric characters or '-', and must start and end with an alphanumeric character. Maximum length is 63 characters.");
53
+ }
54
+ // Matches EKS
55
+ if (partial.cabinet.length > 63) {
56
+ throw new Error("Cabinet name is too long. Maximum length is 63 characters.");
57
+ }
58
+ //validate enterprise exists
59
+ let enterprise = rootMap.enterprises.find(e => e.name === partial.enterprise);
60
+ if (!enterprise)
61
+ throw new Error(`Enterprise ${partial.enterprise} not found`);
62
+ //Validate Environment exists
63
+ let environment = enterprise === null || enterprise === void 0 ? void 0 : enterprise.environments.find(env => env.name === partial.environment);
64
+ if (!environment)
65
+ throw new Error(`Environment ${partial.environment} not found in enterprise ${partial.enterprise}`);
66
+ //Validate cluster exists & maybe default to first if not set?
67
+ let clusters = (environment === null || environment === void 0 ? void 0 : environment.clusters) || [];
68
+ let cluster = clusters.find(c => c.name === partial.cluster);
69
+ if (!cluster)
70
+ throw new Error(`Cluster ${partial.cluster} not found in environment ${partial.environment}`);
71
+ //Validate cabinet name and not duplicate
72
+ let cabinet = environment.cabinets.find(cab => cab.name === partial.cabinet);
73
+ if (cabinet)
74
+ throw new Error(`Cabinet ${partial.cabinet} already exists in environment ${partial.environment}`);
75
+ return partial;
76
+ });
77
+ }
78
+ buildCandidate_silently(partial, rootMap) {
12
79
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
- try {
14
- this.bootstrap();
15
- let params = yield this.parse(CabinetCreate);
16
- return this.exec.runWithDefaults(params, (args, flags) => tslib_1.__awaiter(this, void 0, void 0, function* () {
17
- return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
18
- var _a;
19
- try {
20
- (_a = this._relayContainer) === null || _a === void 0 ? void 0 : _a.ready$.subscribe(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
21
- var _b, _c;
22
- try {
23
- cloud_provider_contextualizer_1.CloudProviderContextualizer.bootstrap(this.ioc);
24
- // TODO: Ensure that if the projCfg has a tenantCode, that establishTenantContext enforced it with the user authentication.
25
- // THAT IS: Boot 'em if they're not part of this project's tenant.
26
- this._userCntx = yield this.establishTenantContext(this._userCntx);
27
- let currentEnterprise = (yield this.establishEnterpriseContext(flags.enterprise)).enterprise;
28
- let enterpriseCode = currentEnterprise.code; // NOTE: We could also pull this from: this._projUserCfg.enterprise.enterpriseCode;
29
- let environment;
30
- let cluster;
31
- let cabinetName;
32
- let candidate;
33
- let confirm;
34
- do {
35
- let rootMap = yield this.getRootMap(enterpriseCode);
36
- // Validate for enteprise and environment
37
- if (rootMap.enterprises.length == 0)
38
- throw new Error("You have no enterprises defined. You must create one and an environment before you can create a cabinet.");
39
- let ent = rootMap.enterprises.find(e => e.name == enterpriseCode);
40
- if (ent == undefined)
41
- throw new Error("The given enterprise was not found.");
42
- if (ent.environments.length == 0)
43
- throw new Error("You have no environments defined in this enterprise. You must create one before you can create a cabinet.");
44
- [environment, cluster] = yield this.rootMapUtils.promptForEnviroCluster(rootMap, enterpriseCode, flags.environment, undefined, undefined);
45
- let uiCloudProvider = this.ioc.get(cloud_provider_contextualizer_1.CloudProviderContextualizer);
46
- yield uiCloudProvider.promptForCloudProviderCreds(this.ioc, cluster.provider);
47
- if (args.cabinet !== undefined) {
48
- cabinetName = args.cabinet;
49
- }
50
- else {
51
- cabinetName = (yield this._ui.prompt("cabinetName", "Cabinet name: ", true));
52
- }
53
- candidate = {
54
- enterprise: enterpriseCode,
55
- environment: environment.name,
56
- cabinet: cabinetName,
57
- };
58
- // CONFIRM
59
- let preview = Object.assign(Object.assign({}, candidate), { cluster: { name: cluster.name, provider: cluster.provider, location: cluster.locationName } });
60
- this.dataAuthUtils.removeAcl(preview);
61
- this._ui.userMessage((0, prettify_1.prettify)(preview));
62
- this._ui.userMessage("You are about to create this cabinet");
63
- confirm = yield this._ui.promptConfirm("confirm", `Continue? (ctrl-C to cancel)`, false);
64
- } while (confirm !== true);
65
- this._ui.startSpinner(`Creating new cabinet [${enterpriseCode}/${cabinetName}]...`);
66
- let result = yield this.genRelayClient.Call.postExecuteCabinetMaker({ targetCabinet: candidate, targetClusterName: cluster.name });
67
- this._ui.stopSpinner(`${result.success ? "Success!" : "Failed."}`);
68
- if (result.error) {
69
- this.logger.error(`Error creating cabinet: ${result.message || ""}; ${result.error.message}`, result.error);
70
- this._ui.userMessage(`Error creating cabinet: ${result.message || ""}; ${result.error.message}`);
71
- }
72
- else if (!result.success) {
73
- this.logger.notice(`Cabinet creation failed without error. ${result.message}`);
74
- this._ui.userMessage(`Cabinet creation failed without error. ${result.message}`);
75
- }
76
- else if (result.output) {
77
- let cab = result.output;
78
- this.logger.notice(`${this._styler.colorGood("Success!")} Cabinet [${this._styler.hilite(cab.name)}] created for enterprise [${cab.enterpriseCode}]`);
79
- this._ui.userMessage(`${this._styler.colorGood("Success!")} Cabinet [${this._styler.hilite(cab.name)}] created for enterprise [${cab.enterpriseCode}]`);
80
- } // else { this._ui.userMessage("Supposedly succeeded, but we didnt get the response back that we expected. You might want to verify the cabinet."); }
81
- }
82
- catch (err) {
83
- this._ui.userMessage(`Error ${(_b = err.name) !== null && _b !== void 0 ? _b : ""} ${(_c = err.message) !== null && _c !== void 0 ? _c : ""}`);
84
- }
85
- finally {
86
- return;
87
- }
88
- }));
89
- }
90
- catch (err) {
91
- this.handleError(err);
92
- reject(err);
93
- }
94
- }));
95
- }));
80
+ partial = yield this.validatePartial(partial, rootMap);
81
+ return partial;
82
+ });
83
+ }
84
+ buildCandidate_interactively(partial, rootMap, takeDefaults) {
85
+ var _a;
86
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
87
+ let environment;
88
+ let cluster;
89
+ let cabinetName;
90
+ let candidate;
91
+ let confirm;
92
+ // Wrap in a do-while loop to allow for re-entry if the user wants to re-enter any values after confirmation
93
+ do {
94
+ cabinetName = (_a = partial.cabinet) !== null && _a !== void 0 ? _a : (yield this._ui.prompt("cabinetName", "Cabinet name: ", true));
95
+ [environment, cluster] = yield this.rootMapUtils.promptForEnviroCluster(rootMap, partial.enterprise, partial.environment, undefined, undefined);
96
+ let uiCloudProvider = this.ioc.get(cloud_provider_contextualizer_1.CloudProviderContextualizer);
97
+ yield uiCloudProvider.promptForCloudProviderCreds(this.ioc, cluster.provider);
98
+ candidate = {
99
+ enterprise: partial.enterprise,
100
+ environment: environment.name,
101
+ cabinet: cabinetName,
102
+ cluster: cluster.name
103
+ };
104
+ // We want to validate before we show the user the full/final preview
105
+ candidate = yield this.validatePartial(candidate, rootMap);
106
+ // CONFIRM
107
+ let preview = Object.assign(Object.assign({}, candidate), { cluster: { name: cluster.name, provider: cluster.provider, location: cluster.locationName } });
108
+ this.dataAuthUtils.removeAcl(preview);
109
+ this._ui.userMessage((0, prettify_1.prettify)(preview));
110
+ this._ui.userMessage("You are about to create this cabinet");
111
+ confirm = yield this._ui.promptConfirm("confirm", `Continue? (ctrl-C to cancel)`, false);
112
+ } while (confirm !== true);
113
+ return candidate;
114
+ });
115
+ }
116
+ buildCommandString(candidate, cmd) {
117
+ cmd.push(candidate.cabinet);
118
+ cmd.push("--enterprise", candidate.enterprise);
119
+ cmd.push("--environment", candidate.environment);
120
+ cmd.push("--cluster", candidate.cluster);
121
+ cmd.push("--silent");
122
+ return cmd;
123
+ }
124
+ executeTask(candidate) {
125
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
126
+ this._ui.startSpinner(`Creating new cabinet [${candidate.enterprise}/${candidate.cabinet}]...`);
127
+ let result = yield this.genRelayClient.Call.postExecuteCabinetMaker({ targetCabinet: candidate, targetClusterName: candidate.cluster });
128
+ this._ui.stopSpinner(`${result.success ? "Success!" : "Failed."}`);
129
+ if (result.error) {
130
+ this.logger.error(`Error creating cabinet: ${result.message || ""}; ${result.error.message}`, result.error);
131
+ this._ui.userMessage(`Error creating cabinet: ${result.message || ""}; ${result.error.message}`);
132
+ }
133
+ else if (!result.success) {
134
+ this.logger.notice(`Cabinet creation failed without error. ${result.message}`);
135
+ this._ui.userMessage(`Cabinet creation failed without error. ${result.message}`);
96
136
  }
97
- catch (err) {
98
- this.logger.error(`Error parsing arguments: ${err}`);
99
- this.logger.debug(err.stack);
100
- return new Promise((res, rej) => tslib_1.__awaiter(this, void 0, void 0, function* () { return res(); }));
101
- // return new Promise<void>(async (res,rej) => rej(new Error(`Error parsing arguments: ${err}`)));
137
+ else if (result.output) {
138
+ let cab = result.output;
139
+ this.logger.notice(`${this._styler.colorGood("Success!")} Cabinet [${this._styler.hilite(cab.name)}] created for enterprise [${cab.enterpriseCode}]`);
140
+ this._ui.userMessage(`${this._styler.colorGood("Success!")} Cabinet [${this._styler.hilite(cab.name)}] created for enterprise [${cab.enterpriseCode}]`);
102
141
  }
103
142
  });
104
143
  }
105
144
  }
106
145
  exports.default = CabinetCreate;
107
- CabinetCreate.description = 'Initializes a cabinet for a given enterprise and environment. Overwrites any existing if forced, otherwise returns an error if the cabinet already exists.';
146
+ CabinetCreate.description = 'Initializes a cabinet for a given enterprise and environment. Returns an error if the cabinet already exists.';
108
147
  CabinetCreate.aliases = ["cab:create"];
109
148
  CabinetCreate.args = {
110
149
  cabinet: core_1.Args.string({ required: false, description: 'The name of the cabinet to create' })
111
150
  };
112
- CabinetCreate.flags = Object.assign(Object.assign({}, cli_common_1.commandBase.globalFlags), { help: core_1.Flags.help({ char: 'h' }),
113
- // force: Flags.boolean({ char: 'f', default: false, description: 'Overwrites and reinitializes if the cabinet already exists.' }),
114
- enterprise: core_1.Flags.string({ description: '(required only if more than one enterprise exists) The name of the enterprise under which to create this cabinet.' }), environment: core_1.Flags.string({ char: 'e', description: '(optional: defaults to that of the current project branch) The name of the environment this cabinet will be grouped under.' }) });
151
+ //TODO: Finish me!!
152
+ CabinetCreate.examples = [
153
+ { description: "Create a cabinet interativley.", command: "cod cabinet create" },
154
+ { description: "Create a cabinet interativley and assemble a non-interactive command string.", command: "cod cabinet create --echo" },
155
+ { description: "Assemble a non-interactive command string WITHOUT actually creating a cabinet (dry run).", command: "cod cabinet create --to-script" },
156
+ { description: "Create a cabinet silently.", command: "cod cabinet create my-cab-name --enterprise main -e dev-environemt -c my-cluster --silent" },
157
+ ];
158
+ CabinetCreate.flags = Object.assign(Object.assign({}, cli_common_1.commandBase.globalFlags), { help: core_1.Flags.help({ char: 'h' }), enterprise: core_1.Flags.string({ description: '(required only if more than one enterprise exists) The name of the enterprise under which to create this cabinet.' }), environment: core_1.Flags.string({ char: 'e', multiple: false, description: '(optional: defaults to that of the current project branch) The name of the environment this cabinet will be grouped under.' }), cluster: core_1.Flags.string({ char: 'c', description: '(optional: defaults to the first cluster in the environment) The name of the cluster to use for the cabinet.' }), silent: core_1.Flags.boolean({ exclusive: ["echo", "to-script"], description: 'Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.' }), echo: core_1.Flags.boolean({ exclusive: ["to-script", "silent"], description: 'Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.' }), "to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.' }),
159
+ //Not sure what to do with this one yet
160
+ "take-defaults": core_1.Flags.boolean({ exclusive: ["silent"], description: "Setting this to true prevents prompting for confirmation on parameters that were passed in or were automatically set to default values (Irrelevant in --silent mode)." }) });
115
161
  //# sourceMappingURL=create.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/cabinet/create.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAC1B,sCAA0C;AAG1C,iDAA+C;AAC/C,2EAAqE;AACrE,+FAA0F;AAE1F,6CAA0C;AAG1C,MAAqB,aAAc,SAAQ,+CAAqB;IAgBxD,GAAG;;YACP,IAAI;gBACF,IAAI,CAAC,SAAS,EAAE,CAAC;gBACjB,IAAI,MAAM,GAAG,MAAM,IAAI,CAA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AK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,4GAA4G,EAAE,CAAC,EACtL,IAAI,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,kHAAkH,EAAE,CAAC,EAC5L,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,sGAAsG,EAAE,CAAC;IAClL,uCAAuC;IACvC,eAAe,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,uKAAuK,EAAE,CAAC,IAChP"}
@@ -14,7 +14,7 @@ const cli_tools_1 = require("@codiac.io/cli-tools");
14
14
  const INTERFACES_CLI_1 = require("../ops/INTERFACES_CLI");
15
15
  const Docker = require("dockerode");
16
16
  const DEFAULT_IMAGE_NAME = "codiacimages/codiac-relay";
17
- const DEFAULT_IMAGE_TAG = "1.4.7"; // "1.3.27";
17
+ const DEFAULT_IMAGE_TAG = "1.4.8"; // "1.3.27";
18
18
  const DEFAULT_CONTAINER_NAME = "codiac-relay";
19
19
  const DEFAULT_HEALTH_CHECK_URL = "http://localhost:5799/heartbeat-json"; // /ready-state";
20
20
  const DEFAULT_RETRY_TIMOUT_IN_MINUTES = 1;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.36",
2
+ "version": "1.3.38",
3
3
  "commands": {
4
4
  "branch": {
5
5
  "id": "branch",
@@ -2106,7 +2106,7 @@
2106
2106
  },
2107
2107
  "cabinet:create": {
2108
2108
  "id": "cabinet:create",
2109
- "description": "Initializes a cabinet for a given enterprise and environment. Overwrites any existing if forced, otherwise returns an error if the cabinet already exists.",
2109
+ "description": "Initializes a cabinet for a given enterprise and environment. Returns an error if the cabinet already exists.",
2110
2110
  "strict": true,
2111
2111
  "pluginName": "@codiac.io/codiac-cli",
2112
2112
  "pluginAlias": "@codiac.io/codiac-cli",
@@ -2115,6 +2115,24 @@
2115
2115
  "cab:create"
2116
2116
  ],
2117
2117
  "hiddenAliases": [],
2118
+ "examples": [
2119
+ {
2120
+ "description": "Create a cabinet interativley.",
2121
+ "command": "cod cabinet create"
2122
+ },
2123
+ {
2124
+ "description": "Create a cabinet interativley and assemble a non-interactive command string.",
2125
+ "command": "cod cabinet create --echo"
2126
+ },
2127
+ {
2128
+ "description": "Assemble a non-interactive command string WITHOUT actually creating a cabinet (dry run).",
2129
+ "command": "cod cabinet create --to-script"
2130
+ },
2131
+ {
2132
+ "description": "Create a cabinet silently.",
2133
+ "command": "cod cabinet create my-cab-name --enterprise main -e dev-environemt -c my-cluster --silent"
2134
+ }
2135
+ ],
2118
2136
  "flags": {
2119
2137
  "as": {
2120
2138
  "name": "as",
@@ -2172,6 +2190,52 @@
2172
2190
  "char": "e",
2173
2191
  "description": "(optional: defaults to that of the current project branch) The name of the environment this cabinet will be grouped under.",
2174
2192
  "multiple": false
2193
+ },
2194
+ "cluster": {
2195
+ "name": "cluster",
2196
+ "type": "option",
2197
+ "char": "c",
2198
+ "description": "(optional: defaults to the first cluster in the environment) The name of the cluster to use for the cabinet.",
2199
+ "multiple": false
2200
+ },
2201
+ "silent": {
2202
+ "name": "silent",
2203
+ "type": "boolean",
2204
+ "description": "Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.",
2205
+ "allowNo": false,
2206
+ "exclusive": [
2207
+ "echo",
2208
+ "to-script"
2209
+ ]
2210
+ },
2211
+ "echo": {
2212
+ "name": "echo",
2213
+ "type": "boolean",
2214
+ "description": "Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.",
2215
+ "allowNo": false,
2216
+ "exclusive": [
2217
+ "to-script",
2218
+ "silent"
2219
+ ]
2220
+ },
2221
+ "to-script": {
2222
+ "name": "to-script",
2223
+ "type": "boolean",
2224
+ "description": "Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.",
2225
+ "allowNo": false,
2226
+ "exclusive": [
2227
+ "echo",
2228
+ "silent"
2229
+ ]
2230
+ },
2231
+ "take-defaults": {
2232
+ "name": "take-defaults",
2233
+ "type": "boolean",
2234
+ "description": "Setting this to true prevents prompting for confirmation on parameters that were passed in or were automatically set to default values (Irrelevant in --silent mode).",
2235
+ "allowNo": false,
2236
+ "exclusive": [
2237
+ "silent"
2238
+ ]
2175
2239
  }
2176
2240
  },
2177
2241
  "args": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codiac.io/codiac-cli",
3
3
  "description": "Local command line interface for managing enterprise assets and environments.",
4
- "version": "1.3.36",
4
+ "version": "1.3.38",
5
5
  "author": "Codiac",
6
6
  "bin": {
7
7
  "codiac": "./bin/run",