Surface cg commands in CLI help for agent discovery#21
Open
Surface cg commands in CLI help for agent discovery#21
cg commands in CLI help for agent discovery#21Conversation
The hidden `cg commands` endpoint outputs a machine-readable JSON catalog of all commands, flags, enums, and API mappings — useful for agents and tooling. Until now it was only discoverable via CLAUDE.md. Add a footer line to `cg --help` so users and agents can find it.
Surface the machine-readable catalog command in the interactive welcome box so agents and users discover it on first launch.
Remove Hidden: true from commandsCmd so it appears naturally in `cg --help` alongside every other command. This replaces the previous approach of keeping it hidden while manually adding hints to the usage template and welcome banner — simpler, more conventional, and zero additional code.
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
Un-hide the
cg commandscommand so it appears naturally incg --help, enabling AI agents and users to discover the machine-readable command catalog without any manual advertising.Links
Changes
cghad no way to discovercg commandssince it was hidden from--help. Surfacing it gives them (~4k tokens) a complete command catalog with examples on the first invocation.commandscommand already existed.cmd/commands.go— removesHidden: truefromcommandsCmdso it appears in the standardcg --helpcommand list.Hidden: trueflag that was keepingcommandsout of help output.Pre-release Checklist
Rollback Steps
main— no migrations, feature flags, or environment changes involved.