@xevy/cli 0.1.5 → 0.1.6
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 +9 -12
- package/bin/xevy.mjs +21 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,9 +10,13 @@ npx @xevy/cli # open pi with the Xevy extension loaded
|
|
|
10
10
|
## `xevy setup`
|
|
11
11
|
|
|
12
12
|
1. Installs the **pi agent** if it isn't already on your PATH.
|
|
13
|
-
2.
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
2. Installs the Xevy extensions:
|
|
14
|
+
- **`xevy-core.ts`** (shared UI + setup/context), **`xevy-model.ts`** (the
|
|
15
|
+
`xevy/*` models), and **`xevy-mcp.ts`** (the MCP→pi tool bridge) into pi's
|
|
16
|
+
**global** dir `~/.pi/agent/extensions/`, so they load in *every* pi session.
|
|
17
|
+
- **`xevy.ts`** (tools + workflow commands) into **`~/.xevy/extensions/`**.
|
|
18
|
+
3. Asks for your **API key** (reuses an already-saved one if present) and prints a
|
|
19
|
+
**direct link to the API-keys tab** to generate one, then stores it in
|
|
16
20
|
`~/.config/xevy/credentials` (mode `600`, never printed).
|
|
17
21
|
|
|
18
22
|
The API-keys link opens **Settings → Profile → API keys** directly:
|
|
@@ -20,21 +24,14 @@ The API-keys link opens **Settings → Profile → API keys** directly:
|
|
|
20
24
|
|
|
21
25
|
## `xevy`
|
|
22
26
|
|
|
23
|
-
Opens pi, loading
|
|
24
|
-
|
|
27
|
+
Opens pi, loading `~/.xevy/extensions` via `pi -e …` (pi also auto-loads the
|
|
28
|
+
global dir, so core + model + MCP come along). Extra arguments are forwarded to pi:
|
|
25
29
|
|
|
26
30
|
```bash
|
|
27
31
|
xevy # interactive pi session with Xevy
|
|
28
32
|
xevy "summarise this repo" # forwards the prompt to pi
|
|
29
33
|
```
|
|
30
34
|
|
|
31
|
-
## `xevy pi` (alternative)
|
|
32
|
-
|
|
33
|
-
Installs the split **model + MCP** extensions (`xevy-model.ts`, `xevy-mcp.ts`)
|
|
34
|
-
into pi's own extensions dir and authenticates over **OAuth** (`/login xevy`) —
|
|
35
|
-
no API key. Use this instead of `setup` if you prefer OAuth and the hosted
|
|
36
|
-
`xevy/*` models + MCP tool bridge.
|
|
37
|
-
|
|
38
35
|
## Options
|
|
39
36
|
|
|
40
37
|
```
|
package/bin/xevy.mjs
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @xevy/cli — the `xevy` command.
|
|
4
4
|
*
|
|
5
|
-
* xevy setup Install the pi agent (if missing)
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* xevy pi
|
|
9
|
-
* extensions dir, authenticated via OAuth.
|
|
5
|
+
* xevy setup Install the pi agent (if missing); install the Xevy extensions
|
|
6
|
+
* (core + model + MCP globally, xevy.ts into ~/.xevy/extensions);
|
|
7
|
+
* and store your API key.
|
|
8
|
+
* xevy Open pi with the Xevy extensions.
|
|
10
9
|
*
|
|
11
|
-
* `xevy setup`
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* `xevy setup` fetches the extensions from the server and asks for an API key
|
|
11
|
+
* (with a direct link to the exact page to generate one), stored in
|
|
12
|
+
* ~/.config/xevy/credentials. Then `xevy` launches pi with them.
|
|
14
13
|
*/
|
|
15
14
|
import { spawnSync } from "node:child_process";
|
|
16
15
|
import fs from "node:fs";
|
|
@@ -40,12 +39,9 @@ const CREDENTIALS_DIR = path.join(
|
|
|
40
39
|
);
|
|
41
40
|
const CREDENTIALS_FILE = path.join(CREDENTIALS_DIR, "credentials");
|
|
42
41
|
|
|
43
|
-
//
|
|
42
|
+
// pi's global extensions dir — core + model + MCP are installed here so they
|
|
43
|
+
// load in every pi session.
|
|
44
44
|
const PI_EXTENSION_DIR = path.join(os.homedir(), ".pi", "agent", "extensions");
|
|
45
|
-
const PI_EXTENSIONS = [
|
|
46
|
-
{ file: "xevy-model.ts", marker: "xevyModelExtension" },
|
|
47
|
-
{ file: "xevy-mcp.ts", marker: "xevyMcpExtension" },
|
|
48
|
-
];
|
|
49
45
|
|
|
50
46
|
function apiKeysUrl(base) {
|
|
51
47
|
// Direct link to the API keys tab (Profile → API keys), reachable without a
|
|
@@ -71,8 +67,7 @@ function usage() {
|
|
|
71
67
|
console.log(`Xevy CLI
|
|
72
68
|
|
|
73
69
|
xevy Open pi with the Xevy extensions in ~/.xevy/extensions
|
|
74
|
-
xevy setup [--base u] Install pi (if missing) + the Xevy
|
|
75
|
-
xevy pi [--base u] (alt) Install the split model + MCP extensions over OAuth
|
|
70
|
+
xevy setup [--base u] Install pi (if missing) + the Xevy extensions, store your API key
|
|
76
71
|
|
|
77
72
|
Options:
|
|
78
73
|
--base <url> Xevy host (default: XEVY_BASE or ${DEFAULT_BASE})
|
|
@@ -95,9 +90,9 @@ function parseArgv(argv) {
|
|
|
95
90
|
if (first === "-h" || first === "--help" || first === "help") return { command: "help", base };
|
|
96
91
|
if (first === "-v" || first === "--version") return { command: "version", base };
|
|
97
92
|
|
|
98
|
-
if (first === "setup"
|
|
93
|
+
if (first === "setup") {
|
|
99
94
|
args.shift();
|
|
100
|
-
const opts = { command:
|
|
95
|
+
const opts = { command: "setup", base, piArgs: [] };
|
|
101
96
|
while (args.length > 0) {
|
|
102
97
|
const a = args.shift();
|
|
103
98
|
if (a === "--base") {
|
|
@@ -106,7 +101,7 @@ function parseArgv(argv) {
|
|
|
106
101
|
opts.base = v.replace(/\/$/, "");
|
|
107
102
|
continue;
|
|
108
103
|
}
|
|
109
|
-
die(`Unknown option for \`xevy
|
|
104
|
+
die(`Unknown option for \`xevy setup\`: ${a}. Try \`xevy --help\`.`);
|
|
110
105
|
}
|
|
111
106
|
return opts;
|
|
112
107
|
}
|
|
@@ -246,8 +241,10 @@ async function setup(opts) {
|
|
|
246
241
|
// double-load: if it were also in ~/.xevy it'd register ask_question twice.
|
|
247
242
|
// • xevy-model.ts → GLOBAL too, so the xevy/* models are available in every
|
|
248
243
|
// pi session (plain `pi` included), not just via `xevy`.
|
|
244
|
+
// • xevy-mcp.ts → GLOBAL too — the MCP→pi tool bridge (auth reused from
|
|
245
|
+
// the model login), available in every pi session.
|
|
249
246
|
// • xevy.ts → ~/.xevy/extensions (tools/workflow; loaded by `xevy`,
|
|
250
|
-
// which also auto-loads the global dir → core + model come along).
|
|
247
|
+
// which also auto-loads the global dir → core + model + MCP come along).
|
|
251
248
|
await downloadExtension(opts.base, "xevy-core.ts", PI_EXTENSION_DIR, [
|
|
252
249
|
"xevyCoreExtension",
|
|
253
250
|
"registerCommand",
|
|
@@ -256,6 +253,10 @@ async function setup(opts) {
|
|
|
256
253
|
"xevyModelExtension",
|
|
257
254
|
"registerCommand",
|
|
258
255
|
]);
|
|
256
|
+
await downloadExtension(opts.base, "xevy-mcp.ts", PI_EXTENSION_DIR, [
|
|
257
|
+
"xevyMcpExtension",
|
|
258
|
+
"registerCommand",
|
|
259
|
+
]);
|
|
259
260
|
await downloadExtension(opts.base, XEVY_EXTENSION_FILE, XEVY_EXTENSIONS_DIR, [
|
|
260
261
|
"EXTENSION_VERSION",
|
|
261
262
|
"registerCommand",
|
|
@@ -275,7 +276,7 @@ async function setup(opts) {
|
|
|
275
276
|
console.log(`✓ API key stored at ${CREDENTIALS_FILE} (key not shown).`);
|
|
276
277
|
|
|
277
278
|
console.log("\n✓ Setup complete.");
|
|
278
|
-
console.log(" • Xevy models (xevy/auto, xevy/fast, …) are available in any pi session — no /login needed.");
|
|
279
|
+
console.log(" • Xevy models (xevy/auto, xevy/fast, …) + MCP tools are available in any pi session — no /login needed.");
|
|
279
280
|
console.log(" • Run `xevy` to open pi with the Xevy tools + models loaded.");
|
|
280
281
|
if (opts.base !== DEFAULT_BASE) console.log(` • Host: ${opts.base}`);
|
|
281
282
|
}
|
|
@@ -304,29 +305,12 @@ function open(opts) {
|
|
|
304
305
|
process.exit(r.status ?? 0);
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
async function piSetup(opts) {
|
|
308
|
-
console.log("Setting up the pi agent + Xevy extensions (model + MCP)\n");
|
|
309
|
-
|
|
310
|
-
ensurePi();
|
|
311
|
-
for (const ext of PI_EXTENSIONS) {
|
|
312
|
-
await downloadExtension(opts.base, ext.file, PI_EXTENSION_DIR, [ext.marker, "registerCommand"]);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
console.log("\n✓ pi + Xevy extensions ready.");
|
|
316
|
-
console.log(" • Sign in once: /login xevy — authenticates both the models and the MCP tools.");
|
|
317
|
-
console.log(" • Xevy models: xevy/auto, xevy/fast, xevy/advance, xevy/min, xevy/max, xevy/vision.");
|
|
318
|
-
console.log(" • MCP tools bridge automatically on session start (or run /xevy-mcp).");
|
|
319
|
-
console.log(" • If pi is already running, use /reload to load the extensions.");
|
|
320
|
-
if (opts.base !== DEFAULT_BASE) console.log(` • Source host: ${opts.base}`);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
308
|
async function main() {
|
|
324
309
|
const opts = parseArgv(process.argv.slice(2));
|
|
325
310
|
|
|
326
311
|
if (opts.command === "help") return usage();
|
|
327
312
|
if (opts.command === "version") return console.log(readCliVersion());
|
|
328
313
|
if (opts.command === "setup") return setup(opts);
|
|
329
|
-
if (opts.command === "pi") return piSetup(opts);
|
|
330
314
|
if (opts.command === "open") return open(opts);
|
|
331
315
|
}
|
|
332
316
|
|
package/package.json
CHANGED