feat: replace :Forge CLI with a canonical Ex-style command interface #142
Labels
No labels
bug
documentation
duplicate
enhancement
fugitive
good first issue
help wanted
invalid
question
v0.1.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/forge.nvim#142
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?
Prerequisites
Problem
The current
:Forgecommand surface is still early and inconsistent:That makes the command interface hard to reason about and hard to extend.
We have enough freedom right now to replace the current ad hoc syntax with a canonical Ex-style interface before it ossifies.
Proposed solution
Adopt a canonical
:Forgecommand language with these properties:1. Explicit family/verb structure
Canonical forms should be structured like:
:Forge pr list ...:Forge pr review 123 ...:Forge issue create ...:Forge ci list ...:Forge release delete v1.2.3 ...:Forge browse ...This should become the documented interface; older shorthand should be treated as compatibility sugar at most.
2. Ex-style modifiers, not prose syntax
Use
key=valueatoms and bare boolean atoms instead of natural-language clauses.Examples:
state=closedrepo=upstreamrev=maintarget=upstream@main:README.md#L10-L20base=upstream@mainhead=@topicall,draft,fill,web,blankModifiers must be order-independent.
3. First-class address model
The command language should support explicit addressing for:
upstream,origin,owner/repo,host/group/repo@main,upstream@main,owner/repo@abc1234upstream@main:path/to/file#L10-L20This should be a first-class command concept, not an implementation detail.
4. Narrow, Ex-like bang semantics
!should only be allowed on subcommands with a real force variant.Initial bang matrix:
pr close,issue close,release deleteIf
!is supplied where unsupported, Forge should follow normal Ex behavior and error with:E477: No ! allowed5. CLI parity for semantic operations
Anything meaningful the picker can do or view should have a command form too.
That includes current PR manage operations such as:
The picker should remain a discovery UI, but not the only way to access domain operations.
6. Defaults stay policy; explicit targets override policy
When users omit addressing, Forge can still apply sensible defaults (upstream-first, branch-remote, etc.). But the language must allow users to override those defaults precisely.
Canonical v1 command families
pr list|review|checkout|worktree|browse|ci|manage|close|reopen|create|editissue list|browse|close|reopen|createci list|log|watchrelease list|browse|deletebrowseFollow-up issues
Acceptance criteria
doc/forge.nvim.txtAlternatives considered
--repo/--stateas the primary interface. This is workable but feels less like Ex thankey=valuemodifiers.in upstreamorat repo@ref. This reads naturally but does not fit Vim/Neovim command style.Relevant prior context:
:Forge ci <ref>):Forgeworkflow)