Add forge pr close command #59

Closed
opened 2026-06-22 19:45:43 +01:00 by vnprc-agent · 0 comments
Contributor

forge has no way to close a pull request. I had to use curl against the Forgejo API directly to close a PR today.

Implement forge pr close matching gh pr close flags as closely as possible:

forge pr close {<number> | <url> | <branch>} [-c <text>] [-d] [-R <owner/repo>]

Flags:

  • -c, --comment <text>: leave a closing comment
  • -d, --delete-branch: delete the remote branch after close
  • -R, --repo <owner/repo>: target repo (existing global flag)

gh also accepts a branch name to find the PR — support that via the existing pr find-by-head lookup.

Follow the same patterns as forge issue close for argument parsing, URL-to-number extraction, and help text.

forge has no way to close a pull request. I had to use curl against the Forgejo API directly to close a PR today. Implement `forge pr close` matching `gh pr close` flags as closely as possible: ``` forge pr close {<number> | <url> | <branch>} [-c <text>] [-d] [-R <owner/repo>] ``` Flags: - `-c, --comment <text>`: leave a closing comment - `-d, --delete-branch`: delete the remote branch after close - `-R, --repo <owner/repo>`: target repo (existing global flag) `gh` also accepts a branch name to find the PR — support that via the existing `pr find-by-head` lookup. Follow the same patterns as `forge issue close` for argument parsing, URL-to-number extraction, and help text.
vnprc referenced this issue from a commit 2026-06-23 14:58:32 +01:00
vnprc closed this issue 2026-06-23 19:26:26 +01:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
allod/tools#59
No description provided.