claude-bridge-cli 1.1.0 → 1.1.2
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.
- package/bin/cli.js +7 -3
- package/lib/bridge.js +3 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -17,6 +17,7 @@ Usage:
|
|
|
17
17
|
Options:
|
|
18
18
|
--port <n> HTTP port for the local bridge (default: 8091)
|
|
19
19
|
--host <ip> Bind address (default: 127.0.0.1)
|
|
20
|
+
--token <secret> Bridge password (use the same in the extension). Auto-generated if omitted.
|
|
20
21
|
--cwd <path> Default working directory for Claude (default: current dir)
|
|
21
22
|
--claude-bin <path> Path to claude CLI binary (default: auto-detect)
|
|
22
23
|
--timeout <seconds> Max time for a single Claude call (default: 7200)
|
|
@@ -24,7 +25,7 @@ Options:
|
|
|
24
25
|
Relay options (connect to a remote relay server):
|
|
25
26
|
--relay-url <url> WebSocket URL of the relay server
|
|
26
27
|
--machine <name> Machine name for the relay
|
|
27
|
-
--token <bearer> Machine bearer token
|
|
28
|
+
--token <bearer> Machine bearer token (when using relay, --token is the relay auth)
|
|
28
29
|
--cf-id <id> Cloudflare Access Client ID (optional)
|
|
29
30
|
--cf-secret <secret> Cloudflare Access Client Secret (optional)
|
|
30
31
|
|
|
@@ -80,9 +81,12 @@ function main() {
|
|
|
80
81
|
} : null,
|
|
81
82
|
};
|
|
82
83
|
|
|
83
|
-
// Generate a random local bearer token for bridge ↔ relay-client auth
|
|
84
84
|
const crypto = require("node:crypto");
|
|
85
|
-
|
|
85
|
+
if (config.relay) {
|
|
86
|
+
config.bearerToken = crypto.randomBytes(32).toString("hex");
|
|
87
|
+
} else {
|
|
88
|
+
config.bearerToken = values.token || crypto.randomBytes(32).toString("hex");
|
|
89
|
+
}
|
|
86
90
|
|
|
87
91
|
run(config);
|
|
88
92
|
} else if (command === "install-service") {
|
package/lib/bridge.js
CHANGED
|
@@ -343,12 +343,14 @@ function askClaude(config, { prompt, session_id, images, cwd, plan_mode, allow_t
|
|
|
343
343
|
if (session_id) args.push("--session-id", session_id);
|
|
344
344
|
if (plan_mode) args.push("--plan");
|
|
345
345
|
|
|
346
|
+
const isWin = process.platform === "win32";
|
|
346
347
|
const proc = spawn(config.claudeBin, args, {
|
|
347
348
|
cwd: cwd || config.cwd,
|
|
348
349
|
timeout: config.timeout,
|
|
349
350
|
env: { ...process.env },
|
|
350
351
|
stdio: ["pipe", "pipe", "pipe"],
|
|
351
|
-
detached:
|
|
352
|
+
detached: !isWin,
|
|
353
|
+
shell: isWin,
|
|
352
354
|
});
|
|
353
355
|
|
|
354
356
|
let stdout = "", stderr = "";
|
package/package.json
CHANGED