🌈 Drop-in replacement for Click to make user-friendly and colorful CLI
121
stars
4,333
commits
Python
primary language
Sep 10, 2026
updated
It should be easy to write a good CLI in Python. Click makes it so. But there are still hundreds of tweaks to implement by yourself to have a user-friendly CLI.
Click Extra is a ready-to-use wrapper around Click to make your CLI look good and behave well. It is a drop-in replacement with good defaults that saves lots of boilerplate code and frustration by making all parts working together.
It also comes with workarounds and patches that have not reached upstream yet (or are unlikely to).
Anyone building a CLI who doesn't have time to assemble the pieces from scratch:
--help, --verbose, --config, and colored output.Click Extra's defaults-first design means one decorator gets you there. See the 30-second quick start.
You can try Click Extra right now in your terminal, without installing any dependency or virtual env thanks to uvx:
$ uvx click-extra
This is a great way to play with Click Extra and check that it runs fine on your system, and renders properly in your terminal.
It transforms this vanilla click CLI:
Into this:
And here is the entire diff between the two. Click Extra proxies the whole click namespace, so aliasing it back leaves every decorator and call untouched:
-import click
+import click_extra as click
The colors, and every option below --name, come from that one line. Both screens above are captured from the tutorial's own live examples.
dark, light, dracula, monokai, nord, solarized-dark, and a monochrome manpage), here recoloring the same help screen:
--config file ([tool.<cli>.themes.<name>]), scoped per invocation so concurrent runs don't bleed into each other--theme flag on every command, with case-insensitive validation against the live registryCLICK_EXTRA_THEME exported once from a shell profile themes every Click Extra CLI on the machine, with a per-CLI <CLI>_THEME taking precedence over it--theme=auto reads the terminal's own background to pick between the dark and light palettes, from CLITHEME, COLORFGBG, or an opt-in OSC 11 query-h/--help option names (see rant on other inconsistencies)help subcommand with a --search mode for groupsexamples=[("description", "command")] on any command, rendered in the help screen, the man page and every machine-readable formatListed in the order they show up in a --help screen:
--time/--no-time to measure command execution duration--color[=WHEN] tri-state flag (auto/always/never) with a hidden --no-color alias, recognizing NO_COLOR (no-color.org), FORCE_COLOR, CLICOLOR, and LLM environment variables--params to debug parameter defaults, values, environment variables and provenance--table-format to switch between 40+ table-rendering styles, from terminal grids to machine-readable json, yaml, toml, csv and xml (uses print_table() and serialize_data())--verbosity LEVEL and logs, plus -v/--verbose repetition for incremental bumping--tree to print the whole hierarchy of nested subcommands with their descriptions, aliases and deprecations:
--man to typeset the command's manual and page it, the way man does, for a CLI that ships no man page at all--help-format to render the command as JSON, Markdown, a man page or a Carapace spec, for the readers that are programs rather than people: one option carrying a format, not one flag per format--version with template variables for git metadata (branch, hash, date, tag) and pre-baking for compiled binaries (Nuitka, PyInstaller)Two more options are one decorator away, for a CLI that wants them:
--jobs for parallel-execution worker counts--telemetry/--no-telemetry flag to opt-in/out of tracking code, recognizing DO_NOT_TRACK from consoledonottrack.comAnd every CLI gets these on top:
show_envvar option to display all environment variables in help screensshow_choices to activate selection of choices on user input promptsclick-extra wrap) applies help colorization, themes, and config loading to any Click CLI without modifying its source code:
--params mode to introspect any external Click CLI's parameters, restricted to the columns you care about:
--help-format carapace to export any Click CLI's Carapace completion spec, for identical completions in Bash, Zsh, Fish, Nushell, PowerShell, Elvish and Xonsh, with --install putting it where Carapace looks (and --help-format man --install doing the same for a man page):
--man mode to read the manual of a CLI that never wrote one--help-format mode to describe any Click CLI as JSON, Markdown, a man page or a Carapace spec: usage line, option groups, subcommands and all, with no cooperation from the target--tree mode to print any external Click CLI's subcommand hierarchy without running it--config work transparently through the wrapper, so users can theme third-party CLIs from their own pyproject.tomlTOMLYAMLJSON, JSON5, JSONC and HJSONINI, with extended interpolation, multi-level sections and non-native types (list, set, …)XMLplist, in both its XML and binary variantspyproject.toml integration: the CLI reads its [tool.<cli>] section from the user's project file, including a CWD-aware walk that skips unrelated pyproject.toml files--validate-configConfigValidator) for user-defined sub-trees whose keys are data rather than CLI flags (per-plugin overrides, matrix axes, user-defined IDs), with rooted ValidationError reporting--no-config option to disable configuration file loadingPrompt > CLI > Environment > Config > Defaults precedenceEnumChoice — click.Choice subclass with proper Enum rendering, case-insensitive matching, alias support, and pluggable choice sources--params and the config loaderwrap_other_commands)click-extra screenshot captures any CLI's colored output as an SVG image or a self-contained HTML block, and the window it is drawn in is yours to set: terminal preset, light or dark chrome, gradient backdrop, caption, line numbers, transparency, credit line, border, shadow, corner radius and margins. Every capture in this readme is one, rewritten on each documentation build, and a pair of them can be switched on the reader's own color scheme:
click:source and click:run Sphinx directives in MyST Markdown and reStructuredText to document CLI source code and their executionpython:source, python:run, python:render, python:render-myst, python:render-rst — the same machinery for arbitrary Python, with a render* family that parses the captured output as live document content (replaces the docs_update.py + marker-region pattern)click:run block runs at build time and assertions fail the buildAnsiHtmlFormatter for HTML output of ANSI-colored textCliRunner — click.testing.CliRunner subclass that captures stdout and stderr separately and preserves ANSI codes for assertion against colored outputinvoke, runner, create_config) and ready-made regex helpers (default_options_uncolored_help, default_debug_*) for click-extra-aware test suitesclick-contrib packagesfrom click_extra import … and @click_extra.command works as a transparent superset. Cloup provides option groups, constraints, subcommand sections, aliases, and Did you mean <subcommand>? suggestions; click-extra adds everything above on top.Check these projects to get real-life examples of click-extra usage.
CLIs:
Documentation (depends on click-extra[sphinx] or click-extra[mkdocs]):
Feel free to send a PR to add your project in either list if you are relying on Click Extra in any way.
Python
100.0%
🌈 Drop-in replacement for Click to make user-friendly and colorful CLI
121
stars
4,333
commits
Python
primary language
Sep 10, 2026
updated
It should be easy to write a good CLI in Python. Click makes it so. But there are still hundreds of tweaks to implement by yourself to have a user-friendly CLI.
Click Extra is a ready-to-use wrapper around Click to make your CLI look good and behave well. It is a drop-in replacement with good defaults that saves lots of boilerplate code and frustration by making all parts working together.
It also comes with workarounds and patches that have not reached upstream yet (or are unlikely to).
Anyone building a CLI who doesn't have time to assemble the pieces from scratch:
--help, --verbose, --config, and colored output.Click Extra's defaults-first design means one decorator gets you there. See the 30-second quick start.
You can try Click Extra right now in your terminal, without installing any dependency or virtual env thanks to uvx:
$ uvx click-extra
This is a great way to play with Click Extra and check that it runs fine on your system, and renders properly in your terminal.
It transforms this vanilla click CLI:
Into this:
And here is the entire diff between the two. Click Extra proxies the whole click namespace, so aliasing it back leaves every decorator and call untouched:
-import click
+import click_extra as click
The colors, and every option below --name, come from that one line. Both screens above are captured from the tutorial's own live examples.
dark, light, dracula, monokai, nord, solarized-dark, and a monochrome manpage), here recoloring the same help screen:
--config file ([tool.<cli>.themes.<name>]), scoped per invocation so concurrent runs don't bleed into each other--theme flag on every command, with case-insensitive validation against the live registryCLICK_EXTRA_THEME exported once from a shell profile themes every Click Extra CLI on the machine, with a per-CLI <CLI>_THEME taking precedence over it--theme=auto reads the terminal's own background to pick between the dark and light palettes, from CLITHEME, COLORFGBG, or an opt-in OSC 11 query-h/--help option names (see rant on other inconsistencies)help subcommand with a --search mode for groupsexamples=[("description", "command")] on any command, rendered in the help screen, the man page and every machine-readable formatListed in the order they show up in a --help screen:
--time/--no-time to measure command execution duration--color[=WHEN] tri-state flag (auto/always/never) with a hidden --no-color alias, recognizing NO_COLOR (no-color.org), FORCE_COLOR, CLICOLOR, and LLM environment variables--params to debug parameter defaults, values, environment variables and provenance--table-format to switch between 40+ table-rendering styles, from terminal grids to machine-readable json, yaml, toml, csv and xml (uses print_table() and serialize_data())--verbosity LEVEL and logs, plus -v/--verbose repetition for incremental bumping--tree to print the whole hierarchy of nested subcommands with their descriptions, aliases and deprecations:
--man to typeset the command's manual and page it, the way man does, for a CLI that ships no man page at all--help-format to render the command as JSON, Markdown, a man page or a Carapace spec, for the readers that are programs rather than people: one option carrying a format, not one flag per format--version with template variables for git metadata (branch, hash, date, tag) and pre-baking for compiled binaries (Nuitka, PyInstaller)Two more options are one decorator away, for a CLI that wants them:
--jobs for parallel-execution worker counts--telemetry/--no-telemetry flag to opt-in/out of tracking code, recognizing DO_NOT_TRACK from consoledonottrack.comAnd every CLI gets these on top:
show_envvar option to display all environment variables in help screensshow_choices to activate selection of choices on user input promptsclick-extra wrap) applies help colorization, themes, and config loading to any Click CLI without modifying its source code:
--params mode to introspect any external Click CLI's parameters, restricted to the columns you care about:
--help-format carapace to export any Click CLI's Carapace completion spec, for identical completions in Bash, Zsh, Fish, Nushell, PowerShell, Elvish and Xonsh, with --install putting it where Carapace looks (and --help-format man --install doing the same for a man page):
--man mode to read the manual of a CLI that never wrote one--help-format mode to describe any Click CLI as JSON, Markdown, a man page or a Carapace spec: usage line, option groups, subcommands and all, with no cooperation from the target--tree mode to print any external Click CLI's subcommand hierarchy without running it--config work transparently through the wrapper, so users can theme third-party CLIs from their own pyproject.tomlTOMLYAMLJSON, JSON5, JSONC and HJSONINI, with extended interpolation, multi-level sections and non-native types (list, set, …)XMLplist, in both its XML and binary variantspyproject.toml integration: the CLI reads its [tool.<cli>] section from the user's project file, including a CWD-aware walk that skips unrelated pyproject.toml files--validate-configConfigValidator) for user-defined sub-trees whose keys are data rather than CLI flags (per-plugin overrides, matrix axes, user-defined IDs), with rooted ValidationError reporting--no-config option to disable configuration file loadingPrompt > CLI > Environment > Config > Defaults precedenceEnumChoice — click.Choice subclass with proper Enum rendering, case-insensitive matching, alias support, and pluggable choice sources--params and the config loaderwrap_other_commands)click-extra screenshot captures any CLI's colored output as an SVG image or a self-contained HTML block, and the window it is drawn in is yours to set: terminal preset, light or dark chrome, gradient backdrop, caption, line numbers, transparency, credit line, border, shadow, corner radius and margins. Every capture in this readme is one, rewritten on each documentation build, and a pair of them can be switched on the reader's own color scheme:
click:source and click:run Sphinx directives in MyST Markdown and reStructuredText to document CLI source code and their executionpython:source, python:run, python:render, python:render-myst, python:render-rst — the same machinery for arbitrary Python, with a render* family that parses the captured output as live document content (replaces the docs_update.py + marker-region pattern)click:run block runs at build time and assertions fail the buildAnsiHtmlFormatter for HTML output of ANSI-colored textCliRunner — click.testing.CliRunner subclass that captures stdout and stderr separately and preserves ANSI codes for assertion against colored outputinvoke, runner, create_config) and ready-made regex helpers (default_options_uncolored_help, default_debug_*) for click-extra-aware test suitesclick-contrib packagesfrom click_extra import … and @click_extra.command works as a transparent superset. Cloup provides option groups, constraints, subcommand sections, aliases, and Did you mean <subcommand>? suggestions; click-extra adds everything above on top.Check these projects to get real-life examples of click-extra usage.
CLIs:
Documentation (depends on click-extra[sphinx] or click-extra[mkdocs]):
Feel free to send a PR to add your project in either list if you are relying on Click Extra in any way.
Python
100.0%