cloup
Adds features to Click: option groups, constraints, subcommand sections and help themes.
What it is and what it does
Cloup is a Click extension that adds structured organization and validation to command-line interfaces. It lets you group related options, apply constraints like mutual exclusivity or minimum-required counts, organize subcommands into sections, and customize help output with themes and colors. The package is built on top of Click and adds decorators with detailed type hints, making it easier to write complex CLIs with better IDE support and validation.
The library is actively maintained, supports Python 3.9 through 3.13, and has no known security vulnerabilities. It depends only on Click and typing_extensions, keeping installation lightweight. The codebase is statically type-checked with MyPy and extensively tested, making it suitable for production CLI applications where you need more control over option organization and user-facing validation messages.
Use it for:
- Organize related CLI options into labeled groups with shared constraints like mutual exclusivity or minimum-required selections
- Build multi-level command hierarchies with subcommands organized into logical sections in the help output
- Apply conditional parameter validation (e.g., require at least N of a group, or enforce mutual exclusivity) without manual checking
- Customize help text appearance with themed colors and styles, including responsive layouts for narrow terminals
- Provide "did you mean?" suggestions when users mistype subcommand names
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cloup extends Click with option groups, parameter constraints, subcommand sections, themeable help formatting, and subcommand aliases to build more expressive command-line interfaces.
Yes. Cloup is a lightweight, actively maintained extension that solves real CLI organization and validation problems. If you're building a Click-based CLI with multiple options or subcommands, Cloup's option groups and constraints eliminate boilerplate validation code and improve help readability. The permissive license, low dependency footprint, and current Python version support make it a safe, practical choice.
Install
cloup on PyPI
pip
pip install cloupuv
uv add clouppoetry
poetry add cloupInstalling cloup
Before you install
Low install friction with only two runtime dependencies (click and typing_extensions). Actively maintained with a release 80 days ago and recent commits; supports Python 3.9 through 3.13.
License in practice
BSD 3-Clause is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
Quickstart
pip install cloup
from cloup import command, option_group, option
from cloup.constraints import mutually_exclusive
@command()
@option_group(
"Options",
option('--foo'),
option('--bar'),
constraint=mutually_exclusive,
)
def cmd(**kwargs):
pass
if __name__ == '__main__':
cmd()
Verify before relying
- Whether the 100% test coverage claim and MyPy strict-mode checking are maintained in the current release
- Performance impact of constraint validation on large option sets or deeply nested command hierarchies
Package facts
| License | BSD 3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — click, typing_extensions |
| Maintenance | actively maintained — 80 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,069,199/month — #4,408 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cloup-3.1.0-py2.py3-none-any.whl
Keywords: CLI, click, argument groups, option groups, constraints, help colors, help themes, help styles
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
click-option-groupAdds option groups to Click CLI applications,…
permissive · top 1,000 on PyPI
mkdocs-clickGenerates API documentation for Click…
permissive · top 5,000 on PyPI
blurbblurb is a command-line tool that manages…
permissive · top 15,000 on PyPI
click-default-groupExtends Click's Group class to invoke a default…
permissive · top 5,000 on PyPI
clikitCliKit provides utilities for building…
permissive · top 5,000 on PyPI
click-extraClick Extra is a wrapper around Click that adds…
copyleft · top 15,000 on PyPI
stySty provides a simple, customizable string…
permissive · top 15,000 on PyPI
rich-toolkitRich Toolkit provides opinionated CLI…
permissive · top 1,000 on PyPI
pastelPastel adds colored text output to terminal…
permissive · top 5,000 on PyPI
click-aliasesAdds command aliases to Click CLI groups and…
permissive · top 5,000 on PyPI