Skip to content
Closed
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
8 changes: 7 additions & 1 deletion packages/opencode/src/cli/cmd/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,13 @@ export const RunCommand = cmd({
}

if (args.attach) {
const sdk = createOpencodeClient({ baseUrl: args.attach, directory })
// Build auth headers from env vars (same as attach.ts)
const password = process.env.OPENCODE_SERVER_PASSWORD
const username = process.env.OPENCODE_SERVER_USERNAME ?? "opencode"
const headers = password
? { Authorization: `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}` }
: undefined
const sdk = createOpencodeClient({ baseUrl: args.attach, directory, headers })
return await execute(sdk)
}

Expand Down
Loading