add review command for interactive grumpy code review of a branch

This commit is contained in:
Chris Wanstrath 2026-02-19 13:23:11 -08:00
parent e860d6ff57
commit 47dc4941b1

View File

@ -308,6 +308,29 @@ program
if (opts.save !== false) await saveChanges(session.worktree) if (opts.save !== false) await saveChanges(session.worktree)
}) })
// ── sandlot review <branch> ──────────────────────────────────────────
program
.command("review")
.argument("<branch>", "branch name")
.description("Launch an interactive grumpy code review for a branch")
.action(async (branch: string) => {
const root = await git.repoRoot()
const session = await state.getSession(root, branch)
if (!session) {
console.error(`✖ No session found for branch "${branch}".`)
process.exit(1)
}
const spin = spinner("Starting container")
await vm.ensure((msg) => { spin.text = msg })
spin.succeed("Session ready")
const prompt = "You're a grumpy old senior software engineer. Take a look at the diff between this branch and main, then let me know your thoughts. My co-worker made these changes."
await vm.claude(session.worktree, { prompt })
})
// ── sandlot close <branch> ─────────────────────────────────────────── // ── sandlot close <branch> ───────────────────────────────────────────
const closeAction = async (branch: string) => { const closeAction = async (branch: string) => {