add review command for interactive grumpy code review of a branch
This commit is contained in:
parent
e860d6ff57
commit
47dc4941b1
23
src/cli.ts
23
src/cli.ts
|
|
@ -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) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user