@arkhera30/cli 0.1.2 → 0.1.4
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.js +19 -2
- package/package.json +9 -7
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { Command as Command10 } from "commander";
|
|
5
5
|
import chalk10 from "chalk";
|
|
6
|
+
import { createRequire } from "module";
|
|
6
7
|
|
|
7
8
|
// src/commands/setup.ts
|
|
8
9
|
import { Command } from "commander";
|
|
@@ -212,7 +213,15 @@ function toResult(result) {
|
|
|
212
213
|
}
|
|
213
214
|
async function tryCommand(command, args) {
|
|
214
215
|
try {
|
|
215
|
-
await execa(command, args, { reject: false });
|
|
216
|
+
const result = await execa(command, args, { reject: false });
|
|
217
|
+
return result.exitCode === 0;
|
|
218
|
+
} catch {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async function commandExists(command) {
|
|
223
|
+
try {
|
|
224
|
+
await execa(command, ["--version"], { reject: false });
|
|
216
225
|
return true;
|
|
217
226
|
} catch {
|
|
218
227
|
return false;
|
|
@@ -279,6 +288,12 @@ async function detectRuntime(preferred) {
|
|
|
279
288
|
if (hasPodman) {
|
|
280
289
|
return createRuntime("podman");
|
|
281
290
|
}
|
|
291
|
+
const podmanInstalled = await commandExists("podman");
|
|
292
|
+
if (podmanInstalled) {
|
|
293
|
+
throw new Error(
|
|
294
|
+
"Podman is installed but `podman compose` is not working.\n\nFix options:\n 1. Ensure your Podman machine is running: podman machine start\n 2. Install podman-compose: pip3 install podman-compose\n 3. Upgrade Podman to v5+: brew upgrade podman\n"
|
|
295
|
+
);
|
|
296
|
+
}
|
|
282
297
|
throw new Error(
|
|
283
298
|
"No container runtime found.\n\nHorus requires Docker or Podman with the Compose plugin.\n\nInstall one of:\n - Docker Desktop: https://www.docker.com/products/docker-desktop/\n - Podman Desktop: https://podman-desktop.io/\n"
|
|
284
299
|
);
|
|
@@ -1760,8 +1775,10 @@ backupCommand.command("restore <file>").description("Restore Horus data from a b
|
|
|
1760
1775
|
});
|
|
1761
1776
|
|
|
1762
1777
|
// src/index.ts
|
|
1778
|
+
var require2 = createRequire(import.meta.url);
|
|
1779
|
+
var { version } = require2("../package.json");
|
|
1763
1780
|
var program = new Command10();
|
|
1764
|
-
program.name("horus").description("CLI for managing the Horus Docker Compose stack").version(
|
|
1781
|
+
program.name("horus").description("CLI for managing the Horus Docker Compose stack").version(version);
|
|
1765
1782
|
program.addCommand(setupCommand);
|
|
1766
1783
|
program.addCommand(upCommand);
|
|
1767
1784
|
program.addCommand(downCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkhera30/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "CLI for managing the Horus AI development stack",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,20 +9,22 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsup src/index.ts --format esm --dts",
|
|
11
11
|
"dev": "tsup src/index.ts --format esm --watch",
|
|
12
|
-
"typecheck": "tsc --noEmit"
|
|
12
|
+
"typecheck": "tsc --noEmit",
|
|
13
|
+
"test": "vitest run"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
15
16
|
"@inquirer/prompts": "^7.0.0",
|
|
17
|
+
"chalk": "^5.0.0",
|
|
16
18
|
"commander": "^12.0.0",
|
|
17
19
|
"execa": "^8.0.0",
|
|
18
|
-
"
|
|
19
|
-
"yaml": "^2.0.0"
|
|
20
|
-
"ora": "^8.0.0"
|
|
20
|
+
"ora": "^8.0.0",
|
|
21
|
+
"yaml": "^2.0.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
|
-
"
|
|
24
|
+
"@types/node": "^20.0.0",
|
|
24
25
|
"tsup": "^8.0.0",
|
|
25
|
-
"
|
|
26
|
+
"typescript": "^5.4.0",
|
|
27
|
+
"vitest": "^4.0.18"
|
|
26
28
|
},
|
|
27
29
|
"engines": {
|
|
28
30
|
"node": ">=18"
|