Add prompt and print mode options to the open command

This commit is contained in:
Chris Wanstrath 2026-02-19 09:54:21 -08:00
parent dddd4259f0
commit d941af2078

View File

@ -105,8 +105,10 @@ program
program
.command("open")
.argument("<branch>", "branch name")
.argument("[prompt]", "initial prompt for Claude")
.option("-p, --print <prompt>", "run Claude in non-interactive mode with -p")
.description("Re-enter an existing session")
.action(async (branch: string) => {
.action(async (branch: string, prompt: string | undefined, opts: { print?: string }) => {
const root = await git.repoRoot()
const session = await state.getSession(root, branch)
@ -119,7 +121,8 @@ program
await vm.ensure((msg) => { spin.text = msg })
spin.succeed("Session ready")
await vm.claude(session.worktree)
if (opts.print) console.log(`Running prompt…`)
await vm.claude(session.worktree, { prompt, print: opts.print })
})
// ── sandlot close <branch> ───────────────────────────────────────────