Skip to content

rich-click rich-click

Richly rendered command line interfaces in Click.

Beautiful help text and error messages for your Click CLI, formatted with Rich.

pip install rich-click
$ sync-tool --help
Usage: sync-tool [OPTIONS] COMMAND [ARGS]...
Synchronise all your files between two places.
╭─ Options ──────────────────────────────────────────────────╮
│ * --type TEXT Type of file to sync [required] │
│ --debug Show the debug log messages │
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────╯
╭─ Main usage ───────────────────────────────────────────────╮
│ sync Synchronise all your files. │
│ download Pretend to download some files. │
╰────────────────────────────────────────────────────────────╯
╭─ Configuration ────────────────────────────────────────────╮
│ config Set up the configuration. │
│ auth Authenticate the app. │
╰────────────────────────────────────────────────────────────╯
+ 24 more

Built on Click, the Python package for creating beautiful command line interfaces, and Rich, the Python library for rich text in the terminal.

Features

Attractive help output with minimal customisation required, and plenty of room to go further.

One line change

Swap your Click import and keep writing Click as normal. You can also opt in one command at a time, or run rich-click on a CLI you didn’t write.

hello.py
import click
import rich_click as click
@click.option("--count", default=1, help="Number of greetings.")
@click.option("--name", prompt="Your name", help="The person to greet.")
def hello(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for _ in range(count):
click.echo(f"Hello, {name}!")

Import as click

Change one line in your own CLI: import rich_click as click

Declarative

Keep importing Click and opt in per command: @click.command(cls=RichCommand)

Someone else’s CLI

Put rich-click in front of any Click or Typer command.

rich-click awesometool --help

Design your own theme

Tweak colours and box styles in the browser, then copy the config straight into your CLI.

Open the Live Style Editor