Rich-Click
raw JSON → 1.9.7 verified Tue May 12 auth: no python install: verified quickstart: stale
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-click Common errors
error ModuleNotFoundError: No module named 'rich_click' ↓
cause The rich-click library has not been installed in the current Python environment.
fix
pip install rich-click
error NameError: name 'click' is not defined ↓
cause The code is attempting to use the 'click' object (e.g., '@click.command()') without first importing rich-click and aliasing it as 'click'.
fix
import rich_click as click
error AttributeError: module 'rich_click' has no attribute 'rich_command' ↓
cause The code is attempting to use a deprecated API (like 'rich_click.rich_command' or 'rich_click.rich_group') which was removed in newer rich-click versions in favor of directly re-exporting Click's decorators.
fix
Replace
rich_click.rich_command with click.command after using import rich_click as click at the top of your file. error TypeError: 'TypeHintError' object is not iterable ↓
cause This error typically occurred in older rich-click versions (specifically pre-1.7.0) due to an incompatibility with how Click handled type hints.
fix
pip install --upgrade rich-click
Warnings
breaking Rich-Click 1.9+ dropped support for Python 3.7, Click 7, and Rich versions 10/11. Ensure your environment uses Python 3.8+, Click 8+, and Rich 12+ for full compatibility and features. ↓
fix Upgrade Python to 3.8+, Click to 8+, and Rich to 12+.
gotcha Rich formatting markup (e.g., '[red]') in help texts is disabled by default to maintain broad compatibility. It will render as plain text unless explicitly enabled. ↓
fix Enable rich markup by setting `click.rich_click.USE_RICH_MARKUP = True` or by configuring `RichHelpConfiguration` with `use_rich_markup=True`.
gotcha Minor Typer incompatibilities, such as default panel placements, have been addressed in recent versions. For optimal integration with Typer CLIs, ensure `rich-click[typer]` is installed. ↓
fix Install `rich-click[typer]` and upgrade rich-click to version 1.9.6 or later.
gotcha Subcommand discovery in help text had inconsistent behavior between versions 1.8 and 1.9.3. If using an affected version, subcommands might not display correctly. ↓
fix Upgrade to rich-click v1.9.3 or later to ensure correct subcommand discovery behavior, which was restored to match v1.8.
gotcha Early versions (prior to v1.9.5) experienced strange encoding issues on Windows environments, potentially leading to malformed help output. ↓
fix Upgrade to rich-click v1.9.5 or later for improved Windows compatibility.
deprecated The 'groups' feature for organizing commands and options was superseded by the more intuitive 'Panels' API in rich-click 1.9. While old code might still function, 'Panels' offer more powerful customization. ↓
fix Migrate to the 'Panels' API for command and option organization for better control and flexibility.
breaking When attempting to install 'rich-click[typer]', pip reports that rich-click 1.9.7 does not provide the 'typer' extra. If an application relies on this extra for Typer integration and it is not available, it can lead to an unexpected 'Aborted.' error during execution. ↓
fix 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.
Install
pip install "rich-click[typer]" Install compatibility verified last tested: 2026-05-12
python os / libc variant status wheel install import disk
3.10 alpine (musl) typer wheel - 0.08s 31.7M
3.10 alpine (musl) rich-click wheel - 0.09s 31.7M
3.10 alpine (musl) typer - - 0.09s 31.7M
3.10 alpine (musl) rich-click - - 0.09s 31.7M
3.10 slim (glibc) typer wheel 2.8s 0.06s 32M
3.10 slim (glibc) rich-click wheel 2.7s 0.06s 32M
3.10 slim (glibc) typer - - 0.06s 32M
3.10 slim (glibc) rich-click - - 0.06s 32M
3.11 alpine (musl) typer wheel - 0.13s 34.6M
3.11 alpine (musl) rich-click wheel - 0.14s 34.6M
3.11 alpine (musl) typer - - 0.15s 34.6M
3.11 alpine (musl) rich-click - - 0.14s 34.6M
3.11 slim (glibc) typer wheel 2.8s 0.11s 35M
3.11 slim (glibc) rich-click wheel 2.8s 0.11s 35M
3.11 slim (glibc) typer - - 0.10s 35M
3.11 slim (glibc) rich-click - - 0.11s 35M
3.12 alpine (musl) typer wheel - 0.11s 26.3M
3.12 alpine (musl) rich-click wheel - 0.11s 26.3M
3.12 alpine (musl) typer - - 0.12s 26.2M
3.12 alpine (musl) rich-click - - 0.15s 26.2M
3.12 slim (glibc) typer wheel 2.6s 0.11s 27M
3.12 slim (glibc) rich-click wheel 2.6s 0.11s 27M
3.12 slim (glibc) typer - - 0.11s 27M
3.12 slim (glibc) rich-click - - 0.12s 27M
3.13 alpine (musl) typer wheel - 0.12s 26.0M
3.13 alpine (musl) rich-click wheel - 0.11s 26.0M
3.13 alpine (musl) typer - - 0.11s 25.9M
3.13 alpine (musl) rich-click - - 0.11s 25.9M
3.13 slim (glibc) typer wheel 2.6s 0.10s 27M
3.13 slim (glibc) rich-click wheel 2.6s 0.10s 27M
3.13 slim (glibc) typer - - 0.11s 26M
3.13 slim (glibc) rich-click - - 0.11s 26M
3.9 alpine (musl) typer wheel - 0.09s 30.8M
3.9 alpine (musl) rich-click wheel - 0.09s 30.8M
3.9 alpine (musl) typer - - 0.10s 30.8M
3.9 alpine (musl) rich-click - - 0.09s 30.8M
3.9 slim (glibc) typer wheel 3.2s 0.10s 31M
3.9 slim (glibc) rich-click wheel 3.2s 0.08s 31M
3.9 slim (glibc) typer - - 0.08s 31M
3.9 slim (glibc) rich-click - - 0.08s 31M
Imports
- click
import rich_click as click - RichCommand, RichGroup wrong
from rich_click import command, groupcorrectfrom rich_click import RichCommand, RichGroup
Quickstart stale last tested: 2026-04-24
import rich_click as click
import os
@click.command()
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
@click.option(
"--api-key",
envvar="MY_APP_API_KEY",
help="API key for external service.",
default=os.environ.get('MY_APP_API_KEY', '')
)
def hello(count, name, api_key):
"""
A simple program that greets NAME for a total of COUNT times.
It also demonstrates an optional API key from an environment variable.
"""
if not api_key:
click.echo("[red]Warning:[/] No API key provided (set MY_APP_API_KEY environment variable).")
for _ in range(count):
click.echo(f"Hello, {name}!")
if __name__ == '__main__':
hello()