xtrm-cli 2.1.11 → 2.1.16
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/dist/index.cjs +56 -1
- package/dist/index.cjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/install-pi.ts +23 -1
- package/src/commands/install-project.ts +1 -0
- package/src/commands/install.ts +37 -0
- package/test/hooks.test.ts +214 -0
- package/test/install-pi.test.ts +32 -0
- package/cli/src/commands/install-pi.ts +0 -5
package/dist/index.cjs
CHANGED
|
@@ -41264,6 +41264,7 @@ async function bootstrapProjectInit() {
|
|
|
41264
41264
|
}
|
|
41265
41265
|
await runBdInitForProject(projectRoot);
|
|
41266
41266
|
await runGitNexusInitForProject(projectRoot);
|
|
41267
|
+
await syncProjectMcpServers(projectRoot);
|
|
41267
41268
|
}
|
|
41268
41269
|
async function runBdInitForProject(projectRoot) {
|
|
41269
41270
|
console.log(kleur_default.bold("Running beads initialization (bd init)..."));
|
|
@@ -41430,6 +41431,23 @@ var PI_AGENT_DIR = import_path12.default.join((0, import_node_os4.homedir)(), ".
|
|
|
41430
41431
|
function fillTemplate(template, values) {
|
|
41431
41432
|
return template.replace(/\{\{(\w+)\}\}/g, (_, key) => values[key] ?? "");
|
|
41432
41433
|
}
|
|
41434
|
+
function readExistingPiValues(piAgentDir) {
|
|
41435
|
+
const values = {};
|
|
41436
|
+
try {
|
|
41437
|
+
const auth = JSON.parse(require("fs").readFileSync(import_path12.default.join(piAgentDir, "auth.json"), "utf8"));
|
|
41438
|
+
if (auth?.dashscope?.key) values["DASHSCOPE_API_KEY"] = auth.dashscope.key;
|
|
41439
|
+
if (auth?.zai?.key) values["ZAI_API_KEY"] = auth.zai.key;
|
|
41440
|
+
} catch {
|
|
41441
|
+
}
|
|
41442
|
+
try {
|
|
41443
|
+
const models = JSON.parse(require("fs").readFileSync(import_path12.default.join(piAgentDir, "models.json"), "utf8"));
|
|
41444
|
+
if (!values["DASHSCOPE_API_KEY"] && models?.providers?.dashscope?.apiKey) {
|
|
41445
|
+
values["DASHSCOPE_API_KEY"] = models.providers.dashscope.apiKey;
|
|
41446
|
+
}
|
|
41447
|
+
} catch {
|
|
41448
|
+
}
|
|
41449
|
+
return values;
|
|
41450
|
+
}
|
|
41433
41451
|
function isPiInstalled() {
|
|
41434
41452
|
return (0, import_node_child_process.spawnSync)("pi", ["--version"], { encoding: "utf8" }).status === 0;
|
|
41435
41453
|
}
|
|
@@ -41454,9 +41472,14 @@ function createInstallPiCommand() {
|
|
|
41454
41472
|
`));
|
|
41455
41473
|
}
|
|
41456
41474
|
const schema = await import_fs_extra12.default.readJson(import_path12.default.join(piConfigDir, "install-schema.json"));
|
|
41457
|
-
const
|
|
41475
|
+
const existing = readExistingPiValues(PI_AGENT_DIR);
|
|
41476
|
+
const values = { ...existing };
|
|
41458
41477
|
console.log(t.bold(" API Keys\n"));
|
|
41459
41478
|
for (const field of schema.fields) {
|
|
41479
|
+
if (existing[field.key]) {
|
|
41480
|
+
console.log(t.success(` ${sym.ok} ${field.label} [already set]`));
|
|
41481
|
+
continue;
|
|
41482
|
+
}
|
|
41460
41483
|
if (!field.required && !yes) {
|
|
41461
41484
|
const { include } = await (0, import_prompts2.default)({ type: "confirm", name: "include", message: ` Configure ${field.label}? (optional)`, initial: false });
|
|
41462
41485
|
if (!include) continue;
|
|
@@ -41578,6 +41601,14 @@ function isDoltInstalled() {
|
|
|
41578
41601
|
return false;
|
|
41579
41602
|
}
|
|
41580
41603
|
}
|
|
41604
|
+
function isGitnexusInstalled() {
|
|
41605
|
+
try {
|
|
41606
|
+
(0, import_child_process4.execSync)("gitnexus --version", { stdio: "ignore" });
|
|
41607
|
+
return true;
|
|
41608
|
+
} catch {
|
|
41609
|
+
return false;
|
|
41610
|
+
}
|
|
41611
|
+
}
|
|
41581
41612
|
async function needsSettingsSync(repoRoot, target) {
|
|
41582
41613
|
const normalizedTarget = target.replace(/\\/g, "/").toLowerCase();
|
|
41583
41614
|
if (normalizedTarget.includes(".agents/skills")) return false;
|
|
@@ -41652,6 +41683,30 @@ async function runGlobalInstall(flags, installOpts = {}) {
|
|
|
41652
41683
|
}
|
|
41653
41684
|
}
|
|
41654
41685
|
}
|
|
41686
|
+
console.log(t.bold("\n \u2699 gitnexus (code intelligence)"));
|
|
41687
|
+
console.log(t.muted(" GitNexus provides knowledge graph queries for impact analysis, execution flows, and symbol context."));
|
|
41688
|
+
const gitnexusOk = isGitnexusInstalled();
|
|
41689
|
+
if (gitnexusOk) {
|
|
41690
|
+
console.log(t.success(" \u2713 gitnexus already installed\n"));
|
|
41691
|
+
} else {
|
|
41692
|
+
let doInstallGitnexus = effectiveYes;
|
|
41693
|
+
if (!effectiveYes) {
|
|
41694
|
+
const { install } = await (0, import_prompts3.default)({
|
|
41695
|
+
type: "confirm",
|
|
41696
|
+
name: "install",
|
|
41697
|
+
message: "Install gitnexus globally? (recommended for MCP server and CLI tools)",
|
|
41698
|
+
initial: true
|
|
41699
|
+
});
|
|
41700
|
+
doInstallGitnexus = install;
|
|
41701
|
+
}
|
|
41702
|
+
if (doInstallGitnexus) {
|
|
41703
|
+
console.log(t.muted("\n Installing gitnexus..."));
|
|
41704
|
+
(0, import_child_process5.spawnSync)("npm", ["install", "-g", "gitnexus"], { stdio: "inherit" });
|
|
41705
|
+
console.log(t.success(" \u2713 gitnexus installed\n"));
|
|
41706
|
+
} else {
|
|
41707
|
+
console.log(t.muted(" \u2139 Skipped. Install later with: npm install -g gitnexus\n"));
|
|
41708
|
+
}
|
|
41709
|
+
}
|
|
41655
41710
|
const diffTasks = new Listr(
|
|
41656
41711
|
targets.map((target) => ({
|
|
41657
41712
|
title: formatTargetLabel(target),
|