anvil pr diff <num> — print PR diff to stdout #11
open
Opened by cole.christensen@gmail.com
Links
No links yet.
Problem
No way to print a PR’s diff from the CLI. Common use: pipe to `less`, AI tools, custom review scripts.
Proposal
`anvil pr diff ` prints the unified diff between PR base and head to stdout.
Implementation options:
- Fetch base + head from the remote, run local `git diff base..head`. No new server endpoint; relies on `anvil repo clone` setup or working git remote.
- New server endpoint `GET /api/v1/:org/:repo/pulls/:n.diff` returning the diff.
Option 1 is cheapest and good for the v1.
Acceptance criteria
- `anvil pr diff ` prints unified diff to stdout, exits 0
- Works in a repo cloned via `anvil repo clone`
- `–name-only` flag for just file list
- Errors gracefully if not in a repo cwd
Origin
CLI gap audit.