Click-compose is a Python library that provides composable utilities for enhancing Click callback functions, enabling the construction of flexible and modular command-line interface (CLI) applications. It extends the core functionality of the Click framework by offering tools to easily chain and combine command logic. The library is actively maintained, with its current version being 2025.10.27.3, and follows a frequent release cadence.
pip install click-composeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic Click CLI application using `click-compose` to create a `callback_group` and a `composed_option`. The `cli` command acts as a group, and `shout` is a subcommand that uses a composed option to conditionally output an uppercase greeting. This illustrates how to extend Click's decorator-based approach with additional composition logic.
Check the 'click-compose' release notes for compatibility with your 'click' version. Pin 'click' to a known compatible version if issues arise.
Always place 'click-compose' decorators above standard 'click' decorators, or consult the documentation for specific decorator stacking order. Generally, more 'inner' decorators (affecting the immediate function) should be closer to the function definition.
Ensure that `click` commands modified by `click-compose` are always invoked correctly within the Click ecosystem, typically through a parent `click.group` or `cli()` entry point, not as standalone Python functions.
Run `pip install click-compose` to install the library.
No resource links recorded.