forge: adopt gh-style flags for content args #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
ghhas effectively become the industry standard CLI for git forges. Matching its flag conventions reduces cognitive load for both humans and agents — muscle memory transfers, and agents that knowghwill useforgecorrectly without guessing.The current
forgeuses positional args for content fields (title, body, base). This is fine for simple lookup commands but breaks down when fields are optional or multi-line — you can't skiptitleto update onlybodyinpr edit, and long body strings are awkward positionally.Proposed changes
All commands that accept a body string should support both
--body <string>and--body-file <file>, matchinggh. Pass-as the file to read from stdin. This avoids shell quoting gymnastics with backticks and multiline strings — agents write content to a file and pass the path.forge pr create--headshould default to the current branch, same asgh.forge pr editforge pr commentforge pr replyNo
ghequivalent, but consistent with the above:forge issue create(new — required)Needed immediately: filing this issue required hitting the Forgejo API directly because
forgehad noissue createcommand.forge issue edit(new — required)Needed immediately: updating this issue required hitting the Forgejo API directly for the same reason. The lack of
--body-filealso forced writing a temp file and usingjq --rawfileto avoid backtick quoting issues in shell heredocs.Commands that stay as-is
Positional identifiers are already consistent with
gh:forge pr view <number>forge pr listforge pr review-comments <number>forge pr find-by-head <branch>forge issue view <number>forge issue listFuture commands (add when there is a concrete need)
forge pr merge <number>— matchesgh pr mergeforge pr close <number>— matchesgh pr closeforge issue close <number>— matchesgh issue close