Click is a Python framework for building command-line interfaces. It provides a declarative approach to defining command structures, allowing developers to map functions to command-line arguments, options, and nested groups using decorators. The framework handles the complexities of parameter parsing, type validation, and help documentation generation automatically.
The project distinguishes itself through its hierarchical context system, which propagates configuration and state across nested commands, and its environment-aware parameter resolution that prioritizes command-line inputs, environment variables, and interactive prompts. It includes native support for shell completion, allowing for context-aware suggestions, and provides a robust terminal toolkit for handling interactive user input, progress bars, and styled output.
Beyond core parsing, the framework offers extensive utilities for file system management, cross-platform stream handling, and terminal interaction. It supports complex execution lifecycles, including lazy command loading, custom error handling, and programmatic subcommand invocation, while providing built-in tools for testing command-line interfaces in isolated environments.