
Product
Announcing Bun and vlt Support in Socket
Bringing supply chain security to the next generation of JavaScript package managers
rich-click
Advanced tools
Richly rendered command line interfaces in click.
Documentation · Source Code · Changelog
rich-click is a wrapper around Click that renders help output nicely using Rich.
The intention of rich-click is to provide attractive help output from
Click, formatted with Rich, with minimal customization required.
import rich_click as clickexport RICH_CLICK_THEME=...)rich-click)pip install rich-click
To use rich-click in your code, replace import click with import rich_click as click in your existing click CLI:
import rich_click as click
@click.command()
@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}!")
if __name__ == '__main__':
hello()
Screenshot from examples/11_hello.py
rich-click has a ton of customization options that let you compose help text however you'd like.
Below is a more complex example of what rich-click is capable of, utilizing themes and panels:
Screenshot from examples/03_groups_sorting.py
This is a quick overview of how to use rich-click. Read the docs for more information.
There are a couple of ways to begin using rich-click:
rich_click as clickSwitch out your normal click import with rich_click, using the same namespace:
import rich_click as click
That's it! ✨ Then continue to use Click as you would normally.
See
examples/01_simple.pyfor an example.
If you prefer, you can use RichGroup or RichCommand with the cls argument in your click usage instead.
This means that you can continue to use the unmodified click package in parallel.
import click
from rich_click import RichCommand
@click.command(cls=RichCommand)
def main():
"""My amazing tool does all the things."""
See
examples/02_declarative.pyfor an example.
rich-click CLI toolrich-click comes with a CLI tool that allows you to format the Click help output from any package that uses Click.
To use, prefix rich-click to your normal command.
For example, to get richified Click help text from a package called awesometool, you could run:
$ rich-click awesometool --help
Usage: awesometool [OPTIONS]
..more richified output below..
This project is licensed under the MIT license.
FAQs
Format click help output nicely with rich
We found that rich-click demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.