Skip to content

Commit ea66789

Browse files
OpeOginninexxeln
andauthored
fix(auth): add username option for basic auth in RunCommand (anomalyco#25600)
Co-authored-by: Shoubhit Dash <shoubhit2005@gmail.com>
1 parent d04d3dd commit ea66789

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • packages/opencode/src/cli/cmd

packages/opencode/src/cli/cmd/run.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ export const RunCommand = effectCmd({
276276
type: "string",
277277
describe: "basic auth password (defaults to OPENCODE_SERVER_PASSWORD)",
278278
})
279+
.option("username", {
280+
alias: ["u"],
281+
type: "string",
282+
describe: "basic auth username (defaults to OPENCODE_SERVER_USERNAME or 'opencode')",
283+
})
279284
.option("dir", {
280285
type: "string",
281286
describe: "directory to run in, path on remote server if attaching",
@@ -657,7 +662,7 @@ export const RunCommand = effectCmd({
657662
}
658663

659664
if (args.attach) {
660-
const headers = ServerAuth.headers({ password: args.password })
665+
const headers = ServerAuth.headers({ password: args.password, username: args.username })
661666
const sdk = createOpencodeClient({ baseUrl: args.attach, directory, headers })
662667
return await execute(sdk)
663668
}

0 commit comments

Comments
 (0)