Registry / devops / rich-click

rich-click

JSON →
library1.9.8pypypi✓ verified 27d ago

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
INSTALL
IMPORT
SIG · RICH-CLICK
R
rich-click
devopspythonv1.9.8
Install
2.8s avg
Import
116ms
Disk
30MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.9.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.122s · 32MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.8s · import 0.110s · 32MB
30MB installed
● package 30MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

click
import rich_click as click
This is the most common and recommended way to use rich-click as a drop-in replacement for Click.
RichCommand, RichGroup
from rich_click import RichCommand, RichGroup
from rich_click import command, group
While 'command' and 'group' are re-exported, using the explicit 'RichCommand' and 'RichGroup' is clearer when opting for declarative usage with `cls=`.

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`.

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()
Debug
Known issues
breakingRich-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+.
affects: <1.9.0
gotchaRich 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`.
affects: All versions
gotchaMinor 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.
affects: <1.9.6
gotchaSubcommand 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.
affects: >=1.9.0, <1.9.3
gotchaEarly 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.
affects: <1.9.5
deprecatedThe '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.
affects: >=1.9.0
breakingWhen 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.
affects: 1.9.7
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rich_click'
The rich-click library has not been installed in the current Python environment.
fix
pip install rich-click
NameError: name 'click' is not defined
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
AttributeError: module 'rich_click' has no attribute 'rich_command'
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.
TypeError: 'TypeHintError' object is not iterable
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
Upgrade
Version history
1.9.8latest on PyPI · released May 28, 2026
Audit
Dependencies
clickrequiredCore dependency; rich-click is a wrapper around Click. Click 8+ is recommended for full features.
richrequiredCore dependency; provides the rich text formatting capabilities. Rich 12+ is recommended.
typeroptionalFor enhanced compatibility and features when building CLIs with Typer.
Agent activity
12 hits · last 30 days
node
10
Resources
rich-click — pip install rich-click · libregistry