Make the branch argument optional in the shell command, falling back to a plain VM shell when omitted

This commit is contained in:
Chris Wanstrath 2026-02-20 07:47:49 -08:00
parent ef8e40ecb3
commit de40ddd225

View File

@ -359,9 +359,15 @@ program
program program
.command("shell") .command("shell")
.argument("<branch>", "branch name") .argument("[branch]", "branch name (omit for a plain VM shell)")
.description("Open a shell in the VM at the session's worktree") .description("Open a shell in the VM (at the session's worktree if branch given)")
.action(async (branch: string) => { .action(async (branch?: string) => {
if (!branch) {
await vm.ensure()
await vm.shell()
return
}
const root = await git.repoRoot() const root = await git.repoRoot()
const session = await state.getSession(root, branch) const session = await state.getSession(root, branch)
if (!session) { if (!session) {