feat: CLI resource-read path (--cli read forgejo://...) for resource-template parity #191
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/OpenSpec
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
RFC - Request For Comments
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
hermes-attempted
hermes-needs-clarification
hermes-ready
hermes-review
hermes-wip
human-required
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
agentic-forges/forgejo-mcp#191
Loading…
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?
Problem
The
--climode (cmd/cli.go) reaches tools but not resources.RunCLIcallsregisterToolsWithDomains(mcpSrv)andcliExecdispatches by tool name. Any new tool is immediatelyforgejo-mcp --cli <tool> --args '{...}'.--cliat all:registerToolsWithDomainsregisters tools only, and there is noforgejo://reader / noreadsubcommand. So everyforgejo://resource-template is MCP-only and invisible from the CLI.This is cross-cutting, not specific to one feature. It already affects the shipped resources (
forgejo://repo/{owner}/{repo}repo,/commit/{sha},/commit/{sha}/status,/issue/{index},/pr/{index},.../comment/{id},forgejo://owner/{owner}) and blocks CLI parity for every future resource — concretely the webhook resources in #136 and the label resources in #190.Proposed solution
Add a CLI resource-read command wired to the same resource handlers MCP uses:
--climode (aregisterResourcesWithDomainsparallelingregisterToolsWithDomains, or reuse the existingRegisterResources*entry points).readresolves the URI through the same template matching + handler path asresources/readover MCP — no duplicate logic, no second source of truth.--cli list(or alist-resources) should surface the registered resource-templates alongside tools, so the CLI is self-describing.Why standalone
Both #136 (webhook resources) and #190 (label resources) carry a "CLI resource parity" sub-requirement. Solving it per-feature means re-deriving the same plumbing twice and leaving the already-shipped resources CLI-invisible. One reader, built once, gives parity to all current and future resource-templates. #136 and #190 depend on this.
Acceptance criteria
forgejo-mcp --cli read forgejo://repo/{owner}/{repo}returns the repo resource (proves the generic path on an already-shipped resource).--climode via a shared entry point (no MCP-vs-CLI divergence in handlers).--cli listsurfaces resource-templates (self-describing CLI).AGENTS.mddocument--cli read.--cli(parity proof for acceptance).Related