nia-wizard 0.1.16 → 0.1.17

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
@@ -11,6 +11,7 @@ curl -fsSL https://app.trynia.ai/cli | sh
11
11
  ```
12
12
 
13
13
  This will:
14
+
14
15
  1. Install Node.js if needed
15
16
  2. Run the wizard which:
16
17
  - Opens your browser for authentication
@@ -63,7 +64,10 @@ npx nia-wizard
63
64
  # Then select "Install Nia Skill"
64
65
  ```
65
66
 
66
- This runs `npx skills add nozomio-labs/nia-skill` and stores your API key at `~/.config/nia/api_key`.
67
+ The wizard stores your API key at `~/.config/nia/api_key`.
68
+
69
+ - Select `Install Nia Skill` to use the existing `skills` CLI flow.
70
+ - Select `Install Nia CLI` to auto-install `nia-cli`, run `nia auth login --api-key ...`, and then run `nia skill`.
67
71
 
68
72
  For deterministic agent/CI usage:
69
73
 
@@ -103,19 +107,19 @@ npx nia-wizard agent-guide
103
107
 
104
108
  ## Options
105
109
 
106
- | Option | Description |
107
- |--------|-------------|
108
- | `--local` | Use local mode (runs on your machine, requires pipx) |
109
- | `--remote` | Use remote mode (connects to Nia cloud) |
110
- | `--debug` | Enable debug logging |
111
- | `--ci` | CI mode (skip prompts, use defaults) |
112
- | `--api-key`, `-k` | Nia API key |
113
- | `--non-interactive` | Fail fast instead of waiting for prompts (skill command) |
114
- | `--target` | Target coding agent for skill installation (skill command) |
115
- | `--all-agents` | Install to all detected agents in global scope (skill command) |
116
- | `--global` | Install to global user skills directories (skill command) |
117
- | `--source` | Skill source path/repo (skill command) |
118
- | `--json` | Print machine-readable result (skill command) |
110
+ | Option | Description |
111
+ | ------------------- | -------------------------------------------------------------- |
112
+ | `--local` | Use local mode (runs on your machine, requires pipx) |
113
+ | `--remote` | Use remote mode (connects to Nia cloud) |
114
+ | `--debug` | Enable debug logging |
115
+ | `--ci` | CI mode (skip prompts, use defaults) |
116
+ | `--api-key`, `-k` | Nia API key |
117
+ | `--non-interactive` | Fail fast instead of waiting for prompts (skill command) |
118
+ | `--target` | Target coding agent for skill installation (skill command) |
119
+ | `--all-agents` | Install to all detected agents in global scope (skill command) |
120
+ | `--global` | Install to global user skills directories (skill command) |
121
+ | `--source` | Skill source path/repo (skill command) |
122
+ | `--json` | Print machine-readable result (skill command) |
119
123
 
120
124
  ## Authentication
121
125
 
@@ -135,6 +139,7 @@ This is the fastest way to get started - no manual copying required!
135
139
  ### 2. Manual API Key Entry
136
140
 
137
141
  If you prefer, you can:
142
+
138
143
  - Get your API key from [app.trynia.ai](https://app.trynia.ai)
139
144
  - Pass it directly: `npx @nia/wizard nk_xxx`
140
145
  - Or select "Enter API key manually" when prompted
@@ -143,51 +148,51 @@ If you prefer, you can:
143
148
 
144
149
  ### Full Support (Local + Remote)
145
150
 
146
- | Agent | Config Location |
147
- |-------|-----------------|
148
- | Cursor | `~/.cursor/mcp.json` |
149
- | VS Code | `~/.vscode/mcp.json` |
150
- | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
151
- | Cline | `~/.cline/mcp_settings.json` |
152
- | Continue | `~/.continue/config.json` |
153
- | Antigravity | `~/.gemini/antigravity/mcp_config.json` |
154
- | Trae | `~/Library/Application Support/Trae/User/mcp.json` |
155
- | Roo Code | `~/.roo-code/mcp.json` |
156
- | Kilo Code | `~/.kilocode/mcp.json` |
157
- | Gemini CLI | `~/.gemini/settings.json` |
158
- | OpenCode | `~/.opencode/config.json` |
159
- | Qodo Gen | `~/.qodo/mcp.json` |
160
- | Qwen Coder | `~/.qwen/settings.json` |
161
- | Visual Studio | `~/.vs/mcp.json` |
162
- | Crush | `~/.crush/config.json` |
163
- | Copilot Agent | `.github/copilot-mcp.json` (per-repo) |
164
- | Copilot CLI | `~/.copilot/mcp-config.json` |
165
- | Factory | CLI: `droid mcp add` |
151
+ | Agent | Config Location |
152
+ | ------------- | -------------------------------------------------- |
153
+ | Cursor | `~/.cursor/mcp.json` |
154
+ | VS Code | `~/.vscode/mcp.json` |
155
+ | Windsurf | `~/.codeium/windsurf/mcp_config.json` |
156
+ | Cline | `~/.cline/mcp_settings.json` |
157
+ | Continue | `~/.continue/config.json` |
158
+ | Antigravity | `~/.gemini/antigravity/mcp_config.json` |
159
+ | Trae | `~/Library/Application Support/Trae/User/mcp.json` |
160
+ | Roo Code | `~/.roo-code/mcp.json` |
161
+ | Kilo Code | `~/.kilocode/mcp.json` |
162
+ | Gemini CLI | `~/.gemini/settings.json` |
163
+ | OpenCode | `~/.opencode/config.json` |
164
+ | Qodo Gen | `~/.qodo/mcp.json` |
165
+ | Qwen Coder | `~/.qwen/settings.json` |
166
+ | Visual Studio | `~/.vs/mcp.json` |
167
+ | Crush | `~/.crush/config.json` |
168
+ | Copilot Agent | `.github/copilot-mcp.json` (per-repo) |
169
+ | Copilot CLI | `~/.copilot/mcp-config.json` |
170
+ | Factory | CLI: `droid mcp add` |
166
171
 
167
172
  ### Remote Only
168
173
 
169
- | Agent | Notes |
170
- |-------|-------|
171
- | Claude Code | CLI: `claude mcp add` |
172
- | Amp | CLI: `amp mcp add` |
173
- | Vibe | TOML config at `~/.vibe/config.toml` |
174
+ | Agent | Notes |
175
+ | ----------- | ------------------------------------ |
176
+ | Claude Code | CLI: `claude mcp add` |
177
+ | Amp | CLI: `amp mcp add` |
178
+ | Vibe | TOML config at `~/.vibe/config.toml` |
174
179
 
175
180
  ### Local Only
176
181
 
177
- | Agent | Config Location |
178
- |-------|-----------------|
182
+ | Agent | Config Location |
183
+ | -------------- | ----------------------------------------------------------------- |
179
184
  | Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
180
- | Codex CLI | CLI: `codex mcp add` |
181
- | Codex App | `~/.codex/config.toml` |
182
- | Zed | `~/.config/zed/settings.json` |
183
- | Augment | VS Code settings |
184
- | JetBrains | `~/.jetbrains/mcp.json` |
185
- | Kiro | `~/.kiro/mcp.json` |
186
- | LM Studio | `~/.lmstudio/mcp.json` |
187
- | Bolt AI | `~/Library/Application Support/BoltAI/mcp.json` |
188
- | Perplexity | `~/Library/Application Support/Perplexity/mcp.json` |
189
- | Warp | `~/.warp/mcp.json` |
190
- | Amazon Q | `~/.aws/amazonq/mcp.json` |
185
+ | Codex CLI | CLI: `codex mcp add` |
186
+ | Codex App | `~/.codex/config.toml` |
187
+ | Zed | `~/.config/zed/settings.json` |
188
+ | Augment | VS Code settings |
189
+ | JetBrains | `~/.jetbrains/mcp.json` |
190
+ | Kiro | `~/.kiro/mcp.json` |
191
+ | LM Studio | `~/.lmstudio/mcp.json` |
192
+ | Bolt AI | `~/Library/Application Support/BoltAI/mcp.json` |
193
+ | Perplexity | `~/Library/Application Support/Perplexity/mcp.json` |
194
+ | Warp | `~/.warp/mcp.json` |
195
+ | Amazon Q | `~/.aws/amazonq/mcp.json` |
191
196
 
192
197
  ### Manual Setup Required
193
198
 
package/dist/bin.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  runMCPRemove,
7
7
  runSkillAdd,
8
8
  runWizard
9
- } from "./chunk-JKF3ZFD5.js";
9
+ } from "./chunk-XF23S5X2.js";
10
10
 
11
11
  // src/bin.ts
12
12
  import yargs from "yargs";
@@ -2931,7 +2931,7 @@ async function removeMCPServerFromClientsStep() {
2931
2931
 
2932
2932
  // src/run.ts
2933
2933
  import chalk3 from "chalk";
2934
- import { spawnSync as spawnSync5 } from "child_process";
2934
+ import { spawnSync as spawnSync6 } from "child_process";
2935
2935
 
2936
2936
  // src/utils/dependencies.ts
2937
2937
  import { execSync as execSync5, spawnSync as spawnSync4 } from "child_process";
@@ -3147,10 +3147,99 @@ function storeApiKey(apiKey) {
3147
3147
  fs33.writeFileSync(NIA_KEY_PATH, apiKey, { mode: 384 });
3148
3148
  }
3149
3149
 
3150
+ // src/utils/nia-cli.ts
3151
+ import { spawnSync as spawnSync5 } from "child_process";
3152
+ var NIA_CLI_PACKAGE = "nia-cli";
3153
+ function npmCommand() {
3154
+ return process.platform === "win32" ? "npm.cmd" : "npm";
3155
+ }
3156
+ function npxCommand() {
3157
+ return process.platform === "win32" ? "npx.cmd" : "npx";
3158
+ }
3159
+ function niaCommand() {
3160
+ return process.platform === "win32" ? "nia.cmd" : "nia";
3161
+ }
3162
+ function isNiaCliInstalled() {
3163
+ const result = spawnSync5(niaCommand(), ["--version"], {
3164
+ stdio: "pipe",
3165
+ encoding: "utf-8",
3166
+ shell: false
3167
+ });
3168
+ debug("nia --version status", result.status);
3169
+ return result.status === 0;
3170
+ }
3171
+ function ensureNiaCliInstalled() {
3172
+ if (isNiaCliInstalled()) {
3173
+ return true;
3174
+ }
3175
+ clack_default.log.info("Installing nia-cli globally with npm...");
3176
+ const installSpinner = clack_default.spinner();
3177
+ installSpinner.start("Installing nia-cli...");
3178
+ const installResult = spawnSync5(npmCommand(), ["install", "-g", NIA_CLI_PACKAGE], {
3179
+ stdio: "pipe",
3180
+ encoding: "utf-8",
3181
+ shell: false
3182
+ });
3183
+ if (installResult.status !== 0) {
3184
+ installSpinner.stop("Failed to install nia-cli");
3185
+ const installOutput = [installResult.stdout, installResult.stderr].filter(Boolean).join("\n").trim();
3186
+ if (installOutput) {
3187
+ clack_default.log.error(installOutput);
3188
+ }
3189
+ clack_default.log.error("Could not install nia-cli automatically.");
3190
+ clack_default.log.info("Install manually: npm install -g nia-cli");
3191
+ return false;
3192
+ }
3193
+ if (!isNiaCliInstalled()) {
3194
+ installSpinner.stop("Installed nia-cli, but `nia` is not available");
3195
+ clack_default.log.error("The `nia` command is still unavailable in your PATH.");
3196
+ clack_default.log.info("Open a new terminal or run: npm install -g nia-cli");
3197
+ return false;
3198
+ }
3199
+ installSpinner.stop("nia-cli installed!");
3200
+ return true;
3201
+ }
3202
+ function runNiaSkill() {
3203
+ const runResult = spawnSync5(niaCommand(), ["skill"], {
3204
+ stdio: "inherit",
3205
+ shell: false
3206
+ });
3207
+ if (runResult.status === 0) {
3208
+ return true;
3209
+ }
3210
+ debug("nia skill failed, falling back to npx nia-cli skill", runResult.status);
3211
+ clack_default.log.warn("`nia skill` failed. Trying `npx -y nia-cli skill`...");
3212
+ const fallbackResult = spawnSync5(npxCommand(), ["-y", NIA_CLI_PACKAGE, "skill"], {
3213
+ stdio: "inherit",
3214
+ shell: false
3215
+ });
3216
+ return fallbackResult.status === 0;
3217
+ }
3218
+ function runNiaAuthLogin(apiKey) {
3219
+ const authResult = spawnSync5(niaCommand(), ["auth", "login", "--api-key", apiKey], {
3220
+ stdio: "inherit",
3221
+ shell: false
3222
+ });
3223
+ if (authResult.status === 0) {
3224
+ return true;
3225
+ }
3226
+ debug("nia auth login failed, falling back to npx nia-cli auth login", authResult.status);
3227
+ clack_default.log.warn("`nia auth login` failed. Trying `npx -y nia-cli auth login`...");
3228
+ const fallbackResult = spawnSync5(
3229
+ npxCommand(),
3230
+ ["-y", NIA_CLI_PACKAGE, "auth", "login", "--api-key", apiKey],
3231
+ {
3232
+ stdio: "inherit",
3233
+ shell: false
3234
+ }
3235
+ );
3236
+ return fallbackResult.status === 0;
3237
+ }
3238
+
3150
3239
  // src/run.ts
3151
3240
  async function runAddMcpInstall(apiKey) {
3152
3241
  clack_default.log.info("Launching add-mcp installer...\n");
3153
- const result = spawnSync5(
3242
+ const result = spawnSync6(
3154
3243
  "npx",
3155
3244
  [
3156
3245
  "add-mcp",
@@ -3170,12 +3259,24 @@ async function runAddMcpInstall(apiKey) {
3170
3259
  }
3171
3260
  async function runSkillsInstall() {
3172
3261
  clack_default.log.info("Launching Nia skill installer...\n");
3173
- const result = spawnSync5("npx", ["skills", "add", "nozomio-labs/nia-skill"], {
3262
+ const result = spawnSync6("npx", ["skills", "add", "nozomio-labs/nia-skill"], {
3174
3263
  stdio: "inherit",
3175
3264
  shell: true
3176
3265
  });
3177
3266
  return result.status === 0;
3178
3267
  }
3268
+ async function runNiaCliSkillInstall(apiKey) {
3269
+ clack_default.log.info("Launching Nia CLI skill installer...\n");
3270
+ if (!ensureNiaCliInstalled()) {
3271
+ return false;
3272
+ }
3273
+ clack_default.log.info("Configuring nia-cli authentication...");
3274
+ if (!runNiaAuthLogin(apiKey)) {
3275
+ clack_default.log.warn("nia-cli authentication failed");
3276
+ return false;
3277
+ }
3278
+ return runNiaSkill();
3279
+ }
3179
3280
  async function runManualMode() {
3180
3281
  const allClients = getAllClients();
3181
3282
  const selectedName = await abortIfCancelled(
@@ -3270,6 +3371,11 @@ async function runWizard(options) {
3270
3371
  clack_default.multiselect({
3271
3372
  message: "What would you like to do? (space to select, enter to confirm)",
3272
3373
  options: [
3374
+ {
3375
+ value: "nia-cli",
3376
+ label: "Install Nia CLI",
3377
+ hint: "Installs nia CLI + skill"
3378
+ },
3273
3379
  {
3274
3380
  value: "add-mcp",
3275
3381
  label: "Install via add-mcp",
@@ -3304,6 +3410,7 @@ async function runWizard(options) {
3304
3410
  let installedAddMcp = false;
3305
3411
  let installedMcp = false;
3306
3412
  let installedSkills = false;
3413
+ let installedNiaCliSkill = false;
3307
3414
  if (actions.includes("add-mcp")) {
3308
3415
  console.log("");
3309
3416
  const success = await runAddMcpInstall(apiKey);
@@ -3365,10 +3472,26 @@ async function runWizard(options) {
3365
3472
  clack_default.log.warn("Skills installation may have failed");
3366
3473
  }
3367
3474
  }
3368
- if (installedAddMcp || installedMcp || installedSkills) {
3475
+ if (actions.includes("nia-cli")) {
3476
+ console.log("");
3477
+ const success = await runNiaCliSkillInstall(apiKey);
3478
+ if (success) {
3479
+ clack_default.log.success("Nia CLI skill installed!");
3480
+ clack_default.log.message(chalk3.dim("Run `nia skill` to manage your Nia CLI skill."));
3481
+ installedNiaCliSkill = true;
3482
+ } else {
3483
+ clack_default.log.warn("Nia CLI skill installation may have failed");
3484
+ }
3485
+ }
3486
+ if (installedAddMcp || installedMcp || installedSkills || installedNiaCliSkill) {
3487
+ const niaSkillManagementHint = installedNiaCliSkill ? `
3488
+ ${chalk3.cyan("Nia CLI skill management:")} ${chalk3.yellow("Run `nia skill` any time to manage your skill.")}
3489
+ ` : "";
3369
3490
  const outroMessage = `
3370
3491
  ${chalk3.green("\u2713 Nia installed!")}
3371
3492
 
3493
+ ${niaSkillManagementHint}
3494
+
3372
3495
  ${chalk3.cyan("Get started:")}
3373
3496
  \u2022 Browse pre-indexed sources: ${chalk3.cyan("https://app.trynia.ai/explore")}
3374
3497
  \u2022 Or index your own repos, docs, and papers
@@ -3456,7 +3579,7 @@ async function runMCPRemove(options = {}) {
3456
3579
 
3457
3580
  // src/skill.ts
3458
3581
  import chalk5 from "chalk";
3459
- import { spawnSync as spawnSync6 } from "child_process";
3582
+ import { spawnSync as spawnSync7 } from "child_process";
3460
3583
  var DEFAULT_SKILL_SOURCE = "nozomio-labs/nia-skill";
3461
3584
  var NON_INTERACTIVE_TIMEOUT_MS = 3e4;
3462
3585
  async function runSkillAdd(options) {
@@ -3528,7 +3651,7 @@ async function runSkillAdd(options) {
3528
3651
  }
3529
3652
  }
3530
3653
  function detectSkillsCapabilities() {
3531
- const result = spawnSync6("npx", ["skills", "add", "--help"], {
3654
+ const result = spawnSync7("npx", ["skills", "add", "--help"], {
3532
3655
  shell: false,
3533
3656
  stdio: "pipe",
3534
3657
  encoding: "utf-8",
@@ -3628,7 +3751,7 @@ function runSkillsInstall2(params) {
3628
3751
  }
3629
3752
  const command = `npx ${args.join(" ")}`;
3630
3753
  debug("running", command);
3631
- const result = spawnSync6("npx", args, {
3754
+ const result = spawnSync7("npx", args, {
3632
3755
  shell: false,
3633
3756
  stdio: params.nonInteractive ? "pipe" : "inherit",
3634
3757
  encoding: params.nonInteractive ? "utf-8" : void 0,
@@ -3766,4 +3889,4 @@ export {
3766
3889
  runSkillAdd,
3767
3890
  printAgentGuide
3768
3891
  };
3769
- //# sourceMappingURL=chunk-JKF3ZFD5.js.map
3892
+ //# sourceMappingURL=chunk-XF23S5X2.js.map