Some type of crawler would interact with a program, parse its --help output, man page, or any other info available, to enumerate all possible options and their formatting.
It sounds like a really messy program considering how inconsistent CLI's are.
Anyways, a GUI could help massively with discoverability.
Such a tool could help bridge the gap a little between GUI and CLI.