nia-wizard 0.1.22 → 0.1.24

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
@@ -24,6 +24,8 @@ This will:
24
24
  npx nia-wizard
25
25
  ```
26
26
 
27
+ Press Enter to continue with the recommended default setup, which signs you in and installs `nia-cli`, or use the arrow keys to choose advanced or manual setup.
28
+
27
29
  ### With API Key
28
30
 
29
31
  ```bash
package/dist/bin.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  runWizard,
9
9
  shutdown,
10
10
  track
11
- } from "./chunk-MXNHQSRW.js";
11
+ } from "./chunk-IWMEVHHX.js";
12
12
 
13
13
  // src/bin.ts
14
14
  import yargs from "yargs";
@@ -9,7 +9,7 @@ var require_package = __commonJS({
9
9
  "package.json"(exports, module) {
10
10
  module.exports = {
11
11
  name: "nia-wizard",
12
- version: "0.1.22",
12
+ version: "0.1.24",
13
13
  description: "CLI wizard to install Nia to your coding agents",
14
14
  type: "module",
15
15
  main: "dist/index.js",
@@ -417,8 +417,35 @@ function printWelcome() {
417
417
  "This wizard installs Nia for your coding agents.\nGet external docs, code search, and research tools inside your agent."
418
418
  );
419
419
  }
420
- async function getApiKey(providedKey) {
420
+ async function askWizardStartMode() {
421
+ console.log("");
422
+ return await abortIfCancelled(
423
+ clack_default.select({
424
+ message: "Continue with:",
425
+ options: [
426
+ {
427
+ value: "default",
428
+ label: "Default setup (recommended)",
429
+ hint: "Browser sign-in + install nia-cli automatically"
430
+ },
431
+ {
432
+ value: "advanced",
433
+ label: "Advanced setup",
434
+ hint: "Choose install method and options"
435
+ },
436
+ {
437
+ value: "manual",
438
+ label: "Manual setup",
439
+ hint: "View config and set it up yourself"
440
+ }
441
+ ],
442
+ initialValue: "default"
443
+ })
444
+ );
445
+ }
446
+ async function getApiKey(providedKey, options = {}) {
421
447
  const authStartTime = Date.now();
448
+ const defaultMethod = options.defaultMethod ?? "prompt";
422
449
  if (providedKey && providedKey.startsWith("nk_")) {
423
450
  clack_default.log.success("Using provided API key");
424
451
  track("cli_auth_completed", { auth_method: "provided", duration_ms: 0 });
@@ -428,7 +455,7 @@ async function getApiKey(providedKey) {
428
455
  clack_default.log.warn(`Invalid API key format. Keys should start with 'nk_'`);
429
456
  }
430
457
  clack_default.log.info("You need a Nia API key to continue.");
431
- const authMethod = await abortIfCancelled(
458
+ const authMethod = defaultMethod === "prompt" ? await abortIfCancelled(
432
459
  clack_default.select({
433
460
  message: "How would you like to authenticate?",
434
461
  options: [
@@ -445,7 +472,7 @@ async function getApiKey(providedKey) {
445
472
  ],
446
473
  initialValue: "browser"
447
474
  })
448
- );
475
+ ) : defaultMethod;
449
476
  track("cli_auth_method_selected", { auth_method: authMethod });
450
477
  let apiKey;
451
478
  if (authMethod === "browser") {
@@ -3505,14 +3532,15 @@ async function runWizard(options) {
3505
3532
  const startTime = Date.now();
3506
3533
  track("cli_wizard_started", { entry_command: "wizard" });
3507
3534
  printWelcome();
3508
- const action = await abortIfCancelled(
3535
+ const entryMode = options.ci ? "default" : await askWizardStartMode();
3536
+ const action = entryMode === "advanced" ? await abortIfCancelled(
3509
3537
  clack_default.select({
3510
3538
  message: "Choose how to install Nia:",
3511
3539
  options: [
3512
3540
  {
3513
3541
  value: "nia-cli",
3514
- label: "Install Nia CLI (recommended)",
3515
- hint: "Preferred path: installs nia CLI + skill"
3542
+ label: "Install Nia CLI",
3543
+ hint: "Installs nia CLI + launches Nia skill setup"
3516
3544
  },
3517
3545
  {
3518
3546
  value: "skills",
@@ -3537,7 +3565,7 @@ async function runWizard(options) {
3537
3565
  ],
3538
3566
  initialValue: "nia-cli"
3539
3567
  })
3540
- );
3568
+ ) : entryMode === "manual" ? "manual" : "nia-cli";
3541
3569
  track("cli_install_method_selected", { install_method: action });
3542
3570
  if (action === "manual") {
3543
3571
  await runManualMode();
@@ -3545,7 +3573,9 @@ async function runWizard(options) {
3545
3573
  await shutdown();
3546
3574
  return;
3547
3575
  }
3548
- const apiKey = await getApiKey(options.apiKey);
3576
+ const apiKey = await getApiKey(options.apiKey, {
3577
+ defaultMethod: entryMode === "default" ? "browser" : "prompt"
3578
+ });
3549
3579
  storeApiKey(apiKey);
3550
3580
  clack_default.log.success("API key saved");
3551
3581
  let installedAddMcp = false;
@@ -3738,7 +3768,7 @@ async function runSkillAdd(options) {
3738
3768
  const nonInteractive = Boolean(options.nonInteractive || options.ci);
3739
3769
  const source = options.source || DEFAULT_SKILL_SOURCE;
3740
3770
  const allAgents = Boolean(options.allAgents);
3741
- if (!options.json) {
3771
+ if (!options.json && !options.embedded) {
3742
3772
  clack_default.intro(chalk5.bgCyan.black(" Nia Skill Installer "));
3743
3773
  }
3744
3774
  if (allAgents && options.target) {
@@ -3796,7 +3826,9 @@ async function runSkillAdd(options) {
3796
3826
  }
3797
3827
  if (!options.json) {
3798
3828
  clack_default.log.success("Nia skill installed!");
3799
- clack_default.outro(chalk5.green("Done!"));
3829
+ if (!options.embedded) {
3830
+ clack_default.outro(chalk5.green("Done!"));
3831
+ }
3800
3832
  }
3801
3833
  }
3802
3834
  function detectSkillsCapabilities() {
@@ -4040,4 +4072,4 @@ export {
4040
4072
  runSkillAdd,
4041
4073
  printAgentGuide
4042
4074
  };
4043
- //# sourceMappingURL=chunk-MXNHQSRW.js.map
4075
+ //# sourceMappingURL=chunk-IWMEVHHX.js.map