Compare commits

...

2 Commits

Author SHA1 Message Date
c2a082b780 Add optional prompt argument to review command 2026-03-01 21:04:03 -08:00
7c9a5a8672 0.0.13 2026-02-27 09:26:24 -08:00
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@because/sandlot",
"version": "0.0.12",
"version": "0.0.13",
"description": "Sandboxed, branch-based development with Claude",
"type": "module",
"bin": {

View File

@ -148,6 +148,7 @@ program
program
.command("review")
.argument("<branch>", "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)

View File

@ -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…"