Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ This version is optimized for reliability and predictable multi-session behavior
bunx @different-ai/opencode-browser@latest install
```

Supports macOS, Linux, and Windows (Chrome/Edge/Brave/Chromium).


https://github.com/user-attachments/assets/d5767362-fbf3-4023-858b-90f06d9f0b25

Expand Down
18 changes: 17 additions & 1 deletion bin/broker.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ const os = require("os");
const path = require("path");

const BASE_DIR = path.join(os.homedir(), ".opencode-browser");
const SOCKET_PATH = path.join(BASE_DIR, "broker.sock");
const SOCKET_PATH = getBrokerSocketPath();

function getSafePipeName() {
try {
const username = os.userInfo().username || "user";
return `opencode-browser-${username}`.replace(/[^a-zA-Z0-9._-]/g, "_");
} catch {
return "opencode-browser";
}
}

function getBrokerSocketPath() {
const override = process.env.OPENCODE_BROWSER_BROKER_SOCKET;
if (override) return override;
if (process.platform === "win32") return `\\\\.\\pipe\\${getSafePipeName()}`;
return path.join(BASE_DIR, "broker.sock");
}

fs.mkdirSync(BASE_DIR, { recursive: true });

Expand Down
Loading