rich-click is a wrapper around Click that renders help output nicely using Rich. It provides attractive, color-formatted help text with minimal customization required, serving as a drop-in replacement for Click. The library is currently at version 1.9.7 and has an active development cycle with frequent releases.
pip install rich-clickVerified import paths — ran on the pinned version, not inferred.
This example demonstrates a basic rich-click CLI with options, a prompt, and an environment variable for an API key. Save it as `cli.py` and run `python cli.py --help` for rich-formatted output or `python cli.py --name World`.
Upgrade Python to 3.8+, Click to 8+, and Rich to 12+.
Enable rich markup by setting `click.rich_click.USE_RICH_MARKUP = True` or by configuring `RichHelpConfiguration` with `use_rich_markup=True`.
Install `rich-click[typer]` and upgrade rich-click to version 1.9.6 or later.
Upgrade to rich-click v1.9.3 or later to ensure correct subcommand discovery behavior, which was restored to match v1.8.
Upgrade to rich-click v1.9.5 or later for improved Windows compatibility.
Migrate to the 'Panels' API for command and option organization for better control and flexibility.
Review the rich-click documentation for version 1.9.7+ regarding Typer integration. If 'typer' functionality is required, install 'typer' directly as a separate dependency and verify compatibility, or consider using a rich-click version that explicitly supports the '[typer]' extra if available.
pip install rich-click
import rich_click as click
Replace `rich_click.rich_command` with `click.command` after using `import rich_click as click` at the top of your file.
pip install --upgrade rich-click