From afee01815c287d3995b56762fea4efe2de5d390e Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 19 Feb 2026 13:24:59 -0800 Subject: [PATCH] add `--print` flag to `review` command for non-interactive output --- src/cli.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index aeeb227..1f7810f 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -313,8 +313,9 @@ program program .command("review") .argument("", "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) => { + .action(async (branch: string, opts: { print?: boolean }) => { const root = await git.repoRoot() const session = await state.getSession(root, branch) @@ -325,10 +326,18 @@ program 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 }) + + 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 ───────────────────────────────────────────