mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
feat(cli): add session option to attach command (#3167)
This commit is contained in:
parent
37e6c8342f
commit
4d019430e2
1 changed files with 13 additions and 4 deletions
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue