Repository navigation
Add JSON help output - #237
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a custom help command implementation to support structured command discovery via git pkgs help --format json, enabling downstream tooling (e.g., MCP server work in #114) to introspect the full command tree without scraping text help.
Changes:
- Adds a Cobra help override that supports
--format text|jsonand emits a JSON command/flag tree. - Ensures plugin commands discovered on
PATHare included in the JSON output. - Documents the feature in
README.mdand adds focused tests for JSON help behavior (root, specific command, invalid format, plugins).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Documents the new structured JSON help output usage. |
| cmd/root.go | Registers the new JSON-capable help command on the root command. |
| cmd/help.go | Implements the custom help command and JSON serialization of commands/flags. |
| cmd/help_test.go | Adds tests validating JSON help output and plugin discovery inclusion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
abhinavgautam01
force-pushed
the
feature/help-json-114
branch
from
June 19, 2026 10:28
c537599 to
0d0faf9
Compare
andrew
approved these changes
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds structured command discovery via
git pkgs help --format json, as a prerequisite for the MCP server work in #114.Ref #114
Changes
--format text|jsonTesting
go test ./cmd -run HelpJSONgo run . help where --format jsongo run . help listgo test ./...go tool golangci-lint run ./...git diff --checkgo build ./...