ref:main

feat(pr): add `anvil pr edit` command #8

merged colechristensen cole.christensen@gmail.com wants to merge feat/pr-edit into main
No CI

Summary

Adds anvil pr edit <N> [--title ...] [--body ...] mirroring anvil issue edit. PATCHes /{org}/{name}/pulls/{number} with whichever of title / body are supplied. If neither is given, prints a warning and makes no API call.

Server constraint

PullRequest.update_changeset/2 (anvil repo, lib/anvil/code_review/pull_request.ex:92) only casts :title and :body. Base branch, head branch, and labels are not editable via the existing PATCH endpoint, so they are out of scope here. Widening that would require a separate server-side change.

Verification

This PR’s title and body were themselves written by the new command — the initial pr create used a placeholder title (“TYPO in titl: add anvil pr edit”) and body, and this edit rewrote both. That is the end-to-end test.

  • anvil pr edit <N> --title "..." updates title
  • anvil pr edit <N> --body "..." updates body
  • Both flags combine in a single call
  • Empty invocation prints warning, makes no request (manually checked)
  • anvil pr --help lists the new subcommand
  • cargo build --release, cargo clippy -- -D warnings, cargo test --release all clean

Closes #3

Created Apr 19, 2026 at 02:30 UTC | Merged Apr 19, 2026 at 16:52 UTC by colechristensen cole.christensen@gmail.com