mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-30 05:43:55 +00:00
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
31 lines
725 B
TypeScript
31 lines
725 B
TypeScript
import { cmd } from "../cmd"
|
|
import { tui } from "./app"
|
|
|
|
export const AttachCommand = cmd({
|
|
command: "attach <url>",
|
|
describe: "attach to a running opencode server",
|
|
builder: (yargs) =>
|
|
yargs
|
|
.positional("url", {
|
|
type: "string",
|
|
describe: "http://localhost:4096",
|
|
demandOption: true,
|
|
})
|
|
.option("dir", {
|
|
type: "string",
|
|
description: "directory to run in",
|
|
})
|
|
.option("session", {
|
|
alias: ["s"],
|
|
type: "string",
|
|
describe: "session id to continue",
|
|
}),
|
|
handler: async (args) => {
|
|
if (args.dir) process.chdir(args.dir)
|
|
await tui({
|
|
url: args.url,
|
|
args: { sessionID: args.session },
|
|
})
|
|
},
|
|
})
|