-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
33 lines (27 loc) · 1.17 KB
/
Copy pathcli.js
File metadata and controls
33 lines (27 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env node
import { resolve, dirname } from "path";
import { fileURLToPath } from "url";
import { spawnSync } from "child_process";
const __dirname = dirname(fileURLToPath(import.meta.url));
const ROOT = resolve(__dirname, "..");
const cmd = process.argv[2];
const args = process.argv.slice(3);
if (!cmd || cmd === "--help") {
console.log(" Toolchain capability graph\n");
console.log(" Bootstrap: npx @zz-plant/capability-graph seed");
console.log("");
console.log(" Explore: stats export context cap <domain> health profile");
console.log(" Maintain: decay prune prune <id> diff trend");
console.log(" Plan: recs near combos fork insight");
console.log(" Analyze: bottlenecks impact <id> budget <s> <t>");
console.log("");
console.log(" Web: Start the visualizer at http://localhost:3000");
process.exit(0);
}
if (cmd === "web") {
spawnSync("bun", ["run", "dev"], { cwd: ROOT, stdio: "inherit" });
process.exit(0);
}
const enginePath = resolve(ROOT, "src", "engine", "engine.ts");
const result = spawnSync("node", ["--experimental-sqlite", enginePath, cmd, ...args], { stdio: "inherit" });
process.exit(result.status || 0);