@botim/botim-cli 0.0.2 → 0.0.4

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/dist/cli.js CHANGED
@@ -9,13 +9,13 @@ import { setRuntimeEnvironment, parseEnvironment, getEnvironmentDisplayName } fr
9
9
  import chalk from "chalk";
10
10
  import fs from "fs-extra";
11
11
  import path from "path";
12
- const version = "0.0.2";
12
+ const version = "0.0.4";
13
13
  const program = new Command();
14
- program.name("botim-cli").description("CLI tool to generate boilerplate code for React and Vue applications").version(version, "-v, --version", "Output the current version").option("--env <environment>", "Target environment: prod or beta (overrides default)", (value) => {
14
+ program.name("botim-cli").description("CLI tool to generate boilerplate code for React and Vue applications").version(version, "-v, --version", "Output the current version").option("--env <environment>", "Target environment: prod or uat (overrides default)", (value) => {
15
15
  const env = parseEnvironment(value);
16
16
  if (!env) {
17
17
  console.error(chalk.red(`
18
- Invalid environment: ${value}. Valid values: prod, beta
18
+ Invalid environment: ${value}. Valid values: prod, uat
19
19
  `));
20
20
  process.exit(1);
21
21
  }
@@ -64,7 +64,7 @@ program.command("quick-start").description("Show quick start guide").alias("qs")
64
64
  program.command("login").description("Login via QR code and save authentication token").action(async () => {
65
65
  const currentEnv = await getCurrentEnvironment();
66
66
  const envDisplay = getEnvironmentDisplayName(currentEnv);
67
- const envColor = currentEnv === "beta" ? chalk.yellow : chalk.green;
67
+ const envColor = currentEnv === "production" ? chalk.green : chalk.yellow;
68
68
  console.log(chalk.cyan.bold(`
69
69
  \u{1F510} Botim CLI v${version} - Login ${envColor(`[${envDisplay}]`)}
70
70
  `));
@@ -73,7 +73,7 @@ program.command("login").description("Login via QR code and save authentication
73
73
  program.command("logout").description("Logout and clear saved authentication token").option("--all", "Clear credentials for all environments").action(async (options) => {
74
74
  const currentEnv = await getCurrentEnvironment();
75
75
  const envDisplay = getEnvironmentDisplayName(currentEnv);
76
- const envColor = currentEnv === "beta" ? chalk.yellow : chalk.green;
76
+ const envColor = currentEnv === "production" ? chalk.green : chalk.yellow;
77
77
  console.log(chalk.cyan.bold(`
78
78
  \u{1F6AA} Botim CLI v${version} - Logout ${envColor(`[${envDisplay}]`)}
79
79
  `));
@@ -98,20 +98,20 @@ program.command("status").description("Show login status for all environments").
98
98
  console.log(chalk.gray(" Not logged in"));
99
99
  }
100
100
  console.log("");
101
- const betaStatus = allStatus.beta;
102
- const betaIndicator = betaStatus.loggedIn ? chalk.green("\u2713") : chalk.red("\u2717");
103
- const betaActive = currentEnv === "beta" ? chalk.cyan(" (active)") : "";
104
- console.log(` ${betaIndicator} Beta${betaActive}`);
105
- if (betaStatus.loggedIn && betaStatus.partnerName) {
106
- console.log(chalk.gray(` Partner: ${betaStatus.partnerName}`));
107
- } else if (!betaStatus.loggedIn) {
101
+ const uatStatus = allStatus.uat;
102
+ const uatIndicator = uatStatus.loggedIn ? chalk.green("\u2713") : chalk.red("\u2717");
103
+ const uatActive = currentEnv === "uat" ? chalk.cyan(" (active)") : "";
104
+ console.log(` ${uatIndicator} UAT${uatActive}`);
105
+ if (uatStatus.loggedIn && uatStatus.partnerName) {
106
+ console.log(chalk.gray(` Partner: ${uatStatus.partnerName}`));
107
+ } else if (!uatStatus.loggedIn) {
108
108
  console.log(chalk.gray(" Not logged in"));
109
109
  }
110
110
  console.log("");
111
111
  console.log(chalk.gray("Tips:"));
112
- console.log(chalk.gray(" Switch environment: botim-cli config set env beta"));
113
- console.log(chalk.gray(" One-time override: botim-cli --env beta <command>"));
114
- console.log(chalk.gray(" Login to beta: botim-cli --env beta login\n"));
112
+ console.log(chalk.gray(" Switch environment: botim-cli config set env uat"));
113
+ console.log(chalk.gray(" One-time override: botim-cli --env uat <command>"));
114
+ console.log(chalk.gray(" Login to uat: botim-cli --env uat login\n"));
115
115
  });
116
116
  program.command("auth").description("Access authenticated commands (requires login)").alias("authenticated").action(async () => {
117
117
  await showMenuOrRequireAuth();
@@ -150,8 +150,8 @@ Examples:
150
150
  --audience 1 \\
151
151
  --reviewNote "Internal testing app"
152
152
 
153
- Use beta environment:
154
- $ botim-cli --env beta create-mp-app --projectName my-beta-app
153
+ Use UAT environment:
154
+ $ botim-cli --env uat create-mp-app --projectName my-uat-app
155
155
 
156
156
  Creator Types:
157
157
  hybrid - Fastest, local resources with full platform capabilities (default)
@@ -171,7 +171,7 @@ Audience Options:
171
171
  const currentEnv = await getCurrentEnvironment();
172
172
  const envDisplay = getEnvironmentDisplayName(currentEnv);
173
173
  console.log(chalk.red(`
174
- \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "beta" ? "--env beta " : ""}login
174
+ \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "uat" ? "--env uat " : ""}login
175
175
  `));
176
176
  process.exit(1);
177
177
  }
@@ -191,7 +191,7 @@ program.command("init-mp-app").description("Initialize MP app in current directo
191
191
  const currentEnv = await getCurrentEnvironment();
192
192
  const envDisplay = getEnvironmentDisplayName(currentEnv);
193
193
  console.log(chalk.red(`
194
- \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "beta" ? "--env beta " : ""}login
194
+ \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "uat" ? "--env uat " : ""}login
195
195
  `));
196
196
  process.exit(1);
197
197
  }
@@ -207,7 +207,7 @@ program.command("deploy-mp-app").description("Deploy MP app to server (requires
207
207
  const currentEnv = await getCurrentEnvironment();
208
208
  const envDisplay = getEnvironmentDisplayName(currentEnv);
209
209
  console.log(chalk.red(`
210
- \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "beta" ? "--env beta " : ""}login
210
+ \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "uat" ? "--env uat " : ""}login
211
211
  `));
212
212
  process.exit(1);
213
213
  }
@@ -223,7 +223,7 @@ program.command("debug-mp-app").description("Debug MP app (requires authenticati
223
223
  const currentEnv = await getCurrentEnvironment();
224
224
  const envDisplay = getEnvironmentDisplayName(currentEnv);
225
225
  console.log(chalk.red(`
226
- \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "beta" ? "--env beta " : ""}login
226
+ \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "uat" ? "--env uat " : ""}login
227
227
  `));
228
228
  process.exit(1);
229
229
  }
@@ -239,7 +239,7 @@ program.command("list-mp-permissions [app-id]").description("List permissions fo
239
239
  const currentEnv = await getCurrentEnvironment();
240
240
  const envDisplay = getEnvironmentDisplayName(currentEnv);
241
241
  console.log(chalk.red(`
242
- \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "beta" ? "--env beta " : ""}login
242
+ \u274C Authentication required for ${envDisplay}. Please login first using: botim-cli ${currentEnv === "uat" ? "--env uat " : ""}login
243
243
  `));
244
244
  process.exit(1);
245
245
  }
@@ -259,7 +259,7 @@ configCommand.command("set <key> <value>").description("Set a configuration valu
259
259
  if (!env) {
260
260
  console.log(chalk.red(`\u274C Invalid environment: ${value}
261
261
  `));
262
- console.log(chalk.yellow("Valid values: prod, production, beta\n"));
262
+ console.log(chalk.yellow("Valid values: prod, production, uat\n"));
263
263
  process.exit(1);
264
264
  }
265
265
  await setCurrentEnvironment(env);
@@ -288,7 +288,7 @@ configCommand.command("set <key> <value>").description("Set a configuration valu
288
288
  console.log(chalk.red(`\u274C Unknown configuration key: ${key}
289
289
  `));
290
290
  console.log(chalk.yellow("Available keys:\n"));
291
- console.log(chalk.yellow(" - env (or environment): Set default environment (prod, beta)\n"));
291
+ console.log(chalk.yellow(" - env (or environment): Set default environment (prod, uat)\n"));
292
292
  console.log(chalk.yellow("\nNote: Template repository URLs are configured via .env file, not CLI commands.\n"));
293
293
  process.exit(1);
294
294
  }
@@ -464,7 +464,7 @@ async function showMainMenu() {
464
464
  try {
465
465
  const currentEnv = await getCurrentEnvironment();
466
466
  const envDisplay = getEnvironmentDisplayName(currentEnv);
467
- const envColor = currentEnv === "beta" ? chalk.yellow : chalk.green;
467
+ const envColor = currentEnv === "production" ? chalk.green : chalk.yellow;
468
468
  console.log(chalk.cyan.bold("\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
469
469
  console.log(chalk.cyan.bold("\u2551 \u{1F680} Botim CLI Generator \u2551"));
470
470
  console.log(chalk.cyan.bold(`\u2551 v${version.padEnd(32)}\u2551`));
@@ -575,8 +575,8 @@ async function showMainMenu() {
575
575
  value: "production"
576
576
  },
577
577
  {
578
- name: `Beta ${allStatus.beta.loggedIn ? chalk.green("\u2713 Logged in") : chalk.gray("(not logged in)")}${currentEnv === "beta" ? chalk.cyan(" \u2190 current") : ""}`,
579
- value: "beta"
578
+ name: `UAT ${allStatus.uat.loggedIn ? chalk.green("\u2713 Logged in") : chalk.gray("(not logged in)")}${currentEnv === "uat" ? chalk.cyan(" \u2190 current") : ""}`,
579
+ value: "uat"
580
580
  },
581
581
  new inquirer.Separator(),
582
582
  { name: "\u2190 Back to main menu", value: "back" }
@@ -612,12 +612,12 @@ async function showMainMenu() {
612
612
  if (prodStatus.loggedIn && prodStatus.partnerName) {
613
613
  console.log(chalk.gray(` Partner: ${prodStatus.partnerName}`));
614
614
  }
615
- const betaStatus = allStatus.beta;
616
- const betaIndicator = betaStatus.loggedIn ? chalk.green("\u2713") : chalk.red("\u2717");
617
- const betaActive = currentEnv === "beta" ? chalk.cyan(" (active)") : "";
618
- console.log(` ${betaIndicator} Beta${betaActive}`);
619
- if (betaStatus.loggedIn && betaStatus.partnerName) {
620
- console.log(chalk.gray(` Partner: ${betaStatus.partnerName}`));
615
+ const uatStatus = allStatus.uat;
616
+ const uatIndicator = uatStatus.loggedIn ? chalk.green("\u2713") : chalk.red("\u2717");
617
+ const uatActive = currentEnv === "uat" ? chalk.cyan(" (active)") : "";
618
+ console.log(` ${uatIndicator} UAT${uatActive}`);
619
+ if (uatStatus.loggedIn && uatStatus.partnerName) {
620
+ console.log(chalk.gray(` Partner: ${uatStatus.partnerName}`));
621
621
  }
622
622
  console.log("");
623
623
  await showMainMenu();