Document a CLI
Auto-generate reference pages for Click-based command-line interfaces.
If your package has a Click-based CLI, Great Docs can auto-discover it and generate reference pages for every command.
Enable CLI Docs
great-docs.yml
cli:
enabled: trueThat’s all you need. Great Docs will:
- Find your Click commands via entry points or common module locations
- Capture
--helpoutput for each command and subcommand - Generate
.qmdpages inreference/cli/ - Add a “CLI Reference” sidebar section with a reference switcher
Auto-Discovery Order
Great Docs looks for Click commands in these locations:
your_package.cli— most commonyour_package.__main__— forpython -msupportyour_package.main— alternative- Entry point from
[project.scripts]inpyproject.toml
Explicit Configuration
If auto-discovery doesn’t find your CLI, specify the module and object name:
great-docs.yml
cli:
enabled: true
module: my_package.commands # Where the Click group lives
name: app # Name of the Click group/command objectWhat Gets Documented
Each Click command gets a page showing:
- Command name and help text
- All options with types, defaults, and descriptions
- All arguments
- Subcommand listing (for groups)
The output mimics a terminal --help display, styled for the web.