Release grok-build-hud v0.3.0: Claude-HUD-style same-window status for Grok Build
Multi-line tmux strip (context, quota, tools, todos, git), theme sync with Grok UI, full/essential/minimal presets, one-shot installer, EN+ZH docs, and 40 unit tests.
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* CLI entry — works from repo, npm link, or global install.
|
||||
*/
|
||||
import { pathToFileURL } from "node:url";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { existsSync } from "node:fs";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const candidates = [
|
||||
path.join(__dirname, "..", "dist", "src", "index.js"),
|
||||
path.join(__dirname, "..", "dist", "index.js"),
|
||||
];
|
||||
|
||||
const entry = candidates.find((p) => existsSync(p));
|
||||
if (!entry) {
|
||||
console.error(
|
||||
"grok-build-hud: build missing. Run: npm install && npm run build",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const mod = await import(pathToFileURL(entry).href);
|
||||
const code = await mod.runCli(process.argv.slice(2));
|
||||
process.exit(typeof code === "number" ? code : 0);
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Start Grok in THIS terminal with multi-line HUD (tmux, same window).
|
||||
*/
|
||||
import { pathToFileURL } from "node:url";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { existsSync } from "node:fs";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const entry = path.join(__dirname, "..", "dist", "src", "index.js");
|
||||
if (!existsSync(entry)) {
|
||||
console.error(
|
||||
"grok-hud-run: build missing. Run: npm install && npm run build",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const mod = await import(pathToFileURL(entry).href);
|
||||
// ensure updater + full HUD then enter same-window mode
|
||||
await mod.runCli(["--dashboard-start"]);
|
||||
await mod.runCli(["--once", "--follow-active", "--no-color"]);
|
||||
const code = await mod.runCli(["--run-in-terminal", ...process.argv.slice(2)]);
|
||||
process.exit(typeof code === "number" ? code : 0);
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Short alias: grok-hud [status|run|stop|theme|…]
|
||||
*/
|
||||
import { pathToFileURL } from "node:url";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { existsSync } from "node:fs";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const entry = path.join(__dirname, "..", "dist", "src", "index.js");
|
||||
if (!existsSync(entry)) {
|
||||
console.error("grok-hud: build missing. Run: npm install && npm run build");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const mod = await import(pathToFileURL(entry).href);
|
||||
const argv = process.argv.slice(2);
|
||||
const head = argv[0];
|
||||
let mapped = argv;
|
||||
|
||||
if (head === "stop") mapped = ["--dashboard-stop"];
|
||||
else if (head === "run") mapped = ["--run-in-terminal", ...argv.slice(1)];
|
||||
else if (head === "status" || head === undefined) {
|
||||
mapped = ["--once", "--follow-active", "--no-color", ...argv.slice(head ? 1 : 0)];
|
||||
} else if (head === "theme") {
|
||||
mapped = ["--theme", argv[1] || "auto", ...argv.slice(2)];
|
||||
} else if (head === "preset") {
|
||||
mapped = ["--preset", argv[1] || "full", ...argv.slice(2)];
|
||||
} else if (head === "start") {
|
||||
mapped = ["--dashboard-start"];
|
||||
} else if (head === "install") {
|
||||
mapped = ["--install-dashboard"];
|
||||
}
|
||||
|
||||
const code = await mod.runCli(mapped);
|
||||
process.exit(typeof code === "number" ? code : 0);
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
import { pathToFileURL } from "node:url";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const entry = path.join(__dirname, "..", "dist", "src", "hook.js");
|
||||
await import(pathToFileURL(entry).href);
|
||||
Reference in New Issue
Block a user