The Help Command
How the built-in help command works: command listings, man-page sections, and terminal rendering.
The help command is registered automatically. It supports listing all commands and showing detailed help for individual commands.
myapp help # Lists all commands with descriptions
myapp help deploy # Full man page for "deploy"
myapp help config set # Man page for sub-command "set" in group "config"
Command listings
Running help without arguments lists all available commands with their one-line descriptions:
Commands:
config Manage configuration
deploy Deploy the application
generate Generates a signed JWT token for the given customer
help
The format is: 3 spaces, command name (left-aligned, padded to the longest name plus 3 spaces), then description.
Man page sections
Running help <command> renders a structured man page with the following sections:
NAME– the command name and its one-line descriptionSYNOPSIS– the command-line shapeDESCRIPTION– the body of the command’s javadoc, formatted byDocumentParserOPTIONS– one entry per option with its descriptionDEPRECATED– from the@deprecatedjavadoc tagSEE ALSO– from@seejavadoc tagsAUTHORS– from@authorjavadoc tags
Each section is populated from javadoc, annotation values, or resource bundles, depending on the source you’ve chosen. See Javadoc, Annotation Descriptions, and Resource Bundles.
Terminal rendering
Output is formatted for terminal display:
- Text is wrapped to the detected terminal width
- Section headings,
--flags, and backtick-wrapped tokens render in bold – monochrome, with no syntax highlighting - Bullets render with the
oglyph used by traditional man pages - Output is piped through
lessif available, allowing scroll through long help pages
For a complete rendered example, see Example.