garden pr
Manage pull requests
garden prgarden pr checkout
Section titled “garden pr checkout”Check out a pull request’s latest commit
garden pr checkout <number>Move your working copy to the head commit of a pull request, to build, test, or review it locally. The commit is fetched on demand from the server, so checking out someone else’s PR is cheap.
| Flag | Type | Default | Description |
|---|---|---|---|
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr checks
Section titled “garden pr checks”Show CI check status for a pull request
garden pr checks <number>Show the latest CI check results for a pull request’s head revision. Exits non-zero if any check has failed or is still pending, so scripts and agents can gate on it.
| Flag | Type | Default | Description |
|---|---|---|---|
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr close
Section titled “garden pr close”Close a pull request without merging
garden pr close <number>Close a pull request without merging it. If the PR is in
the merge queue, its entry is invalidated. Reopen later
with garden pr reopen.
| Flag | Type | Default | Description |
|---|---|---|---|
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr comment
Section titled “garden pr comment”Comment on a pull request (top-level, inline, or a reply)
garden pr comment <number>Add a comment to a pull request.
Top-level: garden pr comment 7 -b “overall looks good” Inline: garden pr comment 7 –file foo.go –line 42 -b “nil check?” Range: garden pr comment 7 –file foo.go –line 42 –end-line 48 -b “…” Reply: garden pr comment 7 –reply-to <thread> -b “fixed” –resolve
A new comment is unresolved; a reply leaves the thread’s status unchanged unless –resolve/–unresolve is given.
| Flag | Type | Default | Description |
|---|---|---|---|
--attach |
stringArray | — | Attach a local image/video, appended to the body (repeatable) |
-b, --body |
string | — | Comment body (required) |
--col |
int32 | 0 |
Anchor start column (optional) |
--end-col |
int32 | 0 |
End column of the range (optional) |
--end-line |
int32 | 0 |
End line of the range (optional) |
--file |
string | — | Anchor to this file (inline comment) |
--line |
int32 | 0 |
Anchor line (with –file) |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
--reply-to |
string | — | Reply to this thread (a comment id or resource name) |
-R, --repo |
string | — | Repository name (default: current checkout) |
--resolve |
bool | — | Resolve the thread |
--rev |
int32 | 0 |
Anchor to this revision number (0 = head; with –file) |
--unresolve |
bool | — | Unresolve the thread |
garden pr create
Section titled “garden pr create”(not used — push creates PRs in garden)
garden pr creategarden does not create pull requests explicitly.
Pushing creates or updates one PR per commit in your stack:
garden push -m “your change” # commit + push the stack
Each draft commit becomes a PR; re-pushing updates it with a new revision. Set the title/body via the commit message (amend and re-push to change them). After pushing:
garden pr list # see your PRs garden pr view <number> # inspect one garden review <number> # read + review it
garden pr diff
Section titled “garden pr diff”Show a pull request’s diff (latest base → head)
garden pr diff <number>Print a pull request’s changes as a unified diff, for
piping or quick scanning. Use –name-only for just the
changed file paths. For an annotated diff with review threads
inline, use garden review <number>.
| Flag | Type | Default | Description |
|---|---|---|---|
--context |
int32 | 3 |
Context lines around each hunk |
--name-only |
bool | — | Show only the names of changed files |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr edit
Section titled “garden pr edit”Edit a pull request’s reviewers and labels
garden pr edit <number>Add or remove reviewers and labels on a pull request.
A PR’s title and body come from its commit message in garden —
change them by amending the commit and re-pushing, not here.
Reviewers are user slugs (e.g. alice), or full resource names
(e.g. users/alice); labels must already exist in the repo
(create them with garden label create).
| Flag | Type | Default | Description |
|---|---|---|---|
--add-label |
stringSlice | — | Add a label by name; repeatable |
--add-reviewer |
stringSlice | — | Assign a reviewer by user slug (e.g. alice); repeatable |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
--remove-label |
stringSlice | — | Remove a label by name; repeatable |
--remove-reviewer |
stringSlice | — | Unassign a reviewer by user slug; repeatable |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr explain
Section titled “garden pr explain”Scaffold a proof-carrying walkthrough for a PR’s latest revision
garden pr explain <pr>Author a walkthrough — an evidence-backed reading guide reviewers follow instead of re-deriving intent from the diff. It orders the change into blocks; each states what it does and points at proof (a test, command, attachment, a pointer to any code, or a note).
Bare ‘garden pr explain <pr>’ prints a template scaffolded from the diff (one block per file — split, merge, and reorder them freely). Fill it in and pipe it back:
garden pr explain <pr> | edit… | garden pr explain apply <pr> -f -
| Flag | Type | Default | Description |
|---|---|---|---|
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr explain apply
Section titled “garden pr explain apply”Write a walkthrough from a YAML/JSON document
garden pr explain apply <pr>Write (replace) a PR’s walkthrough for its latest revision from a declarative document. Omit –file or pass ‘-’ to read stdin.
Document shape: summary: what this change does + the one thing to know confidence: medium # low | medium | high layout: top-down # top-down | bottom-up | sandwich critical_path: [b2] # block ids to read first blocks: # top-level roots — together they prove the PR
- id: b1 title: parse the plan scope: - { path: cli/plan.go, lines: 90-140 } # whole file if lines omitted intent: what it does and why — the claim attention: review # skim | review | scrutinize risk: low # low | medium | high proof: # one kind per entry - test: plan_test.go::TestParse - command: "go test ./..." - attachment: ./demo.gif # local file, uploaded on apply - pointer: { path: pkg/x.go, lines: 40-80 } # any code that proves it - external: https://ci/run/1 - note: reasoned only unproven: what wasn't verified children: # sub-blocks that prove this block (the tree) - id: b1a title: reject a corrupt plan scope: - { path: cli/plan.go, lines: 145-170 } intent: errors if the body was rewritten instead of verbs flipped attention: scrutinize risk: high proof: - test: plan_test.go::TestRejectsCorruption| Flag | Type | Default | Description |
|---|---|---|---|
-f, --file |
string | — | Walkthrough document (YAML or JSON); omit or ‘-’ to read stdin |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr explain show
Section titled “garden pr explain show”Print a PR’s walkthrough for its latest revision
garden pr explain show <pr>| Flag | Type | Default | Description |
|---|---|---|---|
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr label
Section titled “garden pr label”Add or remove labels on a pull request
garden pr label <number>Add or remove labels on a pull request. With no –add/–remove
flags, lists the PR’s current labels. Labels must already exist in the repo
(create them with garden label create).
| Flag | Type | Default | Description |
|---|---|---|---|
--add |
stringSlice | — | Label to add by name (repeatable) |
--json |
bool | — | Output the PR (with labels) as JSON |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
--remove |
stringSlice | — | Label to remove by name (repeatable) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr list
Section titled “garden pr list”List pull requests
garden pr listAliases: ls
| Flag | Type | Default | Description |
|---|---|---|---|
--author |
string | — | Filter by author (user id) |
--filter |
string | — | AIP-160 filter using PR fields, e.g. ‘state = “OPEN”’ or ‘author = “users/alice”’ |
--json |
bool | — | Output as JSON |
--limit |
int32 | 0 |
max results to return (1-1000; default 50) |
--order-by |
string | — | order by PR fields: base_ref, create_time, update_time, merge_time (append asc or desc) |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
--skip |
int32 | 0 |
skip the first N results (nonnegative; use with –limit) |
-s, --state |
string | open |
Filter by state: open, merged, closed, all |
garden pr merge
Section titled “garden pr merge”Add a pull request to the merge queue
garden pr merge <number>Enqueue a pull request for merging.
The server validates mergeability (owner approval + green checks) before accepting the PR; if it isn’t ready, the blockers are reported and nothing is queued. The merge queue then rebases, re-tests, and lands the PR automatically.
Use –cancel to remove the PR from the queue; that is an
alias of garden queue cancel <number>.
Use –skip-review to merge immediately without review or CI
(a fast-forward “direct push”). It still opens the PR for the
record, then lands it. Requires the repository’s
merge-without-review policy and that your change sits on the
current head — otherwise run garden pull and try again.
| Flag | Type | Default | Description |
|---|---|---|---|
--cancel |
bool | — | Remove the PR from the merge queue instead |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-p, --priority |
int | 0 |
Queue priority (higher merges first) |
-R, --repo |
string | — | Repository name (default: current checkout) |
--skip-review |
bool | — | Merge immediately without review or CI (requires the repo’s merge-without-review policy) |
garden pr open
Section titled “garden pr open”Open a pull request in your browser
garden pr open <number>| Flag | Type | Default | Description |
|---|---|---|---|
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr reopen
Section titled “garden pr reopen”Reopen a closed pull request
garden pr reopen <number>| Flag | Type | Default | Description |
|---|---|---|---|
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr review
Section titled “garden pr review”Approve or comment on a PR
garden pr review <number>| Flag | Type | Default | Description |
|---|---|---|---|
-a, --approve |
bool | — | Approve the pull request |
-b, --body |
string | — | Review message (recorded as a comment) |
-c, --comment |
bool | — | Comment without a verdict (requires –body) |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
garden pr view
Section titled “garden pr view”View a pull request
garden pr view <number>| Flag | Type | Default | Description |
|---|---|---|---|
--json |
bool | — | Output the pull request as JSON |
--materialize-attachments |
bool | true |
Download embedded image attachments and rewrite their refs to local file paths (on by default; –materialize-attachments=false keeps the raw refs) |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
-w, --web |
bool | — | Open the pull request in your browser |
garden pr wait
Section titled “garden pr wait”Block until a pull request meets a condition
garden pr wait <number>Block until a pull request meets one of –for conditions, then print what happened and exit. Meant for agents: push a PR, then wait for a human to respond (or for it to land) instead of polling by hand.
Conditions (–for, comma-separated — any match wins): review a review/comment from someone other than you attention you are added to the PR’s attention set merged the PR merges closed the PR is closed or merged ci all CI checks finish mergeable the PR becomes mergeable (approved, green, no unresolved threads)
If a condition already holds when you connect, it returns immediately — so you never miss feedback that arrived first. Pass –since to ignore pre-existing review/attention activity (–since now = only what happens from here on).
Exit: 0 matched, 124 timed out, 1 the PR reached a terminal state that makes the wait unreachable (e.g. waiting for a review but the PR was closed).
| Flag | Type | Default | Description |
|---|---|---|---|
--for |
string | review |
Condition(s) to wait for, comma-separated (any match): review, attention, merged, closed, ci, mergeable |
--interval |
duration | 3s |
How often to poll |
--json |
bool | — | Emit the wait outcome as JSON |
-o, --org |
string | — | Organization slug (defaults to personal workspace) |
-R, --repo |
string | — | Repository name (default: current checkout) |
--since |
string | — | Only count review/attention activity after this (RFC3339, or ‘now’); default counts pre-existing |
--timeout |
duration | 30m0s |
Give up after this long |