Skip to main content

🌈 Drop-in replacement for Click to make user-friendly and colorful CLI

Project description

Click Extra

Last release Python versions Downloads Unittests status Coverage status Documentation status DOI

What is Click Extra?

It should be easy to write a good CLI in Python. Click makes it so. But there is still hundrends 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).

Who is this for?

Anyone building a CLI who doesn't have time to assemble the pieces from scratch:

  • You use Click and want professional defaults without the boilerplate.
  • You're a security researcher turning a proof-of-concept into a presentable tool to hand off, demo, or attach to an advisory.
  • You're a DevOps engineer or sysadmin whose one-off script grew into a team tool and needs --help, --verbose, --config, and colored output.

Click Extra's defaults-first design means one decorator gets you there. See the 30-second quick start.

Demo

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.

Example

It transforms this vanilla click CLI:

click CLI help screen

Into this:

click-extra CLI help screen

To understand how we ended up with the result above, go read the tutorial.

Features

Configuration

Help screens and theming

Standard options on every CLI

  • Colored --version with template variables for git metadata (branch, hash, date, tag) and pre-baking for compiled binaries (Nuitka, PyInstaller)
  • Colored --verbosity LEVEL and logs, plus -v/--verbose repetition for incremental bumping
  • --show-params to debug parameter defaults, values, environment variables and provenance
  • --tree to print the whole hierarchy of nested subcommands with their descriptions
  • --time/--no-time to measure command execution duration
  • --table-format to switch between 40+ table-rendering styles (uses print_table() and serialize_data())
  • --jobs for parallel-execution worker counts
  • --telemetry/--no-telemetry flag to opt-in/out of tracking code
  • --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
  • Recognition of DO_NOT_TRACK from consoledonottrack.com for telemetry
  • Global show_envvar option to display all environment variables in help screens
  • Global show_choices to activate selection of choices on user input prompts
  • Auto-generation and normalization of environment variables for all options

Types and parameters

CLI wrapper

  • CLI wrapper (click-extra wrap) applies help colorization, themes, and config loading to any Click CLI without modifying its source code
  • show-params subcommand to introspect any external Click CLI's parameters
  • --tree mode to print any external Click CLI's subcommand hierarchy without running it
  • User-defined themes via --config work transparently through the wrapper, so users can theme third-party CLIs from their own pyproject.toml

Performance and structure

Documentation tooling

Testing

  • CliRunnerclick.testing.CliRunner subclass that captures stdout and stderr separately and preserves ANSI codes for assertion against colored output
  • pytest fixtures (invoke, runner, create_config) and ready-made regex helpers (default_options_uncolored_help, default_debug_*) for click-extra-aware test suites

Upstream

  • Fixes 100+ bugs and addresses missing features across Click, Cloup, Pygments, tabulate, MyST-Parser, Furo, and unmaintained click-contrib packages
  • Drop-in replacement for Click and Cloup: every from 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.

Used in

Check these projects to get real-life examples of click-extra usage:

Feel free to send a PR to add your project in this list if you are relying on Click Extra in any way.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

click_extra-8.4.0.tar.gz (362.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

click_extra-8.4.0-py3-none-any.whl (389.3 kB view details)

Uploaded Python 3

File details

Details for the file click_extra-8.4.0.tar.gz.

File metadata

  • Download URL: click_extra-8.4.0.tar.gz
  • Upload date:
  • Size: 362.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for click_extra-8.4.0.tar.gz
Algorithm Hash digest
SHA256 92e5441824126248c61b05471ecacb6403e45a0b0b743f6babf425abb4c217de
MD5 c53d64fd5254941949aef725badb5517
BLAKE2b-256 9a78ff052a35e7b83a1b164e1eda3a5bdeedceeb60e44d2eca1d872312447cee

See more details on using hashes here.

Provenance

The following attestation bundles were made for click_extra-8.4.0.tar.gz:

Publisher: release.yaml on kdeldycke/click-extra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file click_extra-8.4.0-py3-none-any.whl.

File metadata

  • Download URL: click_extra-8.4.0-py3-none-any.whl
  • Upload date:
  • Size: 389.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for click_extra-8.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b94a6fb6cf2396cc5e326a9fca16b3f94aa7b0b55834c3d4e08866c9200678af
MD5 22bb195c31b5719885c37b4a4af26210
BLAKE2b-256 622d7a7c59f6ef0818351a5d596eeb56b42096daf3a1c9743a7d45db17f251e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for click_extra-8.4.0-py3-none-any.whl:

Publisher: release.yaml on kdeldycke/click-extra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page