Append our help to the end of claude help

This commit is contained in:
Jared Miller 2026-01-28 17:49:43 -05:00
parent eb3bad289a
commit 8c5c9f99f0
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -35,30 +35,15 @@ function parseArgs(): Args {
} else if (args[i] === "--secret" && i + 1 < args.length) {
secret = args[i + 1] as string;
i += 2;
} else if (args[i] === "--help") {
// If we have a secret, show brief info then pass through to claude
if (secret) {
console.log("claude-remote: PTY wrapper for claude CLI");
console.log("Streaming to:", server);
console.log("\nPassing through to claude:\n");
claudeArgs.push(args[i] as string);
i++;
} else {
// No secret configured, just show our help
console.log("claude-remote: PTY wrapper for claude CLI");
console.log("\nConfiguration:");
console.log(
" CLAUDE_REMOTE_SECRET - authentication secret (required)",
);
console.log(
" CLAUDE_REMOTE_SERVER - server URL (default: ws://localhost:7200/ws)",
);
console.log("\nFlags:");
console.log(" --secret <secret> - override CLAUDE_REMOTE_SECRET");
console.log(" --server <url> - override CLAUDE_REMOTE_SERVER");
console.log("\nAll other arguments are passed through to claude.");
process.exit(0);
}
} else if (args[i] === "--help" || args[i] === "-h") {
// Run claude --help synchronously and append our section
const result = Bun.spawnSync(["claude", "--help"]);
process.stdout.write(result.stdout);
console.log("Remote:");
console.log(" --server <url> WebSocket server URL (env: CLAUDE_REMOTE_SERVER)");
console.log(" --secret <secret> Authentication secret (env: CLAUDE_REMOTE_SECRET)");
console.log("");
process.exit(result.exitCode);
} else if (args[i] === "--") {
// -- separator is optional, just skip it
claudeArgs.push(...args.slice(i + 1));