Pull Requests
Generated automatically at build time from the madtea repository - do not edit here. Source: docs/reference/pull-requests.md.
CLI Commands
madtea pr body append
Append content to the end of a pull-request body
| Flag | Type | Default | Description |
|---|---|---|---|
--file | string | Read content from file (use - for stdin) |
madtea pr body patch
Apply anchored (old -> new) replacements to a pull-request body
| Flag | Type | Default | Description |
|---|---|---|---|
--file | string | Read replacements JSON from file (use - for stdin) | |
--new | stringArray | [] | Replacement text (repeatable; pairs with –old) |
--old | stringArray | [] | Anchor text to find (repeatable; pairs with –new) |
--replace-all | boolSlice | [] | Replace every occurrence for the corresponding –old/–new pair (repeatable, in order) |
madtea pr body section-replace
Replace the content of a named marked section in a pull-request body
| Flag | Type | Default | Description |
|---|---|---|---|
--ensure | bool | false | Seed the section (append a fresh marked block) if it does not exist yet |
--file | string | Read content from file (use - for stdin) |
madtea pr body task-toggle
Set the one matched checklist line in a pull-request body to a checked state
| Flag | Type | Default | Description |
|---|---|---|---|
--checked | bool | false | Set the matched line to checked (- [x]) |
--unchecked | bool | false | Set the matched line to unchecked (- [ ]) |
madtea pr cancel-merge
Cancel pending auto-merge on a PR
madtea pr checkout
Check out a PR branch locally
madtea pr checks
Show CI/commit status checks for a PR
madtea pr close
Close one or more pull requests
madtea pr comment
Add comment to pull request
| Flag | Type | Default | Description |
|---|---|---|---|
--body | string | Comment text | |
--file | string | Read content from file (use - for stdin) |
madtea pr comment-delete
Delete a PR comment
madtea pr comment-edit
Edit a PR comment (reads from stdin if no text provided)
| Flag | Type | Default | Description |
|---|---|---|---|
--body | string | Comment text | |
--expected-body | string | Expected current comment body; reject the edit if the comment changed (safety check) | |
--file | string | Read content from file (use - for stdin) |
madtea pr comments
List comments on a pull request
madtea pr commits
List commits in a pull request
madtea pr compare
Compare two branches
madtea pr conflicts
Show files with merge conflicts in a PR
madtea pr create
Create a pull request
| Flag | Type | Default | Description |
|---|---|---|---|
--allow-maintainer-edit | bool | false | Allow maintainers to edit the PR (Forgejo) |
--assignee | stringSlice | [] | Assignees by username (can be repeated) |
--base | string | Base branch for the PR (defaults to default branch) | |
--body | string | PR body/description | |
--draft | bool | false | Create as draft pull request |
--file | string | Read content from file (use - for stdin) | |
--fill | bool | false | Autofill title and body from commits (first subject → title, rest → body) |
--fill-first | bool | false | Autofill from first commit only (subject → title, body → body) |
--fill-verbose | bool | false | Autofill with full commit messages (first subject → title, all messages → body) |
--head | string | Head branch for the PR (defaults to current branch) | |
--label | stringSlice | [] | Label names or IDs (can be repeated) |
--milestone | int64 | 0 | Milestone ID |
--reviewer | stringSlice | [] | Request review from users (can be repeated) |
--title | string | PR title |
madtea pr diff
Get PR diff content
| Flag | Type | Default | Description |
|---|---|---|---|
--file | string | Filter diff to specific file path |
madtea pr edit
Edit pull request fields
| Flag | Type | Default | Description |
|---|---|---|---|
--add-assignee | stringSlice | [] | Add assignees (appends to existing) |
--add-label | stringSlice | [] | Add labels by name or ID (appends to existing) |
--add-reviewer | stringSlice | [] | Add reviewers (Gitea only, not Forgejo) |
--assignee | stringSlice | [] | Set assignees (replaces existing) |
--base | string | Change base branch | |
--file | string | Read JSON from file (use - for stdin) | |
--label | stringSlice | [] | Set labels by name or ID (replaces existing) |
--milestone | int64 | 0 | Set milestone ID (0 to clear) |
--remove-assignee | stringSlice | [] | Remove specific assignees |
--remove-label | stringSlice | [] | Remove labels by name or ID |
--remove-milestone | bool | false | Clear the milestone |
--remove-reviewer | stringSlice | [] | Remove reviewers (Gitea only, not Forgejo) |
--state | string | Set state: open or closed | |
--title | string | Set PR title |
madtea pr files
List files changed in a pull request
madtea pr get
Get pull request details
madtea pr is-merged
Check if a PR is merged
madtea pr list
List pull requests
| Flag | Type | Default | Description |
|---|---|---|---|
--author | string | Filter by PR author username | |
--base | string | Filter by target base branch (Gitea only) | |
--label | stringSlice | [] | Filter by label IDs (comma-separated or repeated) |
--limit | int | 0 | Maximum number of items to return (0 = server default) |
--milestone | string | Filter by milestone ID | |
--page | int | 0 | Page number for pagination (0 = first page) |
--sort | string | Sort by: oldest, recentupdate, leastupdate, mostcomment, leastcomment, priority | |
--state | string | open | Filter by state: open, closed, all |
madtea pr merge
Merge a pull request
| Flag | Type | Default | Description |
|---|---|---|---|
--admin | bool | false | Use admin privileges to merge even if checks haven’t passed |
--auto | bool | false | Auto-merge when all checks succeed |
--delete-branch | bool | false | Delete branch after merge |
--ff-only | bool | false | Fast-forward only (fails if not possible) |
--match-head-commit | string | Expected head commit SHA (safety check) | |
--message | string | Custom merge commit message | |
--rebase | bool | false | Rebase commits onto base branch |
--rebase-merge | bool | false | Rebase then create merge commit |
--squash | bool | false | Squash commits into one |
--title | string | Custom merge commit title |
madtea pr patch
Get PR as diff or patch text
| Flag | Type | Default | Description |
|---|---|---|---|
--format | string | diff | Output format: diff or patch |
madtea pr pinned
List pinned pull requests
madtea pr ready
Mark a draft PR as ready for review
| Flag | Type | Default | Description |
|---|---|---|---|
--undo | bool | false | Convert a ready PR back to a draft (gh pr ready –undo) |
madtea pr resolve-comment
Resolve a PR review comment
madtea pr revert
Create a revert PR for a merged PR
| Flag | Type | Default | Description |
|---|---|---|---|
--body | string | Custom body for the revert PR | |
--title | string | Custom title for the revert PR |
madtea pr review
Get specific review with comments
madtea pr review-comment-add
Add a comment to a specific review
| Flag | Type | Default | Description |
|---|---|---|---|
--body | string | Comment text (required) | |
--line | int | 0 | Line number in the new (post-image) file |
--old-line | int | 0 | Line number in the old (pre-image) file (for commenting on deleted lines) |
--path | string | File path for the comment |
madtea pr review-comment-delete
Delete a review comment
madtea pr review-comment-get
Get a specific review comment
madtea pr review-comments
List comments on a specific review
madtea pr review-create
Create/submit a review
| Flag | Type | Default | Description |
|---|---|---|---|
--body | string | Review body/comment | |
--event | string | Review event: APPROVE, REQUEST_CHANGES, COMMENT (required) | |
--file | string | Read content from file (use - for stdin) |
madtea pr review-delete
Delete a review
madtea pr review-dismiss
Dismiss a review
| Flag | Type | Default | Description |
|---|---|---|---|
--message | string | Dismissal message (required) |
madtea pr review-submit
Submit a pending review
| Flag | Type | Default | Description |
|---|---|---|---|
--body | string | Review body/comment | |
--event | string | Review event: APPROVE, REQUEST_CHANGES, COMMENT (required) |
madtea pr review-undismiss
Undismiss a previously dismissed review
madtea pr reviewer add
Request review from users
madtea pr reviewer list
List requested reviewers
madtea pr reviewer remove
Remove reviewer from PR
madtea pr reviews
List reviews on a pull request
madtea pr unresolve-comment
Unresolve a PR review comment
madtea pr update-branch
Update PR branch from base branch
MCP Tools
madt_prs
Manage pull requests (current repo by default): list/CRUD, merge, conflicts, files/commits/diff/patch, checks, reviews, checkout, revert, pinned, comments. To complete a branch use madt_finish, not action=merge.
Output schema: declared
One tool, action-dispatched. Set action to one of:
action="body"
Safely edit the body via anchored, conflict-checked ops (no wholesale overwrite). Set op to choose the operation.
Required: op
One of: number | numbers
action="body" op="append"
Append content to the END of the body (no anchor). Conflict-checked (412 if the body changed since read). See madt_help(topic=“body”).
Required: content
action="body" op="patch"
Apply anchored (old→new) replacements to the body. Conflict-checked: a drifted/ambiguous anchor or a 412 body-changed-since-read is rejected. See madt_help(topic=“body”).
Required: replacements
action="body" op="section_replace"
Replace the content between the named section markers (ensure seeds them if absent). Conflict-checked (412 if the body changed since read). See madt_help(topic=“body”).
Required: section, content
Optional: ensure
action="body" op="task_toggle"
Set the one - [ ] / - [x] checklist line matched by match to an explicit checked state (not a blind flip). Idempotent; a 412 lost-update is rejected. See madt_help(topic=“body”).
Required: match, checked
action="cancel_auto_merge"
Cancel a scheduled auto-merge for the PR.
One of: number | numbers
action="checkout"
Check out the PR branch locally (fetch + checkout).
One of: number | numbers
action="checks"
Show CI / commit status checks for the PR head SHA.
One of: number | numbers
action="close"
Close pull request(s) without merging (abandon). Batch multiple via numbers in one call (never loop). To merge instead, use madt_finish; to reopen, use action=edit state=open.
One of: number | numbers
action="comment"
Add a comment to a PR.
Required: body
One of: number | numbers
action="comment_delete"
Delete a PR/issue comment by comment ID.
Required: comment_id
action="comment_edit"
Edit a PR/issue comment by comment ID (full-body replace). expected_body is required — a comment changed since you read it is never silently overwritten. Read it first, pass its body.
Required: comment_id, body, expected_body
action="comments"
List comments on a PR.
One of: number | numbers
action="commits"
List commits in a PR.
One of: number | numbers
action="compare"
Compare two branches. Returns forge compare JSON (total_commits, commits), NOT a textual diff — for diff/patch text use action=diff or patch. Output is JSON in both modes; raw_json is a no-op.
Required: base, head
action="conflicts"
Show merge conflict files for a PR.
One of: number | numbers
action="create"
Create a PR without merging — the review-only alternative to madt_finish (draft=true for a draft). Head defaults to the current branch and must already exist on the remote (push first with madt_push). One of title/fill/fill_first/fill_verbose is required.
One of: title | fill | fill_first | fill_verbose
Optional: body, head, base, labels, assignees, milestone, reviewers, draft, allow_maintainer_edit
action="diff"
Get the PR diff (unified diff text). file limits output to one file’s hunks (matched by path substring) so a large-PR review needn’t pull the whole diff.
One of: number | numbers
Optional: file
action="edit"
Update PR fields (title, state, base, draft, milestone, assignees, reviewers). Body edits use action=body.
One of: number | numbers
Optional: data, title, state, base, draft, milestone, remove_milestone, assignees, add_assignees, remove_assignees, add_reviewers, remove_reviewers
action="files"
List files changed in a PR.
One of: number | numbers
action="get"
Get PR details — full body and metadata, complete and never truncated. Batch multiple via numbers (never loop); a number that fails to fetch is silently dropped. PR comments are separate — use action=comments.
One of: number | numbers
action="is_merged"
Check if a PR is merged.
One of: number | numbers
action="list"
List pull requests in the current repo. Filter by state, sort, milestone, labels, base branch, author. sort: oldest|recentupdate|leastupdate|mostcomment|leastcomment|priority. Paginated: limit default 30 (max 200), page is 1-based.
Optional: state, sort, milestone_filter, labels_filter, base_branch, author, limit, page
action="merge"
Merge a PR. Strategy: merge, squash, rebase, rebase-merge, fast-forward-only; omit to honor the repo’s configured default merge style. Idempotent: already-merged skips. delete_branch removes head; force_merge bypasses checks; auto_merge only schedules, not to mainline (use madt_finish). For N PRs use madt_orchestrate.
One of: number | numbers
Optional: strategy, title, message, delete_branch, force_merge, auto_merge, head_commit_id
action="patch"
Get PR contents as diff or patch text.
One of: number | numbers
Optional: format
action="pinned"
List pinned pull requests in the repository.
action="resolve_comment"
Resolve a PR review comment.
Required: comment_id
action="revert"
Open a revert PR for a merged PR. Applies git revert in a DISPOSABLE linked worktree off the up-to-date default branch (run madt_pull first), never your primary checkout, then opens the PR and removes the worktree. On conflict the worktree is parked (primary untouched) with dir= resolve/abandon rails.
One of: number | numbers
Optional: title, body
action="review"
Get a single review by ID.
Required: review_id
One of: number | numbers
action="review_comment_add"
Add a comment to an existing pending review (review_id). For an inline comment pass path + new_line (post-image) or old_line (pre-image); omit for a review-level comment. Create the pending review first via madt_api_call POST …/reviews with no event.
Required: review_id, body
One of: number | numbers
Optional: path, old_line, new_line
action="review_comment_delete"
Delete a comment from a review.
Required: review_id, comment_id
One of: number | numbers
action="review_comment_get"
Get a single review comment by ID.
Required: review_id, comment_id
One of: number | numbers
action="review_comments"
List comments on a specific review.
Required: review_id
One of: number | numbers
action="review_create"
Create and submit a review on a PR. event must be APPROVE, REQUEST_CHANGES, or COMMENT (not COMMENTED).
Required: event
One of: number | numbers
Optional: body
action="review_delete"
Delete a review.
Required: review_id
One of: number | numbers
action="review_dismiss"
Dismiss a review with a message.
Required: review_id, message
One of: number | numbers
action="review_submit"
Submit an existing pending review by review_id. event must be APPROVE, REQUEST_CHANGES, or COMMENT (not COMMENTED). Create a pending review first via madt_api_call POST …/reviews with no event, or use action=review_create to do both in one step.
Required: review_id, event
One of: number | numbers
Optional: body
action="review_undismiss"
Undismiss a previously dismissed review.
Required: review_id
One of: number | numbers
action="reviewer_add"
Request review from one or more users.
Required: reviewers
One of: number | numbers
action="reviewer_list"
List requested reviewers on a PR.
One of: number | numbers
action="reviewer_remove"
Remove review requests from one or more users.
Required: reviewers
One of: number | numbers
action="reviews"
List reviews on a PR.
One of: number | numbers
action="unresolve_comment"
Unresolve a previously resolved PR review comment.
Required: comment_id
action="update_branch"
Update PR branch by merging or rebasing the base branch into it.
One of: number | numbers
Canonical source: docs/reference/pull-requests.md in the madtea repo.