CLI output: help from the registry !470

merged merged by cmc on 2026-09-24 15:08 UTC · krz/gitbay:cli-output-help into main

Discussion

cmc

Ref #254. Stacked on !469.

  • Command gains Flags []Flag{Name, Arg, Desc, Default} and Examples; every registration fills them. TestHelpIsComplete fails on a usage flag without a description, a description for a flag not in the usage, a command without an example, or an example that does not resolve to its own command. An example may end in one shell redirect.
  • help <noun>: summary, USAGE, READ and WRITE verbs. help <noun> <verb>: summary, USAGE (required flags inline, [flags] for the optional ones), FLAGS with descriptions and defaults, EXAMPLES, SEE ALSO for commands below it. gitbay as the program at a terminal, ssh git@<host> when piped. help --json adds flags and examples.
  • The CLI's summaries are generated from the registry (cmd/gitbay/summaries_gen.go, TestSummariesAreCurrent -update); pass() no longer carries its own text. gitbay --help groups the commands under WORK, REPOSITORIES, YOU and INSTANCE. Noun --help at a terminal goes through the terminal layout.

retargeted from cli-output-views to main: !469 merged

2026-09-24 15:08 UTC