From c2a082b7805b522e920e378df06d06c04f52ba8c Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sun, 1 Mar 2026 21:04:03 -0800 Subject: [PATCH] Add optional prompt argument to review command --- src/cli.ts | 1 + src/commands/review.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index d2d034b..7d9a2b4 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -148,6 +148,7 @@ program program .command("review") .argument("", "branch name") + .argument("[prompt]", "additional instructions to append to the review prompt") .option("-p, --print", "print the review to stdout instead of launching interactive mode") .description("Launch an interactive grumpy code review for a branch") .action(reviewAction) diff --git a/src/commands/review.ts b/src/commands/review.ts index df9e860..ab69979 100644 --- a/src/commands/review.ts +++ b/src/commands/review.ts @@ -2,13 +2,14 @@ import * as vm from "../vm.ts" import { spinner } from "../spinner.ts" import { requireSession, saveChanges } from "./helpers.ts" -export async function action(branch: string, opts: { print?: boolean }) { +export async function action(branch: string, extra: string | undefined, opts: { print?: boolean }) { const { session } = await requireSession(branch) const spin = spinner("Starting container", branch) 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." + let 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 (extra) prompt += "\n\n" + extra if (opts.print) { spin.text = "Running review…"