Skip to content
Open
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
9 changes: 8 additions & 1 deletion packages/opencode/src/cli/cmd/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export const RunCommand = cmd({
type: "string",
describe: "attach to a running opencode server (e.g., http://localhost:4096)",
})
.option("dir", {
type: "string",
describe: "directory to run in (only used with --attach)",
})
.option("port", {
type: "number",
describe: "port for the local server (defaults to random port if no value provided)",
Expand Down Expand Up @@ -276,7 +280,10 @@ export const RunCommand = cmd({
}

if (args.attach) {
const sdk = createOpencodeClient({ baseUrl: args.attach })
const sdk = createOpencodeClient({
baseUrl: args.attach,
directory: args.dir,
})

const sessionID = await (async () => {
if (args.continue) {
Expand Down