nia-wizard 0.1.16 → 0.1.18
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 +57 -52
- package/dist/bin.js +1 -1
- package/dist/{chunk-JKF3ZFD5.js → chunk-KAGHMAER.js} +172 -33
- package/dist/chunk-KAGHMAER.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JKF3ZFD5.js.map +0 -1
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
|
-
|
|
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
|
|
107
|
-
|
|
108
|
-
| `--local`
|
|
109
|
-
| `--remote`
|
|
110
|
-
| `--debug`
|
|
111
|
-
| `--ci`
|
|
112
|
-
| `--api-key`, `-k`
|
|
113
|
-
| `--non-interactive` | Fail fast instead of waiting for prompts (skill command)
|
|
114
|
-
| `--target`
|
|
115
|
-
| `--all-agents`
|
|
116
|
-
| `--global`
|
|
117
|
-
| `--source`
|
|
118
|
-
| `--json`
|
|
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
|
|
147
|
-
|
|
148
|
-
| Cursor
|
|
149
|
-
| VS Code
|
|
150
|
-
| Windsurf
|
|
151
|
-
| Cline
|
|
152
|
-
| Continue
|
|
153
|
-
| Antigravity
|
|
154
|
-
| Trae
|
|
155
|
-
| Roo Code
|
|
156
|
-
| Kilo Code
|
|
157
|
-
| Gemini CLI
|
|
158
|
-
| OpenCode
|
|
159
|
-
| Qodo Gen
|
|
160
|
-
| Qwen Coder
|
|
161
|
-
| Visual Studio | `~/.vs/mcp.json`
|
|
162
|
-
| Crush
|
|
163
|
-
| Copilot Agent | `.github/copilot-mcp.json` (per-repo)
|
|
164
|
-
| Copilot CLI
|
|
165
|
-
| Factory
|
|
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
|
|
170
|
-
|
|
171
|
-
| Claude Code | CLI: `claude mcp add`
|
|
172
|
-
| Amp
|
|
173
|
-
| Vibe
|
|
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
|
|
178
|
-
|
|
182
|
+
| Agent | Config Location |
|
|
183
|
+
| -------------- | ----------------------------------------------------------------- |
|
|
179
184
|
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
180
|
-
| Codex CLI
|
|
181
|
-
| Codex App
|
|
182
|
-
| Zed
|
|
183
|
-
| Augment
|
|
184
|
-
| JetBrains
|
|
185
|
-
| Kiro
|
|
186
|
-
| LM Studio
|
|
187
|
-
| Bolt AI
|
|
188
|
-
| Perplexity
|
|
189
|
-
| Warp
|
|
190
|
-
| Amazon Q
|
|
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
|
@@ -15,13 +15,15 @@ function debug(...args) {
|
|
|
15
15
|
var BACKEND_URL = process.env.NIA_BACKEND_URL || "https://apigcp.trynia.ai";
|
|
16
16
|
var APP_URL = process.env.NIA_APP_URL || "";
|
|
17
17
|
var SESSION_TTL_MS = 15 * 60 * 1e3;
|
|
18
|
+
var FETCH_TIMEOUT_MS = 1e4;
|
|
18
19
|
async function startDeviceSession() {
|
|
19
20
|
debug("Starting device session...");
|
|
20
21
|
const response = await fetch(`${BACKEND_URL}/public/mcp-device/start`, {
|
|
21
22
|
method: "POST",
|
|
22
23
|
headers: {
|
|
23
24
|
"Content-Type": "application/json"
|
|
24
|
-
}
|
|
25
|
+
},
|
|
26
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
|
|
25
27
|
});
|
|
26
28
|
if (!response.ok) {
|
|
27
29
|
const errorText = await response.text().catch(() => "Unknown error");
|
|
@@ -62,7 +64,8 @@ async function exchangeForApiKey(session) {
|
|
|
62
64
|
body: JSON.stringify({
|
|
63
65
|
authorization_session_id: session.authorization_session_id,
|
|
64
66
|
user_code: session.user_code
|
|
65
|
-
})
|
|
67
|
+
}),
|
|
68
|
+
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
|
|
66
69
|
});
|
|
67
70
|
if (!response.ok) {
|
|
68
71
|
const errorData = await response.json().catch(() => ({ detail: "Unknown error" }));
|
|
@@ -376,68 +379,81 @@ async function runDeviceFlow() {
|
|
|
376
379
|
console.log("");
|
|
377
380
|
clack_default.log.step(chalk.yellow("Complete these steps in your browser:"));
|
|
378
381
|
console.log(" 1. Sign in or create an account");
|
|
379
|
-
console.log(" 2.
|
|
382
|
+
console.log(" 2. Complete any setup steps shown");
|
|
383
|
+
console.log("");
|
|
384
|
+
clack_default.log.message(chalk.dim("The CLI will detect when you're done and continue automatically."));
|
|
380
385
|
console.log("");
|
|
381
386
|
return await waitForAuthorizationAndExchange(session);
|
|
382
387
|
}
|
|
388
|
+
function sleep(ms) {
|
|
389
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
390
|
+
}
|
|
383
391
|
async function waitForAuthorizationAndExchange(session) {
|
|
392
|
+
const spinner = clack_default.spinner();
|
|
393
|
+
spinner.start("Waiting for browser authorization...");
|
|
394
|
+
const POLL_INTERVAL_MS = 2e3;
|
|
395
|
+
const MAX_NETWORK_ERRORS = 5;
|
|
396
|
+
let consecutiveNetworkErrors = 0;
|
|
384
397
|
while (true) {
|
|
385
398
|
if (!isSessionValid(session)) {
|
|
399
|
+
spinner.stop("Session expired");
|
|
386
400
|
clack_default.log.error("Session has expired. Please start over.");
|
|
387
401
|
return abort("Session expired", 1);
|
|
388
402
|
}
|
|
389
|
-
const shouldContinue = await abortIfCancelled(
|
|
390
|
-
clack_default.confirm({
|
|
391
|
-
message: "Press Enter once you've signed in (or N to enter key manually)",
|
|
392
|
-
initialValue: true
|
|
393
|
-
})
|
|
394
|
-
);
|
|
395
|
-
if (!shouldContinue) {
|
|
396
|
-
return await promptForManualApiKey();
|
|
397
|
-
}
|
|
398
|
-
const spinner = clack_default.spinner();
|
|
399
|
-
spinner.start("Checking authorization...");
|
|
400
403
|
try {
|
|
401
404
|
const apiKey = await exchangeForApiKey(session);
|
|
402
405
|
spinner.stop(chalk.green("\u2713 Authorized!"));
|
|
403
406
|
clack_default.log.success("API key obtained successfully!");
|
|
404
407
|
return apiKey;
|
|
405
408
|
} catch (error) {
|
|
406
|
-
spinner.stop("Not ready yet");
|
|
407
409
|
if (isDeviceFlowError(error)) {
|
|
408
410
|
switch (error.type) {
|
|
409
411
|
case "not_ready":
|
|
410
|
-
|
|
411
|
-
console.log("");
|
|
412
|
-
clack_default.log.message(
|
|
413
|
-
chalk.dim("Make sure you have:\n") + " \u2022 Signed in to your Nia account\n \u2022 Completed any setup steps in the browser"
|
|
414
|
-
);
|
|
415
|
-
console.log("");
|
|
412
|
+
consecutiveNetworkErrors = 0;
|
|
416
413
|
break;
|
|
417
414
|
case "expired":
|
|
415
|
+
spinner.stop("Session expired");
|
|
418
416
|
clack_default.log.error("Session has expired.");
|
|
419
417
|
clack_default.log.info("Please run the wizard again to start a new session.");
|
|
420
418
|
return abort("Session expired", 1);
|
|
421
419
|
case "consumed":
|
|
420
|
+
spinner.stop("Session already used");
|
|
422
421
|
clack_default.log.error("This session was already used.");
|
|
423
422
|
clack_default.log.info("Please run the wizard again to start a new session.");
|
|
424
423
|
return abort("Session already used", 1);
|
|
425
424
|
case "invalid":
|
|
425
|
+
spinner.stop("Invalid session");
|
|
426
426
|
clack_default.log.error(error.message);
|
|
427
427
|
clack_default.log.info("Please run the wizard again to start a new session.");
|
|
428
428
|
return abort("Invalid session", 1);
|
|
429
|
+
case "network":
|
|
430
|
+
consecutiveNetworkErrors++;
|
|
431
|
+
if (consecutiveNetworkErrors >= MAX_NETWORK_ERRORS) {
|
|
432
|
+
spinner.stop("Connection failed");
|
|
433
|
+
clack_default.log.error(`Failed to reach Nia servers after ${MAX_NETWORK_ERRORS} attempts.`);
|
|
434
|
+
clack_default.log.info("Falling back to manual API key entry.");
|
|
435
|
+
return await promptForManualApiKey();
|
|
436
|
+
}
|
|
437
|
+
break;
|
|
429
438
|
default:
|
|
439
|
+
spinner.stop("Error");
|
|
430
440
|
clack_default.log.error(error.message);
|
|
431
441
|
clack_default.log.info("Falling back to manual API key entry.");
|
|
432
442
|
return await promptForManualApiKey();
|
|
433
443
|
}
|
|
434
444
|
} else {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
445
|
+
consecutiveNetworkErrors++;
|
|
446
|
+
if (consecutiveNetworkErrors >= MAX_NETWORK_ERRORS) {
|
|
447
|
+
spinner.stop("Connection failed");
|
|
448
|
+
clack_default.log.error("Lost connection to Nia servers.");
|
|
449
|
+
debug(`Exchange error: ${error}`);
|
|
450
|
+
clack_default.log.info("Falling back to manual API key entry.");
|
|
451
|
+
return await promptForManualApiKey();
|
|
452
|
+
}
|
|
439
453
|
}
|
|
440
454
|
}
|
|
455
|
+
const backoff = consecutiveNetworkErrors > 0 ? POLL_INTERVAL_MS * Math.min(consecutiveNetworkErrors, 4) : POLL_INTERVAL_MS;
|
|
456
|
+
await sleep(backoff);
|
|
441
457
|
}
|
|
442
458
|
}
|
|
443
459
|
async function promptForManualApiKey() {
|
|
@@ -2931,7 +2947,7 @@ async function removeMCPServerFromClientsStep() {
|
|
|
2931
2947
|
|
|
2932
2948
|
// src/run.ts
|
|
2933
2949
|
import chalk3 from "chalk";
|
|
2934
|
-
import { spawnSync as
|
|
2950
|
+
import { spawnSync as spawnSync6 } from "child_process";
|
|
2935
2951
|
|
|
2936
2952
|
// src/utils/dependencies.ts
|
|
2937
2953
|
import { execSync as execSync5, spawnSync as spawnSync4 } from "child_process";
|
|
@@ -3147,10 +3163,99 @@ function storeApiKey(apiKey) {
|
|
|
3147
3163
|
fs33.writeFileSync(NIA_KEY_PATH, apiKey, { mode: 384 });
|
|
3148
3164
|
}
|
|
3149
3165
|
|
|
3166
|
+
// src/utils/nia-cli.ts
|
|
3167
|
+
import { spawnSync as spawnSync5 } from "child_process";
|
|
3168
|
+
var NIA_CLI_PACKAGE = "nia-cli";
|
|
3169
|
+
function npmCommand() {
|
|
3170
|
+
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
3171
|
+
}
|
|
3172
|
+
function npxCommand() {
|
|
3173
|
+
return process.platform === "win32" ? "npx.cmd" : "npx";
|
|
3174
|
+
}
|
|
3175
|
+
function niaCommand() {
|
|
3176
|
+
return process.platform === "win32" ? "nia.cmd" : "nia";
|
|
3177
|
+
}
|
|
3178
|
+
function isNiaCliInstalled() {
|
|
3179
|
+
const result = spawnSync5(niaCommand(), ["--version"], {
|
|
3180
|
+
stdio: "pipe",
|
|
3181
|
+
encoding: "utf-8",
|
|
3182
|
+
shell: false
|
|
3183
|
+
});
|
|
3184
|
+
debug("nia --version status", result.status);
|
|
3185
|
+
return result.status === 0;
|
|
3186
|
+
}
|
|
3187
|
+
function ensureNiaCliInstalled() {
|
|
3188
|
+
if (isNiaCliInstalled()) {
|
|
3189
|
+
return true;
|
|
3190
|
+
}
|
|
3191
|
+
clack_default.log.info("Installing nia-cli globally with npm...");
|
|
3192
|
+
const installSpinner = clack_default.spinner();
|
|
3193
|
+
installSpinner.start("Installing nia-cli...");
|
|
3194
|
+
const installResult = spawnSync5(npmCommand(), ["install", "-g", NIA_CLI_PACKAGE], {
|
|
3195
|
+
stdio: "pipe",
|
|
3196
|
+
encoding: "utf-8",
|
|
3197
|
+
shell: false
|
|
3198
|
+
});
|
|
3199
|
+
if (installResult.status !== 0) {
|
|
3200
|
+
installSpinner.stop("Failed to install nia-cli");
|
|
3201
|
+
const installOutput = [installResult.stdout, installResult.stderr].filter(Boolean).join("\n").trim();
|
|
3202
|
+
if (installOutput) {
|
|
3203
|
+
clack_default.log.error(installOutput);
|
|
3204
|
+
}
|
|
3205
|
+
clack_default.log.error("Could not install nia-cli automatically.");
|
|
3206
|
+
clack_default.log.info("Install manually: npm install -g nia-cli");
|
|
3207
|
+
return false;
|
|
3208
|
+
}
|
|
3209
|
+
if (!isNiaCliInstalled()) {
|
|
3210
|
+
installSpinner.stop("Installed nia-cli, but `nia` is not available");
|
|
3211
|
+
clack_default.log.error("The `nia` command is still unavailable in your PATH.");
|
|
3212
|
+
clack_default.log.info("Open a new terminal or run: npm install -g nia-cli");
|
|
3213
|
+
return false;
|
|
3214
|
+
}
|
|
3215
|
+
installSpinner.stop("nia-cli installed!");
|
|
3216
|
+
return true;
|
|
3217
|
+
}
|
|
3218
|
+
function runNiaSkill() {
|
|
3219
|
+
const runResult = spawnSync5(niaCommand(), ["skill"], {
|
|
3220
|
+
stdio: "inherit",
|
|
3221
|
+
shell: false
|
|
3222
|
+
});
|
|
3223
|
+
if (runResult.status === 0) {
|
|
3224
|
+
return true;
|
|
3225
|
+
}
|
|
3226
|
+
debug("nia skill failed, falling back to npx nia-cli skill", runResult.status);
|
|
3227
|
+
clack_default.log.warn("`nia skill` failed. Trying `npx -y nia-cli skill`...");
|
|
3228
|
+
const fallbackResult = spawnSync5(npxCommand(), ["-y", NIA_CLI_PACKAGE, "skill"], {
|
|
3229
|
+
stdio: "inherit",
|
|
3230
|
+
shell: false
|
|
3231
|
+
});
|
|
3232
|
+
return fallbackResult.status === 0;
|
|
3233
|
+
}
|
|
3234
|
+
function runNiaAuthLogin(apiKey) {
|
|
3235
|
+
const authResult = spawnSync5(niaCommand(), ["auth", "login", "--api-key", apiKey], {
|
|
3236
|
+
stdio: "inherit",
|
|
3237
|
+
shell: false
|
|
3238
|
+
});
|
|
3239
|
+
if (authResult.status === 0) {
|
|
3240
|
+
return true;
|
|
3241
|
+
}
|
|
3242
|
+
debug("nia auth login failed, falling back to npx nia-cli auth login", authResult.status);
|
|
3243
|
+
clack_default.log.warn("`nia auth login` failed. Trying `npx -y nia-cli auth login`...");
|
|
3244
|
+
const fallbackResult = spawnSync5(
|
|
3245
|
+
npxCommand(),
|
|
3246
|
+
["-y", NIA_CLI_PACKAGE, "auth", "login", "--api-key", apiKey],
|
|
3247
|
+
{
|
|
3248
|
+
stdio: "inherit",
|
|
3249
|
+
shell: false
|
|
3250
|
+
}
|
|
3251
|
+
);
|
|
3252
|
+
return fallbackResult.status === 0;
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3150
3255
|
// src/run.ts
|
|
3151
3256
|
async function runAddMcpInstall(apiKey) {
|
|
3152
3257
|
clack_default.log.info("Launching add-mcp installer...\n");
|
|
3153
|
-
const result =
|
|
3258
|
+
const result = spawnSync6(
|
|
3154
3259
|
"npx",
|
|
3155
3260
|
[
|
|
3156
3261
|
"add-mcp",
|
|
@@ -3170,12 +3275,24 @@ async function runAddMcpInstall(apiKey) {
|
|
|
3170
3275
|
}
|
|
3171
3276
|
async function runSkillsInstall() {
|
|
3172
3277
|
clack_default.log.info("Launching Nia skill installer...\n");
|
|
3173
|
-
const result =
|
|
3278
|
+
const result = spawnSync6("npx", ["skills", "add", "nozomio-labs/nia-skill"], {
|
|
3174
3279
|
stdio: "inherit",
|
|
3175
3280
|
shell: true
|
|
3176
3281
|
});
|
|
3177
3282
|
return result.status === 0;
|
|
3178
3283
|
}
|
|
3284
|
+
async function runNiaCliSkillInstall(apiKey) {
|
|
3285
|
+
clack_default.log.info("Launching Nia CLI skill installer...\n");
|
|
3286
|
+
if (!ensureNiaCliInstalled()) {
|
|
3287
|
+
return false;
|
|
3288
|
+
}
|
|
3289
|
+
clack_default.log.info("Configuring nia-cli authentication...");
|
|
3290
|
+
if (!runNiaAuthLogin(apiKey)) {
|
|
3291
|
+
clack_default.log.warn("nia-cli authentication failed");
|
|
3292
|
+
return false;
|
|
3293
|
+
}
|
|
3294
|
+
return runNiaSkill();
|
|
3295
|
+
}
|
|
3179
3296
|
async function runManualMode() {
|
|
3180
3297
|
const allClients = getAllClients();
|
|
3181
3298
|
const selectedName = await abortIfCancelled(
|
|
@@ -3270,6 +3387,11 @@ async function runWizard(options) {
|
|
|
3270
3387
|
clack_default.multiselect({
|
|
3271
3388
|
message: "What would you like to do? (space to select, enter to confirm)",
|
|
3272
3389
|
options: [
|
|
3390
|
+
{
|
|
3391
|
+
value: "nia-cli",
|
|
3392
|
+
label: "Install Nia CLI",
|
|
3393
|
+
hint: "Installs nia CLI + skill"
|
|
3394
|
+
},
|
|
3273
3395
|
{
|
|
3274
3396
|
value: "add-mcp",
|
|
3275
3397
|
label: "Install via add-mcp",
|
|
@@ -3304,6 +3426,7 @@ async function runWizard(options) {
|
|
|
3304
3426
|
let installedAddMcp = false;
|
|
3305
3427
|
let installedMcp = false;
|
|
3306
3428
|
let installedSkills = false;
|
|
3429
|
+
let installedNiaCliSkill = false;
|
|
3307
3430
|
if (actions.includes("add-mcp")) {
|
|
3308
3431
|
console.log("");
|
|
3309
3432
|
const success = await runAddMcpInstall(apiKey);
|
|
@@ -3365,10 +3488,26 @@ async function runWizard(options) {
|
|
|
3365
3488
|
clack_default.log.warn("Skills installation may have failed");
|
|
3366
3489
|
}
|
|
3367
3490
|
}
|
|
3368
|
-
if (
|
|
3491
|
+
if (actions.includes("nia-cli")) {
|
|
3492
|
+
console.log("");
|
|
3493
|
+
const success = await runNiaCliSkillInstall(apiKey);
|
|
3494
|
+
if (success) {
|
|
3495
|
+
clack_default.log.success("Nia CLI skill installed!");
|
|
3496
|
+
clack_default.log.message(chalk3.dim("Run `nia skill` to manage your Nia CLI skill."));
|
|
3497
|
+
installedNiaCliSkill = true;
|
|
3498
|
+
} else {
|
|
3499
|
+
clack_default.log.warn("Nia CLI skill installation may have failed");
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
if (installedAddMcp || installedMcp || installedSkills || installedNiaCliSkill) {
|
|
3503
|
+
const niaSkillManagementHint = installedNiaCliSkill ? `
|
|
3504
|
+
${chalk3.cyan("Nia CLI skill management:")} ${chalk3.yellow("Run `nia skill` any time to manage your skill.")}
|
|
3505
|
+
` : "";
|
|
3369
3506
|
const outroMessage = `
|
|
3370
3507
|
${chalk3.green("\u2713 Nia installed!")}
|
|
3371
3508
|
|
|
3509
|
+
${niaSkillManagementHint}
|
|
3510
|
+
|
|
3372
3511
|
${chalk3.cyan("Get started:")}
|
|
3373
3512
|
\u2022 Browse pre-indexed sources: ${chalk3.cyan("https://app.trynia.ai/explore")}
|
|
3374
3513
|
\u2022 Or index your own repos, docs, and papers
|
|
@@ -3456,7 +3595,7 @@ async function runMCPRemove(options = {}) {
|
|
|
3456
3595
|
|
|
3457
3596
|
// src/skill.ts
|
|
3458
3597
|
import chalk5 from "chalk";
|
|
3459
|
-
import { spawnSync as
|
|
3598
|
+
import { spawnSync as spawnSync7 } from "child_process";
|
|
3460
3599
|
var DEFAULT_SKILL_SOURCE = "nozomio-labs/nia-skill";
|
|
3461
3600
|
var NON_INTERACTIVE_TIMEOUT_MS = 3e4;
|
|
3462
3601
|
async function runSkillAdd(options) {
|
|
@@ -3528,7 +3667,7 @@ async function runSkillAdd(options) {
|
|
|
3528
3667
|
}
|
|
3529
3668
|
}
|
|
3530
3669
|
function detectSkillsCapabilities() {
|
|
3531
|
-
const result =
|
|
3670
|
+
const result = spawnSync7("npx", ["skills", "add", "--help"], {
|
|
3532
3671
|
shell: false,
|
|
3533
3672
|
stdio: "pipe",
|
|
3534
3673
|
encoding: "utf-8",
|
|
@@ -3628,7 +3767,7 @@ function runSkillsInstall2(params) {
|
|
|
3628
3767
|
}
|
|
3629
3768
|
const command = `npx ${args.join(" ")}`;
|
|
3630
3769
|
debug("running", command);
|
|
3631
|
-
const result =
|
|
3770
|
+
const result = spawnSync7("npx", args, {
|
|
3632
3771
|
shell: false,
|
|
3633
3772
|
stdio: params.nonInteractive ? "pipe" : "inherit",
|
|
3634
3773
|
encoding: params.nonInteractive ? "utf-8" : void 0,
|
|
@@ -3766,4 +3905,4 @@ export {
|
|
|
3766
3905
|
runSkillAdd,
|
|
3767
3906
|
printAgentGuide
|
|
3768
3907
|
};
|
|
3769
|
-
//# sourceMappingURL=chunk-
|
|
3908
|
+
//# sourceMappingURL=chunk-KAGHMAER.js.map
|