@arkhera30/cli 0.1.12 → 0.1.14
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/compose/docker-compose.yml +1 -1
- package/dist/index.js +39 -32
- package/package.json +1 -1
|
@@ -137,7 +137,7 @@ services:
|
|
|
137
137
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
138
138
|
interval: 30s
|
|
139
139
|
timeout: 10s
|
|
140
|
-
start_period:
|
|
140
|
+
start_period: 600s
|
|
141
141
|
retries: 3
|
|
142
142
|
|
|
143
143
|
# ── Vault MCP ──────────────────────────────────────────────────────────────
|
package/dist/index.js
CHANGED
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { Command as Command10 } from "commander";
|
|
5
5
|
import chalk10 from "chalk";
|
|
6
|
-
import { createRequire } from "module";
|
|
7
6
|
|
|
8
7
|
// src/commands/setup.ts
|
|
9
8
|
import { Command as Command2 } from "commander";
|
|
10
9
|
import chalk2 from "chalk";
|
|
11
10
|
import ora2 from "ora";
|
|
12
11
|
import { execSync } from "child_process";
|
|
13
|
-
import { existsSync as
|
|
12
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
|
|
14
13
|
import { join as join4 } from "path";
|
|
15
14
|
import { input, confirm, number, select, password } from "@inquirer/prompts";
|
|
16
15
|
|
|
17
16
|
// src/lib/config.ts
|
|
18
|
-
import { readFileSync as readFileSync2, writeFileSync, mkdirSync, existsSync, readdirSync, statSync } from "fs";
|
|
17
|
+
import { readFileSync as readFileSync2, writeFileSync, mkdirSync, existsSync as existsSync2, readdirSync, statSync } from "fs";
|
|
19
18
|
import { resolve, join as pathJoin, relative } from "path";
|
|
20
19
|
import { homedir as homedir2 } from "os";
|
|
21
20
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
@@ -23,11 +22,21 @@ import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
|
23
22
|
// src/lib/constants.ts
|
|
24
23
|
import { homedir } from "os";
|
|
25
24
|
import { join, dirname } from "path";
|
|
26
|
-
import { readFileSync } from "fs";
|
|
25
|
+
import { readFileSync, existsSync } from "fs";
|
|
27
26
|
import { fileURLToPath } from "url";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
function findPackageJson() {
|
|
28
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
while (dir !== dirname(dir)) {
|
|
30
|
+
const candidate = join(dir, "package.json");
|
|
31
|
+
if (existsSync(candidate)) {
|
|
32
|
+
const pkg2 = JSON.parse(readFileSync(candidate, "utf-8"));
|
|
33
|
+
if (pkg2.name === "@arkhera30/cli") return candidate;
|
|
34
|
+
}
|
|
35
|
+
dir = dirname(dir);
|
|
36
|
+
}
|
|
37
|
+
throw new Error("Could not find @arkhera30/cli package.json");
|
|
38
|
+
}
|
|
39
|
+
var pkg = JSON.parse(readFileSync(findPackageJson(), "utf-8"));
|
|
31
40
|
var CLI_VERSION = pkg.version;
|
|
32
41
|
var HORUS_DIR = join(homedir(), ".horus");
|
|
33
42
|
var CONFIG_PATH = join(HORUS_DIR, "config.yaml");
|
|
@@ -72,10 +81,10 @@ function ensureHorusDir() {
|
|
|
72
81
|
mkdirSync(HORUS_DIR, { recursive: true });
|
|
73
82
|
}
|
|
74
83
|
function configExists() {
|
|
75
|
-
return
|
|
84
|
+
return existsSync2(CONFIG_PATH);
|
|
76
85
|
}
|
|
77
86
|
function loadConfig() {
|
|
78
|
-
if (!
|
|
87
|
+
if (!existsSync2(CONFIG_PATH)) {
|
|
79
88
|
return defaultConfig();
|
|
80
89
|
}
|
|
81
90
|
const raw = readFileSync2(CONFIG_PATH, "utf-8");
|
|
@@ -131,13 +140,13 @@ function discoverRepoDirs(rootDir, maxDepth = 4) {
|
|
|
131
140
|
} catch {
|
|
132
141
|
continue;
|
|
133
142
|
}
|
|
134
|
-
if (
|
|
143
|
+
if (existsSync2(pathJoin(full, ".git"))) {
|
|
135
144
|
repoDirs.add(dir);
|
|
136
145
|
}
|
|
137
146
|
walk(full, depth + 1);
|
|
138
147
|
}
|
|
139
148
|
}
|
|
140
|
-
if (
|
|
149
|
+
if (existsSync2(rootDir)) {
|
|
141
150
|
walk(rootDir, 0);
|
|
142
151
|
}
|
|
143
152
|
return [...repoDirs];
|
|
@@ -509,7 +518,7 @@ Run '${runtime.name} compose logs' from ~/.horus/ to investigate.`
|
|
|
509
518
|
}
|
|
510
519
|
|
|
511
520
|
// src/lib/compose.ts
|
|
512
|
-
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as
|
|
521
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2, existsSync as existsSync3 } from "fs";
|
|
513
522
|
import { join as join2, dirname as dirname2 } from "path";
|
|
514
523
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
515
524
|
var __filename = fileURLToPath2(import.meta.url);
|
|
@@ -520,7 +529,7 @@ function getBundledComposePath() {
|
|
|
520
529
|
join2(__dirname, "..", "compose", "docker-compose.yml")
|
|
521
530
|
];
|
|
522
531
|
for (const candidate of candidates) {
|
|
523
|
-
if (
|
|
532
|
+
if (existsSync3(candidate)) {
|
|
524
533
|
return candidate;
|
|
525
534
|
}
|
|
526
535
|
}
|
|
@@ -536,7 +545,7 @@ function applyPodmanUserOverride(compose) {
|
|
|
536
545
|
);
|
|
537
546
|
}
|
|
538
547
|
function composeFileExists() {
|
|
539
|
-
return
|
|
548
|
+
return existsSync3(COMPOSE_PATH);
|
|
540
549
|
}
|
|
541
550
|
function installComposeFile(runtime) {
|
|
542
551
|
ensureHorusDir();
|
|
@@ -553,7 +562,7 @@ import { Command } from "commander";
|
|
|
553
562
|
import chalk from "chalk";
|
|
554
563
|
import ora from "ora";
|
|
555
564
|
import { checkbox } from "@inquirer/prompts";
|
|
556
|
-
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, mkdirSync as mkdirSync2, existsSync as
|
|
565
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync3, mkdirSync as mkdirSync2, existsSync as existsSync4 } from "fs";
|
|
557
566
|
import { join as join3 } from "path";
|
|
558
567
|
import { homedir as homedir3 } from "os";
|
|
559
568
|
import { execa as execa2 } from "execa";
|
|
@@ -561,16 +570,16 @@ function detectInstalledClients() {
|
|
|
561
570
|
const detected = [];
|
|
562
571
|
const home = homedir3();
|
|
563
572
|
const claudeDesktopDir = join3(home, "Library", "Application Support", "Claude");
|
|
564
|
-
if (
|
|
573
|
+
if (existsSync4(claudeDesktopDir)) {
|
|
565
574
|
detected.push("claude-desktop");
|
|
566
575
|
}
|
|
567
576
|
const claudeCodeDir = join3(home, ".claude");
|
|
568
|
-
if (
|
|
577
|
+
if (existsSync4(claudeCodeDir)) {
|
|
569
578
|
detected.push("claude-code");
|
|
570
579
|
}
|
|
571
580
|
const cursorDir = join3(home, ".cursor");
|
|
572
581
|
const cursorAppDir = join3(home, "Library", "Application Support", "Cursor");
|
|
573
|
-
if (
|
|
582
|
+
if (existsSync4(cursorDir) || existsSync4(cursorAppDir)) {
|
|
574
583
|
detected.push("cursor");
|
|
575
584
|
}
|
|
576
585
|
return detected;
|
|
@@ -588,7 +597,7 @@ function getConfigPath(target) {
|
|
|
588
597
|
}
|
|
589
598
|
function mergeAndWriteConfig(configPath, mcpServers) {
|
|
590
599
|
let existing = {};
|
|
591
|
-
if (
|
|
600
|
+
if (existsSync4(configPath)) {
|
|
592
601
|
try {
|
|
593
602
|
const raw = readFileSync4(configPath, "utf-8");
|
|
594
603
|
existing = JSON.parse(raw);
|
|
@@ -1039,7 +1048,7 @@ ${example("forge-registry")}
|
|
|
1039
1048
|
mkdirSync3(dataDir, { recursive: true });
|
|
1040
1049
|
for (const repo of reposToClone) {
|
|
1041
1050
|
const spinner = ora2(`Cloning ${repo.label}...`).start();
|
|
1042
|
-
if (
|
|
1051
|
+
if (existsSync5(join4(repo.dest, ".git"))) {
|
|
1043
1052
|
spinner.succeed(`${repo.label} already cloned`);
|
|
1044
1053
|
continue;
|
|
1045
1054
|
}
|
|
@@ -1433,7 +1442,7 @@ import { Command as Command7 } from "commander";
|
|
|
1433
1442
|
import chalk7 from "chalk";
|
|
1434
1443
|
import ora6 from "ora";
|
|
1435
1444
|
import { select as select2, confirm as confirm3 } from "@inquirer/prompts";
|
|
1436
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, readdirSync as readdirSync2, existsSync as
|
|
1445
|
+
import { readFileSync as readFileSync5, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4, readdirSync as readdirSync2, existsSync as existsSync6 } from "fs";
|
|
1437
1446
|
import { join as join5 } from "path";
|
|
1438
1447
|
import { createHash } from "crypto";
|
|
1439
1448
|
import { stringify as stringifyYaml2, parse as parseYaml2 } from "yaml";
|
|
@@ -1442,7 +1451,7 @@ function ensureSnapshotsDir() {
|
|
|
1442
1451
|
mkdirSync4(SNAPSHOTS_DIR, { recursive: true });
|
|
1443
1452
|
}
|
|
1444
1453
|
function composeFileHash() {
|
|
1445
|
-
if (!
|
|
1454
|
+
if (!existsSync6(COMPOSE_PATH)) return "";
|
|
1446
1455
|
const content = readFileSync5(COMPOSE_PATH, "utf-8");
|
|
1447
1456
|
return createHash("sha256").update(content).digest("hex").slice(0, 12);
|
|
1448
1457
|
}
|
|
@@ -1477,7 +1486,7 @@ function saveSnapshot(images) {
|
|
|
1477
1486
|
return filePath;
|
|
1478
1487
|
}
|
|
1479
1488
|
function listSnapshots() {
|
|
1480
|
-
if (!
|
|
1489
|
+
if (!existsSync6(SNAPSHOTS_DIR)) return [];
|
|
1481
1490
|
return readdirSync2(SNAPSHOTS_DIR).filter((f) => f.endsWith(".yaml")).sort().reverse().map((f) => {
|
|
1482
1491
|
const file = join5(SNAPSHOTS_DIR, f);
|
|
1483
1492
|
const snapshot = parseYaml2(readFileSync5(file, "utf-8"));
|
|
@@ -1689,7 +1698,7 @@ var updateCommand = new Command7("update").description("Update Horus to the late
|
|
|
1689
1698
|
import { Command as Command8 } from "commander";
|
|
1690
1699
|
import chalk8 from "chalk";
|
|
1691
1700
|
import { execSync as execSync2 } from "child_process";
|
|
1692
|
-
import { existsSync as
|
|
1701
|
+
import { existsSync as existsSync7, accessSync, statfsSync, constants } from "fs";
|
|
1693
1702
|
import { join as join6 } from "path";
|
|
1694
1703
|
function symbol(status) {
|
|
1695
1704
|
switch (status) {
|
|
@@ -1756,7 +1765,7 @@ function checkConfig() {
|
|
|
1756
1765
|
};
|
|
1757
1766
|
}
|
|
1758
1767
|
function checkComposeFile() {
|
|
1759
|
-
if (
|
|
1768
|
+
if (existsSync7(COMPOSE_PATH)) {
|
|
1760
1769
|
return { status: "pass", label: "Compose file", message: "Compose file installed (~/.horus/docker-compose.yml)" };
|
|
1761
1770
|
}
|
|
1762
1771
|
return {
|
|
@@ -1797,7 +1806,7 @@ function checkPort(port, serviceName) {
|
|
|
1797
1806
|
}
|
|
1798
1807
|
}
|
|
1799
1808
|
function checkDataDir(dataDir) {
|
|
1800
|
-
if (!
|
|
1809
|
+
if (!existsSync7(dataDir)) {
|
|
1801
1810
|
return {
|
|
1802
1811
|
status: "warn",
|
|
1803
1812
|
label: "Data directory",
|
|
@@ -1818,7 +1827,7 @@ function checkDataDir(dataDir) {
|
|
|
1818
1827
|
}
|
|
1819
1828
|
}
|
|
1820
1829
|
function checkDiskSpace(dataDir) {
|
|
1821
|
-
const checkDir =
|
|
1830
|
+
const checkDir = existsSync7(dataDir) ? dataDir : join6(dataDir, "..");
|
|
1822
1831
|
try {
|
|
1823
1832
|
const stats = statfsSync(checkDir);
|
|
1824
1833
|
const freeBytes = stats.bfree * stats.bsize;
|
|
@@ -1950,7 +1959,7 @@ import { Command as Command9 } from "commander";
|
|
|
1950
1959
|
import chalk9 from "chalk";
|
|
1951
1960
|
import ora7 from "ora";
|
|
1952
1961
|
import { confirm as confirm4 } from "@inquirer/prompts";
|
|
1953
|
-
import { mkdirSync as mkdirSync5, statSync as statSync2, existsSync as
|
|
1962
|
+
import { mkdirSync as mkdirSync5, statSync as statSync2, existsSync as existsSync8, writeFileSync as writeFileSync5 } from "fs";
|
|
1954
1963
|
import { join as join7, basename } from "path";
|
|
1955
1964
|
import { execSync as execSync3 } from "child_process";
|
|
1956
1965
|
import { stringify as stringifyYaml3 } from "yaml";
|
|
@@ -2051,7 +2060,7 @@ async function restoreBackup(file, yes) {
|
|
|
2051
2060
|
console.log(chalk9.bold("Horus Restore"));
|
|
2052
2061
|
console.log(chalk9.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
2053
2062
|
console.log("");
|
|
2054
|
-
if (!
|
|
2063
|
+
if (!existsSync8(file)) {
|
|
2055
2064
|
console.log(chalk9.red(`Backup file not found: ${file}`));
|
|
2056
2065
|
process.exit(1);
|
|
2057
2066
|
}
|
|
@@ -2140,10 +2149,8 @@ backupCommand.command("restore <file>").description("Restore Horus data from a b
|
|
|
2140
2149
|
});
|
|
2141
2150
|
|
|
2142
2151
|
// src/index.ts
|
|
2143
|
-
var require2 = createRequire(import.meta.url);
|
|
2144
|
-
var { version } = require2("../package.json");
|
|
2145
2152
|
var program = new Command10();
|
|
2146
|
-
program.name("horus").description("CLI for managing the Horus Docker Compose stack").version(
|
|
2153
|
+
program.name("horus").description("CLI for managing the Horus Docker Compose stack").version(CLI_VERSION);
|
|
2147
2154
|
program.addCommand(setupCommand);
|
|
2148
2155
|
program.addCommand(upCommand);
|
|
2149
2156
|
program.addCommand(downCommand);
|