Click

A composable Python toolkit for building command line interfaces with minimal boilerplate.

Library
PyPI
v8.4.2
17,628stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
89/100Excellent
Development Activity100
Maintenance72
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture85
Code Quality88
Innovation82
Learning Curve90

Click is a Python package for creating command line interfaces in a composable way with as little code as necessary. Maintained by the Pallets organization (the team behind Flask and Jinja), it wraps argument parsing, help-page generation, and prompting behind a decorator-based API so developers can turn any function into a CLI command without hand-rolling argparse boilerplate.

Click supports arbitrary nesting of commands into groups, automatic --help generation, type conversion and validation for options and arguments, shell completion for Bash/Zsh/Fish, and a dedicated testing utility (CliRunner) for invoking commands in isolation. It has zero required runtime dependencies and ships full type hints, making it a common default for CLI tooling across the Python ecosystem.

What You Get

  • Decorator-based command and group definitions (@click.command, @click.group) with arbitrary nesting of subcommands
  • Automatic --help page generation and usage-error formatting for every command and option
  • Built-in parameter types and validation (paths, files, choices, ints/floats with ranges, custom types) with clear error messages on bad input
  • Interactive prompting and confirmation helpers (click.prompt, click.confirm) including hidden password input
  • Shell completion support for Bash, Zsh, and Fish, generated from the same command definitions
  • A CliRunner testing utility for invoking commands in-process and asserting on output, exit codes, and exceptions without spawning subprocesses

Common Use Cases

  • Building a package’s console_scripts entry point (the CLI a user runs after pip install your-tool)
  • Wrapping an internal script with subcommands (e.g. mytool sync, mytool deploy) instead of hand-parsing sys.argv
  • Adding a debug/admin CLI to a larger application (data migrations, cache warms, one-off maintenance tasks)
  • Writing testable CLI tools where behavior is verified via CliRunner in CI rather than manual invocation

Under The Hood

Architecture — Click’s execution flow centers on src/click/core.py, which defines the Command, Group, Parameter, Argument, Option, and Context classes. A Command.main() call constructs a Context, delegates to _OptionParser (in parser.py) to tokenize sys.argv into option/argument values, applies each Parameter’s type conversion (types.py), and then invokes the wrapped callback with the resolved keyword arguments. Group subclasses Command and dispatches to child commands by name, enabling arbitrary nesting. Cross-cutting concerns — terminal styling (termui.py), text wrapping for help pages (formatting.py, _textwrap.py), and platform-specific I/O quirks (_compat.py, _winconsole.py for Windows console handling) — are isolated into dedicated modules rather than mixed into core.py.

Tech Stack — Pure Python (99.98% of the codebase per GitHub’s language breakdown), targeting Python 3.10+, with zero required runtime dependencies (pyproject.toml declares no [project.dependencies] entries — only dev-time groups for ruff, pytest, mypy/pyright, and docs tooling via sphinx). Packaged with flit_core as the build backend. The only conditional dependency is colorama for ANSI color support on legacy Windows terminals, resolved via _compat.py at runtime.

Code Quality — The tests/ directory contains 45 test modules covering core parsing (test_basic.py, test_arguments.py, test_options.py), command groups, shell completion, and terminal UI helpers, run via pytest (with pytest-randomly/pytest-xdist variants configured for CI). The project is fully type-hinted (py.typed marker present) and type-checked with both mypy and pyright in CI. Naming is consistent and PEP 8-conformant throughout core.py and decorators.py; internal-only helpers are prefixed with a leading underscore (_OptionParser, _compat) to keep the public surface deliberate.

API Design — The decorator API (@click.command(), @click.option("--count", default=1)) requires almost no boilerplate to go from a plain function to a working CLI, and documentation is dense with runnable examples (the README’s hello.py sample is representative of the docs site as a whole). Parameter names, help text, and defaults are declared inline at the call site rather than in a separate schema, which keeps command definitions readable but does mean large commands with many options can get visually dense. The examples/ directory (naval, repo, complex, validation, colors, completion, etc.) demonstrates real-world composition patterns beyond the basic decorator usage.

Used by 48 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
49%
Other

Airbyte

Developer Tools · Data Engineering

21,916

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python49%
Kotlin42%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
Python
76%
MIT

ArchiveBox

Bookmarks Archiving

28,138

Self-hosted web archiving that saves HTML, PDFs, screenshots, media, and code in open formats you own forever

View details
88
Repo Health
84
Technical
70
Dependency
Built with
Python76%
HTML12%
Updated today
Python
59%
Apache 2.0

argilla

AI Development · Data Engineering

5,081

Collaborate on high-quality AI training data with a self-hosted annotation platform built for LLMs, NLP, and multimodal models.

View details
65
Repo Health
81
Technical
63
Dependency
Built with
Python59%
Jupyter Notebook21%
Updated 2 days ago
Python
88%
Apache 2.0

ART

AI Development

10,603

Give your LLM agents on-the-job training—ART lets you apply GRPO reinforcement learning to any multi-step agentic workflow with minimal code changes.

View details
85
Repo Health
82
Technical
72
Dependency
Built with
Python88%
Cuda10%
Updated today
Python
68%
Other

AutoGPT

Automation · Productivity · AI Assistants

186,687

Build, deploy, and run autonomous AI agents that automate complex multi-step workflows using a visual block-based graph editor.

View details
93
Repo Health
78
Technical
67
Dependency
Built with
Python68%
TypeScript31%
Updated today
Go
82%
AGPL 3.0

Beta9

Developer Tools · AI Development · Data Engineering

1,746

Run AI workloads at scale with a Pythonic serverless runtime that handles GPU inference, background jobs, and sandboxes with zero infrastructure overhead.

View details
85
Repo Health
78
Technical
69
Dependency
Built with
Go82%
Python17%
Updated today
TypeScript
49%
AGPL 3.0

BrowserOS

Browser · AI Assistants

13,248

The open-source agentic Chromium browser with native AI agents, MCP server, and visual workflow automation — your data never leaves your machine.

View details
87
Repo Health
82
Technical
69
Dependency
Built with
TypeScript49%
Rust22%
Python16%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search