Merge branch 'grumpy-reviewer'

This commit is contained in:
Chris Wanstrath 2026-02-19 13:28:18 -08:00
commit fd5a6f8ed7

View File

@ -323,6 +323,38 @@ program
if (opts.save !== false) await saveChanges(session.worktree)
})
// ── sandlot review <branch> ──────────────────────────────────────────
program
.command("review")
.argument("<branch>", "branch name")
.option("-p, --print", "print the review to stdout instead of launching interactive mode")
.description("Launch an interactive grumpy code review for a branch")
.action(async (branch: string, opts: { print?: boolean }) => {
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 })
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."
if (opts.print) {
spin.text = "Running review…"
const output = await vm.claude(session.worktree, { print: prompt })
spin.stop()
if (output) process.stdout.write(output + "\n")
} else {
spin.succeed("Session ready")
await vm.claude(session.worktree, { prompt })
}
})
// ── sandlot close <branch> ───────────────────────────────────────────
const closeAction = async (branch: string) => {