Click

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

Library
PyPI
v8.5.0
17,800 stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
87 /100 Excellent
Development Activity 88
Maintenance 72
Community 88
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 85
Code Quality 88
Innovation 82
Learning Curve 90

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 50 apps in this directory

Rust
63%
MIT

PostgresML

AI Development · Databases

6,823

Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.

View details
51
Repo Health
76
Technical
64
Dependency
Built with
Rust 63%
JavaScript 11%
Updated 1 years ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 6 days ago
Python
45%
Other

Redash

Analytics · Data Engineering

28,849

Redash lets anyone connect to 35+ SQL and NoSQL data sources, write a query in the browser, and turn the result into a shared dashboard — no separate BI suite required.

View details
91
Repo Health
74
Technical
61
Dependency
Built with
Python 45%
JavaScript 29%
TypeScript 19%
Updated 1 weeks ago
TypeScript
98%
Apache 2.0

rowboat

AI Assistants · AI Development

18,060

Build, test, and deploy multi-agent AI workflows with a visual editor, RAG data sources, MCP tool integration, and a production-ready REST API.

View details
88
Repo Health
72
Technical
65
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
TypeScript
67%
MIT

Scalar

Developer Tools

16,313

Beautiful, interactive OpenAPI documentation with a built-in offline-first API client and multi-language code generation — all in one open-source platform.

View details
90
Repo Health
89
Technical
65
Dependency
Built with
TypeScript 67%
Vue 29%
Updated 6 days ago
Python
57%
Other

Sentry

Analytics · Developer Tools · Monitoring

45,632

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
66
Dependency
Built with
Python 57%
TypeScript 42%
Updated 6 days ago
Python
79%
AGPL 3.0

Skyvern

AI Agents · Automation

23,257

Skyvern (YC S2023) automates browser-based workflows by pairing LLMs with computer vision, letting agents click, fill, and extract data on sites they've never seen, without brittle XPath selectors that break on every layout change.

View details
89
Repo Health
82
Technical
70
Dependency
Built with
Python 79%
TypeScript 19%
Updated 6 days ago
Python
94%
Apache 2.0

SWIRL

Data Engineering · Databases · Search

3,046

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
61
Repo Health
83
Technical
65
Dependency
Built with
Python 94%
Updated 1 weeks ago
Python
97%
MPL 2.0

Taiga Back

Developer Tools · Project Management

859

Self-hosted agile project management backend with Scrum, Kanban, issue tracking, and a full REST API — built on Django and PostgreSQL.

View details
72
Repo Health
74
Technical
64
Dependency
Built with
Python 97%
Updated 1 months ago

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