Handle when claude isnt installed

This commit is contained in:
Jared Miller 2026-01-28 17:51:55 -05:00
parent 8c5c9f99f0
commit 4ab2078afd
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -38,12 +38,16 @@ function parseArgs(): Args {
} else if (args[i] === "--help" || args[i] === "-h") { } else if (args[i] === "--help" || args[i] === "-h") {
// Run claude --help synchronously and append our section // Run claude --help synchronously and append our section
const result = Bun.spawnSync(["claude", "--help"]); const result = Bun.spawnSync(["claude", "--help"]);
if (result.success) {
process.stdout.write(result.stdout); process.stdout.write(result.stdout);
console.log("Remote:"); console.log("Remote:");
console.log(" --server <url> WebSocket server URL (env: CLAUDE_REMOTE_SERVER)"); console.log(" --server <url> WebSocket server URL (env: CLAUDE_REMOTE_SERVER)");
console.log(" --secret <secret> Authentication secret (env: CLAUDE_REMOTE_SECRET)"); console.log(" --secret <secret> Authentication secret (env: CLAUDE_REMOTE_SECRET)");
console.log(""); console.log("");
process.exit(result.exitCode); } else {
console.error("Failed to run 'claude --help'. Is claude installed?");
}
process.exit(result.exitCode ?? 0);
} else if (args[i] === "--") { } else if (args[i] === "--") {
// -- separator is optional, just skip it // -- separator is optional, just skip it
claudeArgs.push(...args.slice(i + 1)); claudeArgs.push(...args.slice(i + 1));