@xevy/cli 0.1.7 → 0.1.9

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.
Files changed (3) hide show
  1. package/README.md +43 -10
  2. package/bin/xevy.mjs +115 -33
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -45,7 +45,8 @@ This walks you through everything:
45
45
 
46
46
  1. Installs the **pi agent** if it isn't already on your PATH.
47
47
  2. Installs the Xevy extensions (see [`xevy setup`](#xevy-setup) for details).
48
- 3. Asks for your **API key**. When prompted, open the link it prints — it takes you
48
+ 3. Installs the Xevy **SDLC skills and MCP server** for Cursor, Claude Code, and Codex by default (via `@xevy/skills`). Pass repeatable `--agent <name>` flags to target any other agent supported by the underlying installers.
49
+ 4. Asks for your **API key**. When prompted, open the link it prints — it takes you
49
50
  straight to **Settings → Profile → API keys** at
50
51
  <https://xevy.ai/settings?section=profile&tab=api> — click **Create key**, copy the
51
52
  key, and paste it back into the terminal. Your key is saved to
@@ -62,6 +63,15 @@ That's it — you're set up. The sections below are reference for when you need
62
63
 
63
64
  ## Upgrading
64
65
 
66
+ Keep the Xevy extensions and SDLC skills current (run after Xevy releases):
67
+
68
+ ```bash
69
+ xevy check # newer skills or missing coding-agent targets?
70
+ xevy update # refresh the pi extensions + the SDLC skills
71
+ ```
72
+
73
+ To upgrade the CLI binary itself:
74
+
65
75
  ```bash
66
76
  npm update -g @xevy/cli # or re-run: npm install -g @xevy/cli
67
77
  ```
@@ -77,10 +87,26 @@ npm update -g @xevy/cli # or re-run: npm install -g @xevy/cli
77
87
  3. Asks for your **API key** (reuses an already-saved one if present) and prints a
78
88
  **direct link to the API-keys tab** to generate one, then stores it in
79
89
  `~/.config/xevy/credentials` (mode `600`, never printed).
90
+ 4. Installs the Xevy **SDLC skills and MCP server configuration** for Cursor,
91
+ Claude Code, and Codex by default (delegates to `@xevy/skills`). pi keeps its
92
+ extension-backed MCP connection, so the coding-agent configuration does not
93
+ conflict with pi. An integration hiccup only warns; it never aborts the setup
94
+ that already succeeded.
80
95
 
81
96
  The API-keys link opens **Settings → Profile → API keys** directly:
82
97
  `https://xevy.ai/settings?section=profile&tab=api`.
83
98
 
99
+ ## `xevy update` / `xevy check`
100
+
101
+ ```bash
102
+ xevy update # re-download the pi extensions + update the SDLC skills
103
+ xevy check # report skill updates or missing agent targets (exit 2 = update needed)
104
+ ```
105
+
106
+ `update` refreshes the extensions from the server and the skills + MCP configuration
107
+ via `@xevy/skills`; your saved API key is left untouched. These commands accept
108
+ `--base <url>` for self-hosted hosts and repeatable `--agent <name>` overrides.
109
+
84
110
  ## `xevy`
85
111
 
86
112
  Opens pi, loading `~/.xevy/extensions` via `pi -e …` (pi also auto-loads the
@@ -95,24 +121,31 @@ xevy "summarise this repo" # forwards the prompt to pi
95
121
 
96
122
  ```
97
123
  --base <url> Xevy host (default: XEVY_BASE or https://xevy.ai)
124
+ -a, --agent <name> Coding-agent target (repeatable; default: cursor, claude-code, codex)
98
125
  -v, --version Print the CLI version
99
126
  -h, --help Show help
100
127
  ```
101
128
 
102
129
  ## Skills & MCP for other agents
103
130
 
104
- `@xevy/cli` sets up the [pi](https://github.com/badlogic/pi-mono) agent. If you'd
105
- rather use **Cursor, Claude Code, or one of [50+ other agents](https://github.com/vercel-labs/skills#supported-agents)**,
106
- install the Xevy **SDLC skills** and the **Xevy MCP server** with the sibling
107
- package instead:
131
+ `xevy setup` installs the Xevy **SDLC skills and MCP server** for **Cursor, Claude
132
+ Code, and Codex** by default. Target any identifier supported by
133
+ [`skills`](https://github.com/vercel-labs/skills#supported-agents) and `add-mcp` with
134
+ repeatable flags, for example `xevy setup -a windsurf -a codex`.
135
+
136
+ After installation, complete OAuth in each client. For Codex, run
137
+ `codex mcp login xevy` and restart the session. In Claude Code, run `/mcp` and
138
+ authenticate `xevy`. In Cursor, use Settings → MCP → `xevy` → Connect. Other
139
+ clients expose an equivalent MCP connect/OAuth action.
140
+
141
+ You can also run the sibling package directly:
108
142
 
109
143
  ```bash
110
- npx @xevy/skills # skills + MCP, global by default
111
- npx @xevy/skills --project # into the current repo instead
144
+ npx @xevy/skills mcp # register the Xevy MCP server, global by default
145
+ npx @xevy/skills # or: skills + MCP together
112
146
  ```
113
147
 
114
- Then connect MCP over OAuth (Cursor: Settings → MCP → `xevy`; Claude Code: browser
115
- sign-in on first use). See the [`@xevy/skills` README](../xevy-skills/README.md) for
116
- the full command list, per-agent flags, and manual install steps.
148
+ See the [`@xevy/skills` README](../xevy-skills/README.md) for the full command list,
149
+ per-agent flags, and manual install steps.
117
150
 
118
151
  Docs: <https://xevy.ai/docs/mcp>
package/bin/xevy.mjs CHANGED
@@ -4,7 +4,10 @@
4
4
  *
5
5
  * xevy setup Install the pi agent (if missing); install the Xevy extensions
6
6
  * (core + model + MCP globally, xevy.ts into ~/.xevy/extensions);
7
- * and store your API key.
7
+ * install the Xevy SDLC skills + MCP for coding agents (via
8
+ * @xevy/skills); and store your API key.
9
+ * xevy update Refresh the pi extensions + coding-agent integration.
10
+ * xevy check Report skill updates or missing coding-agent targets.
8
11
  * xevy Open pi with the Xevy extensions.
9
12
  *
10
13
  * `xevy setup` fetches the extensions from the server and asks for an API key
@@ -49,6 +52,10 @@ function apiKeysUrl(base) {
49
52
  return `${base}/settings?section=profile&tab=api`;
50
53
  }
51
54
 
55
+ function configuredAgentLabel(agents) {
56
+ return agents.length > 0 ? agents.join(", ") : "Cursor, Claude Code, Codex";
57
+ }
58
+
52
59
  function readCliVersion() {
53
60
  try {
54
61
  const pkg = JSON.parse(fs.readFileSync(path.join(pkgRoot, "package.json"), "utf-8"));
@@ -67,15 +74,20 @@ function usage() {
67
74
  console.log(`Xevy CLI
68
75
 
69
76
  xevy Open pi with the Xevy extensions in ~/.xevy/extensions
70
- xevy setup [--base u] Install pi (if missing) + the Xevy extensions, store your API key
77
+ xevy setup [--base u] Install pi + extensions + coding-agent skills/MCP, store your API key
78
+ xevy update [--base u] Refresh the pi extensions + coding-agent skills/MCP
79
+ xevy check [--base u] Report skill updates or missing coding-agent targets
71
80
 
72
81
  Options:
73
82
  --base <url> Xevy host (default: XEVY_BASE or ${DEFAULT_BASE})
83
+ -a, --agent <name> Target any supported coding agent (repeatable)
84
+ Default: cursor, claude-code, codex
74
85
  -v, --version Print the CLI version
75
86
  -h, --help Show this help
76
87
 
77
88
  Examples:
78
89
  npx @xevy/cli setup
90
+ npx @xevy/cli update
79
91
  npx @xevy/cli
80
92
 
81
93
  Install globally to drop the npx prefix:
@@ -94,9 +106,9 @@ function parseArgv(argv) {
94
106
  if (first === "-h" || first === "--help" || first === "help") return { command: "help", base };
95
107
  if (first === "-v" || first === "--version") return { command: "version", base };
96
108
 
97
- if (first === "setup") {
98
- args.shift();
99
- const opts = { command: "setup", base, piArgs: [] };
109
+ if (first === "setup" || first === "update" || first === "check") {
110
+ const command = args.shift();
111
+ const opts = { command, base, agents: [], piArgs: [] };
100
112
  while (args.length > 0) {
101
113
  const a = args.shift();
102
114
  if (a === "--base") {
@@ -105,7 +117,13 @@ function parseArgv(argv) {
105
117
  opts.base = v.replace(/\/$/, "");
106
118
  continue;
107
119
  }
108
- die(`Unknown option for \`xevy setup\`: ${a}. Try \`xevy --help\`.`);
120
+ if (a === "-a" || a === "--agent") {
121
+ const v = args.shift();
122
+ if (!v) die("Missing value for --agent");
123
+ if (!opts.agents.includes(v)) opts.agents.push(v);
124
+ continue;
125
+ }
126
+ die(`Unknown option for \`xevy ${command}\`: ${a}. Try \`xevy --help\`.`);
109
127
  }
110
128
  return opts;
111
129
  }
@@ -141,6 +159,27 @@ function ensurePi() {
141
159
  }
142
160
  }
143
161
 
162
+ // Install/update the portable Xevy skills and MCP configuration through the
163
+ // published @xevy/skills package. pi keeps its own extension-backed MCP path;
164
+ // the MCP install here targets external coding agents and does not conflict
165
+ // with pi. Non-fatal: core pi setup has already succeeded, so an integration
166
+ // hiccup warns with the manual command instead of aborting.
167
+ function installAgentIntegration(base, agents, packageCommand) {
168
+ const args = ["--yes", "@xevy/skills", packageCommand, "-y"];
169
+ if (base !== DEFAULT_BASE) args.push("--base", base);
170
+ for (const agent of agents) args.push("-a", agent);
171
+ const label = `npx @xevy/skills ${packageCommand} (coding-agent skills + MCP)`;
172
+ console.log(`→ ${label}`);
173
+ const command = isWindows ? "npx.cmd" : "npx";
174
+ const r = spawnSync(command, args, { stdio: "inherit", shell: isWindows, env: process.env });
175
+ if (r.error || r.status !== 0) {
176
+ console.warn(`⚠ Could not configure coding agents (${r.error ? r.error.message : `exit ${r.status}`}).`);
177
+ console.warn(" Configure them later with: npx @xevy/skills -y");
178
+ return false;
179
+ }
180
+ return true;
181
+ }
182
+
144
183
  async function downloadExtension(base, file, destDir, markers) {
145
184
  const url = `${base}/${file}`;
146
185
  console.log(`→ Downloading ${url}`);
@@ -232,39 +271,33 @@ async function promptNewApiKey(base) {
232
271
  return token;
233
272
  }
234
273
 
274
+ // Download all four Xevy pi extensions to their install dirs. Shared by `setup`
275
+ // and `update` so the two never drift.
276
+ // • xevy-core.ts → pi's GLOBAL extensions dir (shared base: ask_question
277
+ // tool + setup/context). Global so it loads in EVERY pi session and is
278
+ // always present for xevy.ts (which requires it). Global-only avoids a
279
+ // double-load: if it were also in ~/.xevy it'd register ask_question twice.
280
+ // • xevy-model.ts → GLOBAL too, so the xevy/* models are available in every
281
+ // pi session (plain `pi` included), not just via `xevy`.
282
+ // • xevy-mcp.ts → GLOBAL too — the MCP→pi tool bridge (auth reused from
283
+ // the model login), available in every pi session.
284
+ // • xevy.ts → ~/.xevy/extensions (tools/workflow; loaded by `xevy`,
285
+ // which also auto-loads the global dir → core + model + MCP come along).
286
+ async function downloadAllExtensions(base) {
287
+ await downloadExtension(base, "xevy-core.ts", PI_EXTENSION_DIR, ["xevyCoreExtension", "registerCommand"]);
288
+ await downloadExtension(base, "xevy-model.ts", PI_EXTENSION_DIR, ["xevyModelExtension", "registerCommand"]);
289
+ await downloadExtension(base, "xevy-mcp.ts", PI_EXTENSION_DIR, ["xevyMcpExtension", "registerCommand"]);
290
+ await downloadExtension(base, XEVY_EXTENSION_FILE, XEVY_EXTENSIONS_DIR, ["EXTENSION_VERSION", "registerCommand"]);
291
+ }
292
+
235
293
  async function setup(opts) {
236
294
  console.log("Setting up Xevy for pi\n");
237
295
 
238
296
  // 1. Ensure pi is installed (installs it if missing).
239
297
  ensurePi();
240
298
 
241
- // 2. Extensions:
242
- // • xevy-core.ts → pi's GLOBAL extensions dir (shared base: ask_question
243
- // tool + setup/context). Global so it loads in EVERY pi session and is
244
- // always present for xevy.ts (which requires it). Global-only avoids a
245
- // double-load: if it were also in ~/.xevy it'd register ask_question twice.
246
- // • xevy-model.ts → GLOBAL too, so the xevy/* models are available in every
247
- // pi session (plain `pi` included), not just via `xevy`.
248
- // • xevy-mcp.ts → GLOBAL too — the MCP→pi tool bridge (auth reused from
249
- // the model login), available in every pi session.
250
- // • xevy.ts → ~/.xevy/extensions (tools/workflow; loaded by `xevy`,
251
- // which also auto-loads the global dir → core + model + MCP come along).
252
- await downloadExtension(opts.base, "xevy-core.ts", PI_EXTENSION_DIR, [
253
- "xevyCoreExtension",
254
- "registerCommand",
255
- ]);
256
- await downloadExtension(opts.base, "xevy-model.ts", PI_EXTENSION_DIR, [
257
- "xevyModelExtension",
258
- "registerCommand",
259
- ]);
260
- await downloadExtension(opts.base, "xevy-mcp.ts", PI_EXTENSION_DIR, [
261
- "xevyMcpExtension",
262
- "registerCommand",
263
- ]);
264
- await downloadExtension(opts.base, XEVY_EXTENSION_FILE, XEVY_EXTENSIONS_DIR, [
265
- "EXTENSION_VERSION",
266
- "registerCommand",
267
- ]);
299
+ // 2. Extensions (core + model + MCP globally, xevy.ts into ~/.xevy).
300
+ await downloadAllExtensions(opts.base);
268
301
 
269
302
  // 3. API key — reuse the saved one if present, otherwise ask for a new one.
270
303
  const existing = readStoredToken();
@@ -279,12 +312,59 @@ async function setup(opts) {
279
312
  writeCredentials(opts.base, token);
280
313
  console.log(`✓ API key stored at ${CREDENTIALS_FILE} (key not shown).`);
281
314
 
315
+ // 4. Portable coding-agent integration. With no explicit -a flags, the
316
+ // @xevy/skills package applies its cursor + claude-code + codex defaults.
317
+ const agentIntegrationOk = installAgentIntegration(opts.base, opts.agents, "install");
318
+
282
319
  console.log("\n✓ Setup complete.");
283
320
  console.log(" • Xevy models (xevy/auto, xevy/fast, …) + MCP tools are available in any pi session — no /login needed.");
321
+ console.log(
322
+ agentIntegrationOk
323
+ ? ` • Coding-agent skills + MCP configured for ${configuredAgentLabel(opts.agents)}.`
324
+ : " • Coding-agent integration NOT configured — run `xevy update` to retry.",
325
+ );
326
+ if (agentIntegrationOk) {
327
+ console.log(" • Complete MCP OAuth in each configured client using the instructions above.");
328
+ }
284
329
  console.log(" • Run `xevy` to open pi with the Xevy tools + models loaded.");
330
+ console.log(" • Keep current with `xevy check` / `xevy update`.");
331
+ if (opts.base !== DEFAULT_BASE) console.log(` • Host: ${opts.base}`);
332
+ }
333
+
334
+ // `xevy update` — refresh the pi extensions and portable coding-agent
335
+ // integration. @xevy/skills remains the source of truth; the API key is left
336
+ // as-is.
337
+ async function update(opts) {
338
+ console.log("Updating Xevy\n");
339
+
340
+ // 1. Re-download the pi extensions (they carry the date-stamped versions).
341
+ await downloadAllExtensions(opts.base);
342
+
343
+ // 2. Skills + MCP via @xevy/skills.
344
+ const agentIntegrationOk = installAgentIntegration(opts.base, opts.agents, "update");
345
+
346
+ console.log("\n✓ Update complete.");
347
+ console.log(" • Xevy pi extensions refreshed.");
348
+ console.log(
349
+ agentIntegrationOk
350
+ ? " • Coding-agent skills + MCP updated."
351
+ : " • Coding-agent integration NOT updated — run `npx @xevy/skills update -y` manually.",
352
+ );
285
353
  if (opts.base !== DEFAULT_BASE) console.log(` • Host: ${opts.base}`);
286
354
  }
287
355
 
356
+ // `xevy check` — is a newer skills version available, or is a requested agent
357
+ // target missing? Delegates to @xevy/skills (install stamp + npm/manifest).
358
+ function check(opts) {
359
+ const args = ["--yes", "@xevy/skills", "check"];
360
+ if (opts.base !== DEFAULT_BASE) args.push("--base", opts.base);
361
+ for (const agent of opts.agents) args.push("-a", agent);
362
+ const command = isWindows ? "npx.cmd" : "npx";
363
+ const r = spawnSync(command, args, { stdio: "inherit", shell: isWindows, env: process.env });
364
+ // Preserve @xevy/skills' exit code (0 = current, 2 = update available, …).
365
+ process.exit(r.status ?? (r.error ? 1 : 0));
366
+ }
367
+
288
368
  function open(opts) {
289
369
  if (!hasPi()) {
290
370
  die("pi is not installed. Run `xevy setup` first.");
@@ -315,6 +395,8 @@ async function main() {
315
395
  if (opts.command === "help") return usage();
316
396
  if (opts.command === "version") return console.log(readCliVersion());
317
397
  if (opts.command === "setup") return setup(opts);
398
+ if (opts.command === "update") return update(opts);
399
+ if (opts.command === "check") return check(opts);
318
400
  if (opts.command === "open") return open(opts);
319
401
  }
320
402
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xevy/cli",
3
- "version": "0.1.7",
4
- "description": "Xevy CLI — `xevy setup` installs the pi agent + the Xevy pi extension and stores your API key; `xevy` opens pi with it.",
3
+ "version": "0.1.9",
4
+ "description": "Xevy CLI — `xevy setup` installs pi, Xevy extensions, and coding-agent skills + MCP, then stores your API key; `xevy update`/`xevy check` keep them current; `xevy` opens pi with it.",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "xevy",