Skip to content

Commit a89a143

Browse files
committed
feat: add --dir flag to run command for attach mode
1 parent eaa0826 commit a89a143

File tree

1 file changed

+8
-1
lines changed
  • packages/opencode/src/cli/cmd

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export const RunCommand = cmd({
8383
type: "string",
8484
describe: "attach to a running opencode server (e.g., http://localhost:4096)",
8585
})
86+
.option("dir", {
87+
type: "string",
88+
describe: "directory to run in (only used with --attach)",
89+
})
8690
.option("port", {
8791
type: "number",
8892
describe: "port for the local server (defaults to random port if no value provided)",
@@ -276,7 +280,10 @@ export const RunCommand = cmd({
276280
}
277281

278282
if (args.attach) {
279-
const sdk = createOpencodeClient({ baseUrl: args.attach })
283+
const sdk = createOpencodeClient({
284+
baseUrl: args.attach,
285+
directory: args.dir,
286+
})
280287

281288
const sessionID = await (async () => {
282289
if (args.continue) {

0 commit comments

Comments
 (0)