fix(cli): read OPENCODE_PASSWORD for explicit server auth

This commit is contained in:
Dax Raad
2026-07-03 13:34:12 -04:00
parent aad8d90dd1
commit c6a52a39b5
@@ -18,7 +18,7 @@ export default Runtime.handler(Commands, (input) =>
return yield* Effect.fail(new Error("--server and --standalone cannot be combined")) return yield* Effect.fail(new Error("--server and --standalone cannot be combined"))
const transport = yield* Effect.gen(function* () { const transport = yield* Effect.gen(function* () {
if (server !== undefined) { if (server !== undefined) {
const password = process.env["OPENCODE_SERVER_PASSWORD"] const password = process.env["OPENCODE_PASSWORD"]
return { return {
url: server, url: server,
headers: password ? { authorization: "Basic " + btoa("opencode:" + password) } : undefined, headers: password ? { authorization: "Basic " + btoa("opencode:" + password) } : undefined,