introspect: list second-level subcommands in wraptool_discover #51
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?
wraptool_discoverlists only a tool's top-level commands, so an agent cannot see second-level ones likefj issue searchorfj issue view, and has to guess them when filing a capability request.Current behaviour
internal/introspect/introspect.gobuildsSchema.Availablefrom the tool's top-level help only (-h/--help/help, a fixed argv). Forfjthat yieldsissue,pr,repoand so on, all with empty descriptions, althoughfj -handfj issue -hprint descriptions. On 2026-10-08 the subcommand names for threefj issuecapability requests had to come from memory and were only confirmed when the operator ranfj issue -hby hand.Proposal
Go one level deeper: for a top-level command that is itself a command group, run
<tool> <command> -hand add its entries to the catalog ascommand subcommand, cached like the rest of the schema.The design question
Today wraptool only runs help for the top level and for operator-approved subcommands. Going deeper runs
<tool> <command> -hfor commands nobody approved (fj auth -h,fj repo -h). Well-behaved CLIs treat-has help, but a tool that does not could execute the command. Options:git help -a)wraptool_discovertakes an optional command to drill into, checked against the catalogAlso
Find out why the descriptions in
fj's top-level help are lost (parser format mismatch).Done when
The design question is settled in a note under
design/introspect/, andwraptool_discoverreports second-level subcommands for at leastfj, with tests on capturedfj -h/fj issue -houtput intestdata/.🤖 Generated with Claude Code