cmd: add implicit current-PR Ex commands, completion, and specs #391

Closed
opened 2026-04-25 16:20:52 +00:00 by barrettruth · 0 comments
barrettruth commented 2026-04-25 16:20:52 +00:00

Part of #389.
Depends on #390.
Suggested order: 2.

Problem

The Ex surface documents family verb commands, but there is no first-class current-PR command model even though the common workflows are branch-relative from the editor. That makes users discover current-PR behavior only indirectly through unrelated commands.

Proposed solution

Add implicit current-PR Ex commands:

  • :Forge pr
  • :Forge review
  • :Forge pr ci

Keep :Forge ci as current-branch CI history.

Reuse the new resolver layer so implicit forms operate on the unique PR for the current branch context when resolution succeeds.

Scope

  • parser updates in lua/forge/cmd.lua
  • dispatch changes for implicit current-PR verbs
  • Ex completion updates for implicit forms and explicit disambiguation modifiers
  • command and completion specs in spec/cmd_spec.lua and spec/command_spec.lua

Acceptance criteria

  • :Forge pr, :Forge review, and :Forge pr ci parse and dispatch successfully when current-PR resolution is unambiguous
  • :Forge ci still opens current-branch CI history, not PR checks
  • implicit current-PR forms accept explicit repo= / head= disambiguation
  • Ex completion covers the new verbs and modifier flows
  • specs cover no-PR, unique-PR, and ambiguous-PR outcomes

Out of scope

  • changing :Forge pr create semantics
  • high-level Lua API additions
Part of #389. Depends on #390. Suggested order: 2. ## Problem The Ex surface documents `family verb` commands, but there is no first-class current-PR command model even though the common workflows are branch-relative from the editor. That makes users discover current-PR behavior only indirectly through unrelated commands. ## Proposed solution Add implicit current-PR Ex commands: - `:Forge pr` - `:Forge review` - `:Forge pr ci` Keep `:Forge ci` as current-branch CI history. Reuse the new resolver layer so implicit forms operate on the unique PR for the current branch context when resolution succeeds. ## Scope - parser updates in `lua/forge/cmd.lua` - dispatch changes for implicit current-PR verbs - Ex completion updates for implicit forms and explicit disambiguation modifiers - command and completion specs in `spec/cmd_spec.lua` and `spec/command_spec.lua` ## Acceptance criteria - `:Forge pr`, `:Forge review`, and `:Forge pr ci` parse and dispatch successfully when current-PR resolution is unambiguous - `:Forge ci` still opens current-branch CI history, not PR checks - implicit current-PR forms accept explicit `repo=` / `head=` disambiguation - Ex completion covers the new verbs and modifier flows - specs cover no-PR, unique-PR, and ambiguous-PR outcomes ## Out of scope - changing `:Forge pr create` semantics - high-level Lua API additions
Sign in to join this conversation.
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
barrettruth/forge.nvim#391
No description provided.