feat(cli): infer version host from cwd origin #7

Merged
ses merged 2 commits from feat/version-cwd-infer into main 2026-08-25 21:11:03 +00:00
Owner

Why

forgejo-mcp version was the only CLI subcommand that ignored the
cwd-inference seam shared by every other entry point. From inside a
checkout with an origin remote pointing at a Forgejo host, all three
PR subcommands and the OpenCode plugin's get_version resolve the host
without flags or env — but version required either --host or
FORGEJO_URL. That asymmetry broke the "one tool, three ways" promise:
the cheapest, most common smoke ("does this Forgejo talk to my repo?")
could not be run from the repo itself.

This brings version to parity with the OpenCode plugin's get_version
(same precedence: --host → cwd originFORGEJO_URL) and with the
three PR subcommands. The shared resolveFromCwd module already does the
work; runVersion was simply skipping it.

## Why `forgejo-mcp version` was the only CLI subcommand that ignored the cwd-inference seam shared by every other entry point. From inside a checkout with an `origin` remote pointing at a Forgejo host, all three PR subcommands and the OpenCode plugin's `get_version` resolve the host without flags or env — but `version` required either `--host` or `FORGEJO_URL`. That asymmetry broke the "one tool, three ways" promise: the cheapest, most common smoke ("does this Forgejo talk to my repo?") could not be run from the repo itself. This brings `version` to parity with the OpenCode plugin's `get_version` (same precedence: `--host` → cwd `origin` → `FORGEJO_URL`) and with the three PR subcommands. The shared `resolveFromCwd` module already does the work; `runVersion` was simply skipping it.
feat(cli): infer version host from cwd origin
Some checks failed
ci / test (pull_request) Failing after 44s
bd2acfdbbd
fix(cli): collapse guard to one line for biome format
All checks were successful
ci / test (pull_request) Successful in 51s
93cd1ef873
ses scheduled this pull request to auto merge when all checks succeed 2026-08-25 21:10:32 +00:00
ses merged commit 93cd1ef873 into main 2026-08-25 21:11:03 +00:00
ses deleted branch feat/version-cwd-infer 2026-08-25 21:11:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
sebatec-eu/forgejoctl!7
No description provided.