@8gi-foundation/8gent-code 0.6.0

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.pdf ADDED
Binary file
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ import { execFileSync, spawnSync } from "child_process";
3
+ import { join, dirname } from "path";
4
+ import { existsSync } from "fs";
5
+ import { fileURLToPath } from "url";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const cli = join(__dirname, "..", "dist", "cli.js");
9
+
10
+ function hasBun() {
11
+ try {
12
+ execFileSync("bun", ["--version"], { stdio: "ignore" });
13
+ return true;
14
+ } catch {
15
+ return false;
16
+ }
17
+ }
18
+
19
+ if (!hasBun()) {
20
+ console.error(`
21
+ 8gent requires Bun to run. Install it with one command:
22
+
23
+ Mac / Linux:
24
+ curl -fsSL https://bun.sh/install | bash
25
+
26
+ Windows (PowerShell):
27
+ powershell -c "irm bun.sh/install.ps1 | iex"
28
+
29
+ Then restart your terminal and run: 8gent
30
+ `);
31
+ process.exit(1);
32
+ }
33
+
34
+ if (!existsSync(cli)) {
35
+ console.error(`
36
+ 8gent build not found at ${cli}
37
+ Run: npm run build
38
+ `);
39
+ process.exit(1);
40
+ }
41
+
42
+ const result = spawnSync("bun", [cli, ...process.argv.slice(2)], {
43
+ stdio: "inherit",
44
+ env: process.env,
45
+ });
46
+
47
+ process.exit(result.status ?? 0);