nia-wizard 0.1.27 → 0.1.29

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
@@ -26,6 +26,12 @@ npx nia-wizard
26
26
 
27
27
  Press Enter to continue with the recommended default setup, which signs you in and installs or updates `nia-cli` to the latest version, or use the arrow keys to choose advanced or manual setup.
28
28
 
29
+ Print the agent-specific onboarding prompt:
30
+
31
+ ```bash
32
+ npx nia-wizard --agent
33
+ ```
34
+
29
35
  ### With API Key
30
36
 
31
37
  ```bash
@@ -102,10 +108,10 @@ npx nia-wizard skill add \
102
108
  --ci
103
109
  ```
104
110
 
105
- Print the headless onboarding guide for agents:
111
+ Print the agent-facing onboarding prompt:
106
112
 
107
113
  ```bash
108
- npx nia-wizard agent-guide
114
+ npx nia-wizard --agent
109
115
  ```
110
116
 
111
117
  ## Options
@@ -116,6 +122,7 @@ npx nia-wizard agent-guide
116
122
  | `--remote` | Use remote mode (connects to Nia cloud) |
117
123
  | `--debug` | Enable debug logging |
118
124
  | `--ci` | CI mode (skip prompts, use defaults) |
125
+ | `--agent` | Print agent-facing Nia CLI onboarding prompt (root command) |
119
126
  | `--api-key`, `-k` | Nia API key |
120
127
  | `--non-interactive` | Fail fast instead of waiting for prompts (skill command) |
121
128
  | `--target` | Target coding agent for skill installation (skill command) |
@@ -147,6 +154,26 @@ If you prefer, you can:
147
154
  - Pass it directly: `npx nia-wizard nk_xxx`
148
155
  - Or select "Enter API key manually" when prompted
149
156
 
157
+ ## Agent Onboarding Prompt
158
+
159
+ Use the root `--agent` flag when you want an external coding agent to perform the Nia CLI setup steps on the user's machine instead of launching the local interactive wizard.
160
+
161
+ ```bash
162
+ npx nia-wizard --agent
163
+ ```
164
+
165
+ This prints the canonical agent workflow:
166
+
167
+ 1. Run `bun --version`
168
+ 2. Install `@nozomioai/nia@latest` globally with Bun or npm
169
+ 3. Tell the user to open `https://app.trynia.ai/api-keys`
170
+ 4. Tell the user to create an API key there
171
+ 5. Ask the user to paste the `nk_...` key back to the agent
172
+ 6. Run `nia auth login --api-key <nk_api_key>`
173
+ 7. Run `nia skill --all`
174
+
175
+ This is a prompt-only flow intended for external agents. The user retrieves the API key manually and sends it back to the agent to finish setup.
176
+
150
177
  ## Supported Coding Agents
151
178
 
152
179
  ### Full Support (Local + Remote)
package/dist/bin.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  runWizard,
9
9
  shutdown,
10
10
  track
11
- } from "./chunk-ZAV3ACJJ.js";
11
+ } from "./chunk-CUR7WEDI.js";
12
12
 
13
13
  // src/bin.ts
14
14
  import yargs from "yargs";
@@ -21,7 +21,7 @@ function printCliError(error) {
21
21
  }
22
22
  console.error("Error:", error);
23
23
  }
24
- var cli = yargs(hideBin(process.argv)).scriptName("nia-wizard").usage("$0 [api-key] [options]").usage("$0 mcp add [options]").usage("$0 mcp remove [options]").usage("$0 skill add [options]").usage("$0 agent-guide").command(
24
+ var cli = yargs(hideBin(process.argv)).scriptName("nia-wizard").usage("$0 [api-key] [options]").usage("$0 mcp add [options]").usage("$0 mcp remove [options]").usage("$0 skill add [options]").command(
25
25
  "$0 [api-key]",
26
26
  "Install Nia to your coding agents",
27
27
  (yargs2) => yargs2.positional("api-key", {
@@ -41,14 +41,26 @@ var cli = yargs(hideBin(process.argv)).scriptName("nia-wizard").usage("$0 [api-k
41
41
  type: "boolean",
42
42
  default: false,
43
43
  description: "CI mode (skip prompts)"
44
+ }).option("agent", {
45
+ type: "boolean",
46
+ default: false,
47
+ description: "Print agent-facing Nia CLI onboarding prompt"
44
48
  }),
45
49
  async (argv) => {
46
- const ci = argv.ci || !isInteractive;
47
- if (!isInteractive && !argv.ci) {
48
- console.log("Non-interactive terminal detected, running in CI mode.");
49
- console.log("For the full interactive experience, run: npx nia-wizard\n");
50
- }
51
50
  try {
51
+ if (argv.agent) {
52
+ printAgentGuide();
53
+ return;
54
+ }
55
+ const apiKeyArg = typeof argv["api-key"] === "string" ? argv["api-key"] : typeof argv.apiKey === "string" ? argv.apiKey : void 0;
56
+ if (apiKeyArg === "agent-guide") {
57
+ throw new Error("The `agent-guide` subcommand has been removed. Use `npx nia-wizard --agent`.");
58
+ }
59
+ const ci = argv.ci || !isInteractive;
60
+ if (!isInteractive && !argv.ci) {
61
+ console.log("Non-interactive terminal detected, running in CI mode.");
62
+ console.log("For the full interactive experience, run: npx nia-wizard\n");
63
+ }
52
64
  await runWizard({
53
65
  apiKey: argv["api-key"],
54
66
  local: argv.local ?? (argv.remote ? false : void 0),
@@ -62,14 +74,6 @@ var cli = yargs(hideBin(process.argv)).scriptName("nia-wizard").usage("$0 [api-k
62
74
  process.exit(1);
63
75
  }
64
76
  }
65
- ).command(
66
- "agent-guide",
67
- "Print API-first agent onboarding guide in Markdown",
68
- () => {
69
- },
70
- () => {
71
- printAgentGuide();
72
- }
73
77
  ).command(
74
78
  "skill <command>",
75
79
  "Manage skill installation",
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { runWizard } from './run.js';\nimport { runMCPAdd, runMCPRemove } from './mcp.js';\nimport { runSkillAdd } from './skill.js';\nimport { printAgentGuide } from './agent-guide.js';\nimport { track, shutdown } from './utils/analytics.js';\n\nconst isInteractive = Boolean(process.stdin.isTTY);\n\nfunction printCliError(error: unknown): void {\n if (error instanceof Error) {\n console.error(`Error: ${error.message}`);\n return;\n }\n\n console.error('Error:', error);\n}\n\nconst cli = yargs(hideBin(process.argv))\n .scriptName('nia-wizard')\n .usage('$0 [api-key] [options]')\n .usage('$0 mcp add [options]')\n .usage('$0 mcp remove [options]')\n .usage('$0 skill add [options]')\n .usage('$0 agent-guide')\n .command(\n '$0 [api-key]',\n 'Install Nia to your coding agents',\n (yargs) =>\n yargs\n .positional('api-key', {\n type: 'string',\n description: 'Nia API key (nk_xxx)',\n })\n .option('local', {\n type: 'boolean',\n description: 'Use local mode (requires pipx)',\n })\n .option('remote', {\n type: 'boolean',\n description: 'Use remote mode (cloud)',\n })\n .option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n })\n .option('ci', {\n type: 'boolean',\n default: false,\n description: 'CI mode (skip prompts)',\n }),\n async (argv) => {\n const ci = argv.ci || !isInteractive;\n if (!isInteractive && !argv.ci) {\n console.log('Non-interactive terminal detected, running in CI mode.');\n console.log('For the full interactive experience, run: npx nia-wizard\\n');\n }\n try {\n await runWizard({\n apiKey: argv['api-key'],\n local: argv.local ?? (argv.remote ? false : undefined),\n debug: argv.debug,\n ci,\n });\n } catch (error) {\n track('cli_wizard_error', { error_type: 'wizard', error_message: error instanceof Error ? error.message : String(error) });\n await shutdown();\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .command(\n 'agent-guide',\n 'Print API-first agent onboarding guide in Markdown',\n () => {},\n () => {\n printAgentGuide();\n },\n )\n .command(\n 'skill <command>',\n 'Manage skill installation',\n (yargs) =>\n yargs\n .command(\n 'add',\n 'Add Nia skill',\n (yargs) =>\n yargs\n .option('api-key', {\n type: 'string',\n alias: 'k',\n description: 'Nia API key (nk_xxx)',\n })\n .option('source', {\n type: 'string',\n default: 'nozomio-labs/nia-skill',\n description: 'Skill source to install',\n })\n .option('target', {\n type: 'string',\n description: 'Target coding agent for skill installation',\n })\n .option('all-agents', {\n type: 'boolean',\n default: false,\n description: 'Install to all detected agents (non-interactive)',\n })\n .option('global', {\n type: 'boolean',\n description: 'Install to global user skills directories',\n })\n .option('yes', {\n type: 'boolean',\n default: false,\n description: 'Auto-confirm prompts when supported by the skills CLI',\n })\n .option('non-interactive', {\n type: 'boolean',\n default: false,\n description: 'Fail fast instead of waiting for prompts',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n description: 'Print machine-readable install result',\n })\n .option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n })\n .option('ci', {\n type: 'boolean',\n default: false,\n description: 'CI mode (implies non-interactive behavior)',\n }),\n async (argv) => {\n try {\n await runSkillAdd({\n apiKey: argv['api-key'],\n source: argv.source,\n target: argv.target,\n allAgents: argv['all-agents'],\n global: argv.global,\n yes: argv.yes,\n nonInteractive: argv['non-interactive'],\n json: argv.json,\n debug: argv.debug,\n ci: argv.ci,\n });\n } catch (error) {\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .demandCommand(1, 'You need to specify a command (add)'),\n () => {},\n )\n .command(\n 'mcp <command>',\n 'Manage direct agent setup',\n (yargs) =>\n yargs\n .command(\n 'add',\n 'Add Nia to coding agents',\n (yargs) =>\n yargs\n .option('api-key', {\n type: 'string',\n alias: 'k',\n description: 'Nia API key (nk_xxx)',\n })\n .option('local', {\n type: 'boolean',\n description: 'Use local mode',\n })\n .option('remote', {\n type: 'boolean',\n description: 'Use remote mode',\n })\n .option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n })\n .option('ci', {\n type: 'boolean',\n default: false,\n description: 'CI mode (skip prompts)',\n }),\n async (argv) => {\n try {\n await runMCPAdd({\n apiKey: argv['api-key'],\n local: argv.local ?? (argv.remote ? false : undefined),\n debug: argv.debug,\n ci: argv.ci,\n });\n } catch (error) {\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .command(\n 'remove',\n 'Remove Nia from coding agents',\n (yargs) =>\n yargs.option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n }),\n async (argv) => {\n try {\n await runMCPRemove({ debug: argv.debug });\n } catch (error) {\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .demandCommand(1, 'You need to specify a command (add or remove)'),\n () => {},\n )\n .help()\n .version()\n .strict();\n\ncli.parse();\n"],"mappings":";;;;;;;;;;;;;AAEA,OAAO,WAAW;AAClB,SAAS,eAAe;AAOxB,IAAM,gBAAgB,QAAQ,QAAQ,MAAM,KAAK;AAEjD,SAAS,cAAc,OAAsB;AAC3C,MAAI,iBAAiB,OAAO;AAC1B,YAAQ,MAAM,UAAU,MAAM,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,EAAE,OAAO,KAAK,MAAM,CAAC;AAAA,MAC1C,SAAS,OAAO;AACd,sBAAc,KAAK;AACnB,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,IACF;AAAA,EACF,EACC,cAAc,GAAG,+CAA+C;AAAA,EACrE,MAAM;AAAA,EAAC;AACT,EACC,KAAK,EACL,QAAQ,EACR,OAAO;AAEV,IAAI,MAAM;","names":["yargs"]}
1
+ {"version":3,"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { runWizard } from './run.js';\nimport { runMCPAdd, runMCPRemove } from './mcp.js';\nimport { runSkillAdd } from './skill.js';\nimport { printAgentGuide } from './agent-guide.js';\nimport { track, shutdown } from './utils/analytics.js';\n\nconst isInteractive = Boolean(process.stdin.isTTY);\n\nfunction printCliError(error: unknown): void {\n if (error instanceof Error) {\n console.error(`Error: ${error.message}`);\n return;\n }\n\n console.error('Error:', error);\n}\n\nconst cli = yargs(hideBin(process.argv))\n .scriptName('nia-wizard')\n .usage('$0 [api-key] [options]')\n .usage('$0 mcp add [options]')\n .usage('$0 mcp remove [options]')\n .usage('$0 skill add [options]')\n .command(\n '$0 [api-key]',\n 'Install Nia to your coding agents',\n (yargs) =>\n yargs\n .positional('api-key', {\n type: 'string',\n description: 'Nia API key (nk_xxx)',\n })\n .option('local', {\n type: 'boolean',\n description: 'Use local mode (requires pipx)',\n })\n .option('remote', {\n type: 'boolean',\n description: 'Use remote mode (cloud)',\n })\n .option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n })\n .option('ci', {\n type: 'boolean',\n default: false,\n description: 'CI mode (skip prompts)',\n })\n .option('agent', {\n type: 'boolean',\n default: false,\n description: 'Print agent-facing Nia CLI onboarding prompt',\n }),\n async (argv) => {\n try {\n if (argv.agent) {\n printAgentGuide();\n return;\n }\n\n const apiKeyArg = typeof argv['api-key'] === 'string'\n ? argv['api-key']\n : typeof argv.apiKey === 'string'\n ? argv.apiKey\n : undefined;\n\n if (apiKeyArg === 'agent-guide') {\n throw new Error('The `agent-guide` subcommand has been removed. Use `npx nia-wizard --agent`.');\n }\n\n const ci = argv.ci || !isInteractive;\n if (!isInteractive && !argv.ci) {\n console.log('Non-interactive terminal detected, running in CI mode.');\n console.log('For the full interactive experience, run: npx nia-wizard\\n');\n }\n\n await runWizard({\n apiKey: argv['api-key'],\n local: argv.local ?? (argv.remote ? false : undefined),\n debug: argv.debug,\n ci,\n });\n } catch (error) {\n track('cli_wizard_error', { error_type: 'wizard', error_message: error instanceof Error ? error.message : String(error) });\n await shutdown();\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .command(\n 'skill <command>',\n 'Manage skill installation',\n (yargs) =>\n yargs\n .command(\n 'add',\n 'Add Nia skill',\n (yargs) =>\n yargs\n .option('api-key', {\n type: 'string',\n alias: 'k',\n description: 'Nia API key (nk_xxx)',\n })\n .option('source', {\n type: 'string',\n default: 'nozomio-labs/nia-skill',\n description: 'Skill source to install',\n })\n .option('target', {\n type: 'string',\n description: 'Target coding agent for skill installation',\n })\n .option('all-agents', {\n type: 'boolean',\n default: false,\n description: 'Install to all detected agents (non-interactive)',\n })\n .option('global', {\n type: 'boolean',\n description: 'Install to global user skills directories',\n })\n .option('yes', {\n type: 'boolean',\n default: false,\n description: 'Auto-confirm prompts when supported by the skills CLI',\n })\n .option('non-interactive', {\n type: 'boolean',\n default: false,\n description: 'Fail fast instead of waiting for prompts',\n })\n .option('json', {\n type: 'boolean',\n default: false,\n description: 'Print machine-readable install result',\n })\n .option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n })\n .option('ci', {\n type: 'boolean',\n default: false,\n description: 'CI mode (implies non-interactive behavior)',\n }),\n async (argv) => {\n try {\n await runSkillAdd({\n apiKey: argv['api-key'],\n source: argv.source,\n target: argv.target,\n allAgents: argv['all-agents'],\n global: argv.global,\n yes: argv.yes,\n nonInteractive: argv['non-interactive'],\n json: argv.json,\n debug: argv.debug,\n ci: argv.ci,\n });\n } catch (error) {\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .demandCommand(1, 'You need to specify a command (add)'),\n () => {},\n )\n .command(\n 'mcp <command>',\n 'Manage direct agent setup',\n (yargs) =>\n yargs\n .command(\n 'add',\n 'Add Nia to coding agents',\n (yargs) =>\n yargs\n .option('api-key', {\n type: 'string',\n alias: 'k',\n description: 'Nia API key (nk_xxx)',\n })\n .option('local', {\n type: 'boolean',\n description: 'Use local mode',\n })\n .option('remote', {\n type: 'boolean',\n description: 'Use remote mode',\n })\n .option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n })\n .option('ci', {\n type: 'boolean',\n default: false,\n description: 'CI mode (skip prompts)',\n }),\n async (argv) => {\n try {\n await runMCPAdd({\n apiKey: argv['api-key'],\n local: argv.local ?? (argv.remote ? false : undefined),\n debug: argv.debug,\n ci: argv.ci,\n });\n } catch (error) {\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .command(\n 'remove',\n 'Remove Nia from coding agents',\n (yargs) =>\n yargs.option('debug', {\n type: 'boolean',\n default: false,\n description: 'Enable debug logging',\n }),\n async (argv) => {\n try {\n await runMCPRemove({ debug: argv.debug });\n } catch (error) {\n printCliError(error);\n process.exit(1);\n }\n },\n )\n .demandCommand(1, 'You need to specify a command (add or remove)'),\n () => {},\n )\n .help()\n .version()\n .strict();\n\ncli.parse();\n"],"mappings":";;;;;;;;;;;;;AAEA,OAAO,WAAW;AAClB,SAAS,eAAe;AAOxB,IAAM,gBAAgB,QAAQ,QAAQ,MAAM,KAAK;AAEjD,SAAS,cAAc,OAAsB;AAC3C,MAAI,iBAAiB,OAAO;AAC1B,YAAQ,MAAM,UAAU,MAAM,OAAO,EAAE;AACvC;AAAA,EACF;AAEA,UAAQ,MAAM,UAAU,KAAK;AAC/B;AAEA,IAAM,MAAM,MAAM,QAAQ,QAAQ,IAAI,CAAC,EACpC,WAAW,YAAY,EACvB,MAAM,wBAAwB,EAC9B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ACd,UAAI;AACF,cAAM,aAAa,EAAE,OAAO,KAAK,MAAM,CAAC;AAAA,MAC1C,SAAS,OAAO;AACd,sBAAc,KAAK;AACnB,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,IACF;AAAA,EACF,EACC,cAAc,GAAG,+CAA+C;AAAA,EACrE,MAAM;AAAA,EAAC;AACT,EACC,KAAK,EACL,QAAQ,EACR,OAAO;AAEV,IAAI,MAAM;","names":["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.27",
12
+ version: "0.1.29",
13
13
  description: "CLI wizard to install Nia to your coding agents",
14
14
  packageManager: "pnpm@10.30.3",
15
15
  type: "module",
@@ -4002,86 +4002,71 @@ function runSkillsInstall2(params) {
4002
4002
  }
4003
4003
 
4004
4004
  // src/agent-guide.ts
4005
- var AGENT_GUIDE_MARKDOWN = [
4006
- "# Nia Agent Onboarding (Headless)",
4007
- "",
4008
- "Use this flow when an agent cannot complete browser-based setup.",
4009
- "",
4010
- "## Base URL",
4011
- "",
4012
- "`https://apigcp.trynia.ai/v2`",
4013
- "",
4014
- "## New Account",
4015
- "",
4016
- "1. Create account + bootstrap token:",
4017
- "",
4018
- "```bash",
4019
- 'curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/signup" \\',
4020
- ' -H "Content-Type: application/json" \\',
4021
- ` -d '{"email":"agent@example.com","password":"strong-password-123","organization_name":"Agent Org"}'`,
4022
- "```",
4023
- "",
4024
- "2. Exchange bootstrap token for API key:",
4025
- "",
4026
- "```bash",
4027
- 'curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/bootstrap-key" \\',
4028
- ' -H "Content-Type: application/json" \\',
4029
- ` -d '{"bootstrap_token":"<bootstrap-token>"}'`,
4030
- "```",
4031
- "",
4032
- "## Existing Account",
4033
- "",
4034
- "Create API key directly with email/password:",
4035
- "",
4036
- "```bash",
4037
- 'curl -sS -X POST "https://apigcp.trynia.ai/v2/auth/login-key" \\',
4038
- ' -H "Content-Type: application/json" \\',
4039
- ` -d '{"email":"agent@example.com","password":"strong-password-123"}'`,
4040
- "```",
4041
- "",
4042
- "## Install Nia Skill (Non-Interactive)",
4043
- "",
4044
- "Install for all detected agents:",
4045
- "",
4046
- "```bash",
4047
- "npx nia-wizard skill add \\",
4048
- ' --api-key "<nk_api_key>" \\',
4049
- " --source nozomio-labs/nia-skill \\",
4050
- " --all-agents \\",
4051
- " --non-interactive \\",
4052
- " --ci",
4053
- "```",
4054
- "",
4055
- "Install for one target agent:",
4056
- "",
4057
- "```bash",
4058
- "npx nia-wizard skill add \\",
4059
- ' --api-key "<nk_api_key>" \\',
4060
- " --source nozomio-labs/nia-skill \\",
4061
- " --non-interactive \\",
4062
- " --ci",
4063
- "```",
4064
- "",
4065
- "Target pinning example:",
4066
- "",
4067
- "```bash",
4068
- 'npx nia-wizard skill add --api-key "<nk_api_key>" --target codex --non-interactive --ci',
4069
- "```",
4070
- "",
4071
- "Supported `--target` values:",
4072
- "",
4073
- "`amp`, `kimi-cli`, `replit`, `universal`, `antigravity`, `augment`, `claude-code`, `openclaw`, `cline`, `codebuddy`, `codex`, `command-code`, `continue`, `cortex`, `crush`, `cursor`, `droid`, `gemini-cli`, `github-copilot`, `goose`, `junie`, `iflow-cli`, `kilo`, `kiro-cli`, `kode`, `mcpjam`, `mistral-vibe`, `mux`, `opencode`, `openhands`, `pi`, `qoder`, `qwen-code`, `roo`, `trae`, `trae-cn`, `windsurf`, `zencoder`, `neovate`, `pochi`, `adal`",
4074
- "",
4075
- "## Command",
4076
- "",
4077
- "Print this guide any time:",
4078
- "",
4079
- "```bash",
4080
- "npx nia-wizard agent-guide",
4081
- "```"
4082
- ].join("\n");
4005
+ function getAgentGuideMarkdown() {
4006
+ return [
4007
+ "# Nia Agent Onboarding Prompt",
4008
+ "",
4009
+ "Run this workflow when you are setting up Nia for the user from an external coding agent session.",
4010
+ "",
4011
+ "## Goal",
4012
+ "",
4013
+ "Install the Nia CLI, direct the user to retrieve their API key manually, ask them to paste the key back to you, then finish CLI authentication and skill setup.",
4014
+ "",
4015
+ "## Steps",
4016
+ "",
4017
+ "1. Check whether Bun is installed:",
4018
+ "",
4019
+ "```bash",
4020
+ "bun --version",
4021
+ "```",
4022
+ "",
4023
+ "2. Install `@nozomioai/nia@latest` globally:",
4024
+ "",
4025
+ "- If `bun --version` succeeds, run:",
4026
+ "",
4027
+ "```bash",
4028
+ "bun add -g @nozomioai/nia@latest",
4029
+ "```",
4030
+ "",
4031
+ "- If `bun --version` fails, run:",
4032
+ "",
4033
+ "```bash",
4034
+ "npm install -g @nozomioai/nia@latest",
4035
+ "```",
4036
+ "",
4037
+ "3. Tell the user to open this URL and sign in:",
4038
+ "",
4039
+ "`https://app.trynia.ai/api-keys`",
4040
+ "",
4041
+ "4. Tell the user to create an API key on that page and copy the `nk_...` token.",
4042
+ "",
4043
+ "5. Ask the user to paste the API key back into the agent chat or session.",
4044
+ "",
4045
+ "6. After the user provides the key, configure the CLI:",
4046
+ "",
4047
+ "```bash",
4048
+ "nia auth login --api-key <nk_api_key>",
4049
+ "```",
4050
+ "",
4051
+ "7. Configure Nia skills:",
4052
+ "",
4053
+ "```bash",
4054
+ "nia skill --all",
4055
+ "```",
4056
+ "",
4057
+ "## Agent Message Template",
4058
+ "",
4059
+ "Send the user a message like this:",
4060
+ "",
4061
+ "> I need your Nia API key to finish setup. Please open https://app.trynia.ai/api-keys, sign in, create a key, and paste the `nk_...` value here. Once you send it, I will finish the setup for you.",
4062
+ "",
4063
+ "## Expected Result",
4064
+ "",
4065
+ "`nia` is installed, authenticated with the user-provided API key, and `nia skill --all` has completed."
4066
+ ].join("\n");
4067
+ }
4083
4068
  function printAgentGuide() {
4084
- console.log(AGENT_GUIDE_MARKDOWN);
4069
+ console.log(getAgentGuideMarkdown());
4085
4070
  }
4086
4071
 
4087
4072
  export {
@@ -4101,6 +4086,7 @@ export {
4101
4086
  runMCPAdd,
4102
4087
  runMCPRemove,
4103
4088
  runSkillAdd,
4089
+ getAgentGuideMarkdown,
4104
4090
  printAgentGuide
4105
4091
  };
4106
- //# sourceMappingURL=chunk-ZAV3ACJJ.js.map
4092
+ //# sourceMappingURL=chunk-CUR7WEDI.js.map