olakai-cli 0.6.0 → 0.6.1

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/index.js CHANGED
@@ -3516,6 +3516,39 @@ async function runMonitorInstall(toolId, opts = {}) {
3516
3516
  });
3517
3517
  }
3518
3518
 
3519
+ // src/lib/branding.ts
3520
+ var RESET = "\x1B[0m";
3521
+ var CYAN = "\x1B[36m";
3522
+ var DIM = "\x1B[2m";
3523
+ function colorize(text, color) {
3524
+ if (process.env.NO_COLOR) return text;
3525
+ if (!process.stdout.isTTY) return text;
3526
+ return `${color}${text}${RESET}`;
3527
+ }
3528
+ function printLogoHeader() {
3529
+ if (!process.stdout.isTTY) return;
3530
+ const mark = colorize("\u25C9", CYAN);
3531
+ const tagline = colorize("Enterprise AI observability", DIM);
3532
+ console.log("");
3533
+ console.log(` ${mark} olakai`);
3534
+ console.log(` ${tagline}`);
3535
+ console.log(` \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
3536
+ console.log("");
3537
+ }
3538
+ function formatExistingUserBrowserGreeting(email) {
3539
+ return [
3540
+ ` \u2713 Found your Olakai account \u2014 ${email}`,
3541
+ ``,
3542
+ ` Since you have login access to an Olakai workspace, we'll route`,
3543
+ ` you through your account's standard sign-in. Admin and analyst`,
3544
+ ` users authenticate the CLI through the browser, matching how`,
3545
+ ` they sign in to the web app.`,
3546
+ ``,
3547
+ ` Employee-role developers skip this step and self-onboard with`,
3548
+ ` a one-time email code \u2014 no browser, no SSO prompt.`
3549
+ ].join("\n");
3550
+ }
3551
+
3519
3552
  // src/commands/init.ts
3520
3553
  var EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
3521
3554
  var OTP_REGEX = /^\d{6}$/;
@@ -3525,6 +3558,9 @@ var PRESET_HOSTS = [
3525
3558
  ];
3526
3559
  async function initCommand(options) {
3527
3560
  const interactive = !options.nonInteractive && isInteractive();
3561
+ if (interactive) {
3562
+ printLogoHeader();
3563
+ }
3528
3564
  try {
3529
3565
  const resolved = resolveProfileName();
3530
3566
  const profileName = resolved?.name ?? "default";
@@ -3564,7 +3600,14 @@ Contacting ${host} for ${email}...`);
3564
3600
  switch (response.status) {
3565
3601
  case "user_exists":
3566
3602
  if ("deviceFlowOk" in response && response.deviceFlowOk === true) {
3567
- console.log("Welcome back! Opening browser for device-flow auth...\n");
3603
+ console.log("");
3604
+ console.log(formatExistingUserBrowserGreeting(email));
3605
+ if (interactive) {
3606
+ await promptUser(
3607
+ "\n > Press Enter to open your browser, or Ctrl-C to cancel: "
3608
+ );
3609
+ }
3610
+ console.log("");
3568
3611
  await loginCommand();
3569
3612
  await offerMonitorSetup(options, interactive);
3570
3613
  return;