claude-code-rehab 1.0.2 → 1.1.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.
- package/index.mjs +6 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -118,12 +118,15 @@ const server = createServer(async (req, res) => {
|
|
|
118
118
|
function tryListen(port) {
|
|
119
119
|
server.listen(port, "0.0.0.0", () => {
|
|
120
120
|
const ips = getLocalIPs();
|
|
121
|
+
const url = `http://localhost:${port}`;
|
|
121
122
|
console.log("\n Claude Code Rehab — Ready!\n");
|
|
122
|
-
console.log(`
|
|
123
|
-
console.log(`
|
|
124
|
-
ips.forEach(ip => console.log(` http://${ip}:${port}`));
|
|
123
|
+
console.log(` Local: ${url}`);
|
|
124
|
+
ips.forEach(ip => console.log(` Network: http://${ip}:${port}`));
|
|
125
125
|
console.log(`\n Phone? Same WiFi, open the Network URL above.`);
|
|
126
126
|
console.log("\n Ctrl+C to stop\n");
|
|
127
|
+
// Auto-open browser
|
|
128
|
+
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
|
|
129
|
+
import("child_process").then(cp => cp.exec(`${cmd} ${url}`)).catch(() => {});
|
|
127
130
|
});
|
|
128
131
|
server.on("error", (e) => {
|
|
129
132
|
if (e.code === "EADDRINUSE" && port < PORT + 10) {
|