diff options
| author | Netanel Draiman <[email protected]> | 2025-10-14 19:04:32 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-10-14 11:04:32 -0500 |
| commit | 4d019430e25708cdbf44cc1efa364e9c8e7a4886 (patch) | |
| tree | 8a1e1ee6018bbd031c2280bacea827f127730dc6 /packages | |
| parent | 37e6c8342f1f63a95918a71ac78130b9d10d1103 (diff) | |
| download | opencode-4d019430e25708cdbf44cc1efa364e9c8e7a4886.tar.gz opencode-4d019430e25708cdbf44cc1efa364e9c8e7a4886.zip | |
feat(cli): add session option to attach command (#3167)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/attach.ts | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/packages/opencode/src/cli/cmd/attach.ts b/packages/opencode/src/cli/cmd/attach.ts index 5a0c23ea2..868585b05 100644 --- a/packages/opencode/src/cli/cmd/attach.ts +++ b/packages/opencode/src/cli/cmd/attach.ts @@ -10,10 +10,16 @@ export const AttachCommand = cmd({ command: "attach <server>", describe: "attach to a running opencode server", builder: (yargs) => - yargs.positional("server", { - type: "string", - describe: "http://localhost:4096", - }), + yargs + .positional("server", { + type: "string", + describe: "http://localhost:4096", + }) + .option("session", { + alias: ["s"], + describe: "session id to continue", + type: "string", + }), handler: async (args) => { let cmd = [] as string[] const tui = Bun.embeddedFiles.find((item) => (item as File).name.includes("tui")) as File @@ -36,6 +42,9 @@ export const AttachCommand = cmd({ await $`go build -o ${binaryName} ./main.go`.cwd(dir) cmd = [path.join(dir, binaryName)] } + if (args.session) { + cmd.push("--session", args.session) + } Log.Default.info("tui", { cmd, }) |
