claudish 5.12.2 → 5.13.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.
Files changed (3) hide show
  1. package/bin/claudish.cjs +55 -0
  2. package/dist/index.js +2419 -2102
  3. package/package.json +2 -2
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Launcher script: checks for Bun runtime before starting claudish.
4
+ // Claudish uses Bun-specific APIs (bun:ffi for TUI, Bun.spawn, etc.)
5
+ // so it cannot run under Node.js directly.
6
+
7
+ const { execFileSync, execSync } = require("child_process");
8
+ const { resolve } = require("path");
9
+
10
+ function findBun() {
11
+ try {
12
+ const path = execSync("which bun", { encoding: "utf-8" }).trim();
13
+ if (path) return path;
14
+ } catch {}
15
+ // Common install locations
16
+ const candidates = [
17
+ process.env.HOME + "/.bun/bin/bun",
18
+ "/usr/local/bin/bun",
19
+ "/opt/homebrew/bin/bun",
20
+ ];
21
+ for (const c of candidates) {
22
+ try {
23
+ execFileSync(c, ["--version"], { stdio: "ignore" });
24
+ return c;
25
+ } catch {}
26
+ }
27
+ return null;
28
+ }
29
+
30
+ const bun = findBun();
31
+ if (!bun) {
32
+ console.error(`claudish requires the Bun runtime but it was not found.
33
+
34
+ Install Bun (one command):
35
+ curl -fsSL https://bun.sh/install | bash
36
+
37
+ Then retry:
38
+ claudish --version
39
+
40
+ Learn more: https://bun.sh`);
41
+ process.exit(1);
42
+ }
43
+
44
+ // Exec into bun with the real entry point
45
+ const entry = resolve(__dirname, "..", "dist", "index.js");
46
+ try {
47
+ const result = require("child_process").spawnSync(bun, [entry, ...process.argv.slice(2)], {
48
+ stdio: "inherit",
49
+ env: process.env,
50
+ });
51
+ process.exit(result.status ?? 1);
52
+ } catch (err) {
53
+ console.error("Failed to start claudish:", err.message);
54
+ process.exit(1);
55
+ }