@useorgx/wizard 0.1.4 → 0.1.6

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
@@ -8,7 +8,7 @@ import pc3 from "picocolors";
8
8
 
9
9
  // src/banner.ts
10
10
  import pc from "picocolors";
11
- function renderBanner() {
11
+ function renderBanner(version) {
12
12
  const lines = [
13
13
  " ____ ____ _______ __",
14
14
  " / __ \\/ __ \\ / ____/ |/ /",
@@ -16,7 +16,9 @@ function renderBanner() {
16
16
  "/ /_/ / _, _// /_/ // | ",
17
17
  "\\____/_/ |_| \\____//_/|_| "
18
18
  ];
19
- return lines.map((line) => pc.cyan(line)).join("\n");
19
+ const art = lines.map((line) => pc.cyan(line)).join("\n");
20
+ const tag = version ? ` ${pc.dim(`v${version}`)}` : "";
21
+ return `${art}${tag}`;
20
22
  }
21
23
 
22
24
  // src/constants.ts
@@ -3077,6 +3079,10 @@ var ICON = {
3077
3079
  warn: pc3.yellow("!"),
3078
3080
  skip: pc3.dim("\xB7")
3079
3081
  };
3082
+ function getCmd() {
3083
+ const argv1 = process.argv[1] ?? "";
3084
+ return argv1.includes("_npx") || argv1.includes("/.npm/") || argv1.includes("/npm/_npx") ? "npx @useorgx/wizard" : "orgx-wizard";
3085
+ }
3080
3086
  function formatAuthSource(source) {
3081
3087
  switch (source) {
3082
3088
  case "environment":
@@ -3224,7 +3230,7 @@ function parseTimeoutSeconds(value) {
3224
3230
  }
3225
3231
  function printAuthStatus(status) {
3226
3232
  if (!status.configured) {
3227
- console.log(` ${ICON.warn} ${pc3.yellow("no account")} run ${pc3.cyan("orgx-wizard auth login")} to connect`);
3233
+ console.log(` ${ICON.warn} ${pc3.yellow("no account")} run ${pc3.cyan(`${getCmd()} auth login`)} to connect`);
3228
3234
  return;
3229
3235
  }
3230
3236
  const icon = status.ok ? ICON.ok : ICON.err;
@@ -3279,7 +3285,7 @@ function printDoctorReport(report, assessment) {
3279
3285
  console.log(` ${ICON.ok} ${pc3.green("All systems ready.")}`);
3280
3286
  if (!report.auth.configured) {
3281
3287
  console.log(`
3282
- ${pc3.dim("\u2192")} ${pc3.cyan("orgx-wizard auth login")} ${pc3.dim("to connect your account")}`);
3288
+ ${pc3.dim("\u2192")} ${pc3.cyan(`${getCmd()} auth login`)} ${pc3.dim("to connect your account")}`);
3283
3289
  } else {
3284
3290
  console.log(` ${pc3.dim("\u2192")} ${pc3.dim(`OrgX is active across ${configuredCount} editor${configuredCount !== 1 ? "s" : ""}`)}`);
3285
3291
  }
@@ -3298,8 +3304,10 @@ function printDoctorReport(report, assessment) {
3298
3304
  async function main() {
3299
3305
  const program = new Command();
3300
3306
  program.name("orgx-wizard").description("One-line CLI onboarding for OrgX surfaces.").showHelpAfterError();
3307
+ const pkgVersion = true ? "0.1.6" : void 0;
3308
+ program.version(pkgVersion ?? "unknown", "-V, --version");
3301
3309
  program.hook("preAction", () => {
3302
- console.log(renderBanner());
3310
+ console.log(renderBanner(pkgVersion));
3303
3311
  });
3304
3312
  program.command("setup").description("Patch all detected automated OrgX surfaces.").option("--preset <name>", "run a setup bundle (currently: founder)").action(async (options) => {
3305
3313
  if (options.preset) {
@@ -3352,7 +3360,7 @@ async function main() {
3352
3360
  message: "Connect your OrgX account to enable workspace and AI tool access",
3353
3361
  options: [
3354
3362
  { value: "login", label: "Open browser to connect", hint: "recommended" },
3355
- { value: "skip", label: "Skip for now", hint: "run `orgx-wizard auth login` later" }
3363
+ { value: "skip", label: "Skip for now", hint: `run \`${getCmd()} auth login\` later` }
3356
3364
  ]
3357
3365
  });
3358
3366
  if (clack.isCancel(choice)) {
@@ -3363,19 +3371,19 @@ async function main() {
3363
3371
  const loginOk = await runBrowserLogin();
3364
3372
  if (!loginOk) {
3365
3373
  console.log(`
3366
- ${pc3.dim("\u2192")} ${pc3.cyan("orgx-wizard auth login")} ${pc3.dim("to try again")}`);
3367
- console.log(` ${pc3.dim("\u2192")} ${pc3.cyan("orgx-wizard auth login --api-key")} ${pc3.dim("to paste a key directly")}`);
3374
+ ${pc3.dim("\u2192")} ${pc3.cyan(`${getCmd()} auth login`)} ${pc3.dim("to try again")}`);
3375
+ console.log(` ${pc3.dim("\u2192")} ${pc3.cyan(`${getCmd()} auth login --api-key`)} ${pc3.dim("to paste a key directly")}`);
3368
3376
  return;
3369
3377
  }
3370
3378
  resolvedAuth = await resolveOrgxAuth();
3371
3379
  } else {
3372
3380
  console.log(`
3373
- ${pc3.dim("\u2192")} ${pc3.cyan("orgx-wizard auth login")} ${pc3.dim("to connect when ready")}`);
3381
+ ${pc3.dim("\u2192")} ${pc3.cyan(`${getCmd()} auth login`)} ${pc3.dim("to connect when ready")}`);
3374
3382
  return;
3375
3383
  }
3376
3384
  } else {
3377
3385
  console.log(
3378
- ` ${ICON.warn} ${pc3.yellow("No account connected.")} Run ${pc3.cyan("orgx-wizard auth login")} to connect.`
3386
+ ` ${ICON.warn} ${pc3.yellow("No account connected.")} Run ${pc3.cyan(`${getCmd()} auth login`)} to connect.`
3379
3387
  );
3380
3388
  return;
3381
3389
  }
@@ -3455,8 +3463,9 @@ async function main() {
3455
3463
  ...opts.baseUrl !== void 0 ? { baseUrl: opts.baseUrl } : {}
3456
3464
  });
3457
3465
  if (!("stored" in result)) {
3458
- spinner.fail("API key invalid");
3459
- printAuthStatus(result.verification);
3466
+ spinner.fail("Pairing completed but key was rejected");
3467
+ console.log(` ${pc3.red(result.verification.error ?? `HTTP ${result.verification.status ?? "error"}`)}`);
3468
+ console.log(` ${pc3.dim("The browser flow finished, but OrgX rejected the key. Try again or check your account at useorgx.com.")}`);
3460
3469
  return false;
3461
3470
  }
3462
3471
  await acknowledgeBrowserPairing({