Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Click

Build command-line tools in Python.

Dev workflow and configPYPI

GitHub

1. License

“Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met”

Any use is allowed; keep the copyright notice and license text when you ship Click's files.

click.palletsprojects.com/en/stable/license/

From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error

What Click does

Click is a free Python library for making command-line tools, the programs you run by typing a command in a terminal. You describe the options with a few lines above a function, and Click reads what the user typed, checks it and writes the help screen. It does not draw windows or web pages.

What people build with it

A script your team can run

Your assistant wrote a Python script that resizes photos or imports a price list; Click turns it into a command with named options, defaults and a --help screen.

One tool with several commands

An admin helper for your shop with separate commands such as create-user and wipe-orders, each with its own options and help.

Ask before deleting things

A cleanup command asks "Are you sure?" and hides a password while it is typed, so nobody wipes data or leaks a secret by accident.

Keys from settings, not the command

A command reads a service's secret key from a setting on the server instead of the typed command, so the key does not end up in the shell history.

Check your commands in tests

Your assistant writes tests that run each command with sample input and check the exit code and the printed text.

Tab completion for your tool

People who use your tool every day press Tab to finish command and option names in their terminal.

Click popularity

82 / 100
Gid Score, #74 overall
268M
downloads a week, pypi
17.8K
GitHub stars
154
agent projects use it
Click: downloads per weekPyPI, click 267,479,739
Click: GitHub starspallets/click 17,845

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Click is used

  • Click is a dependency in 154 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (9.5% of the 1,623 Python ones), #13 of 299 in dev workflow and config.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,624; those are left out of every share on this page.
  • The most used alternative in our scan is Typer (126 projects).
  • Projects that use it most often also use Pydantic (64.9%), python-dotenv (61.7%), PyYAML (60.4%).
  • It is more common in projects set up for Roo Code (6.3%) than for OpenClaw (1.5%).

By coding agent

96 projects, 2.9%
76 projects, 2.5%
65 projects, 2.7%
13 projects, 2.8%
12 projects, 2.5%
7 projects, 6.3%
5 projects, 1.5%
5 projects, 1.8%

Often used with

In 64.9% of its projects
In 61.7% of its projects
In 60.4% of its projects
In 55.8% of its projects
In 55.2% of its projects
In 49.4% of its projects
In 42.2% of its projects
In 38.3% of its projects

More about Click

Funding
  • GitHub Sponsors: https://github.com/pallets
  • Own page: https://palletsprojects.com/donate
  • Tidelift: https://tidelift.com/funding/github/pypi/Flask
  • thanks.dev: https://thanks.dev/u/gh/pallets
  • 31 GitHub sponsors

See all

Agent Skills for it
  • click-test-plan: Design first-click and click tests for findability and navigation. Use when testing whether people can locate something. For full task-based

See all

Head to head
More in Dev workflow and config

Alternatives

Click This page

BSD-3-ClauseGid 82268M/wk

Typer

Pick Typer when you would rather describe options with Python type hints than with decorators; it is built on top of Click.

MITGid 7974.7M/wk

Fire

Pick Fire for a quick internal tool made from existing functions with no option definitions at all.

docopt

Pick docopt when you want to write the help text first and have the parser follow it, and need no nested commands.

Compare Click with another tool

Get started

Tell your AI assistant

“Use the Python library Click (pin click==8.5.1, Python 3.10+) to turn this script into a command with named options, defaults, a --help screen and an environment variable for the API key, add CliRunner tests, and register it under [project.scripts] in pyproject.toml.”

  1. Install Click into your project's virtual environment.

    pip install click

    From click.palletsprojects.com/en/stable/quickstart/

  2. Write a command as a decorated function and call it.

    import click
    
    @click.command()
    @click.option("--count", default=1, help="Number of greetings.")
    @click.option("--name", prompt="Your name", help="The person to greet.")
    def hello(count, name):
        """Simple program that greets NAME for a total of COUNT times."""
        for _ in range(count):
            click.echo(f"Hello, {name}!")
    
    if __name__ == '__main__':
        hello()
    

    From github.com/pallets/click/blob/main/README.md

  3. To run it as a plain command (and get tab completion), add it to pyproject.toml as an entry point and install the project.

    [project.scripts]
    hello = "hello.hello:cli"
    

    From click.palletsprojects.com/en/stable/entry-points/

Mistakes to avoid

CliRunner(mix_stderr=False), copied from tests written for Click 8.1
CliRunner() and read result.stdout, result.stderr or result.output

8.2.0 removed the mix_stderr parameter; in our run on 8.5.1 it raised TypeError (unexpected keyword argument).

click.__version__ to check the installed version
importlib.metadata.version("click")

The attribute is deprecated since 8.2.0; in our run on 8.5.1 it printed a DeprecationWarning that names removal in Click 9.1.

Subclassing click.MultiCommand or click.BaseCommand from old examples
Subclass click.Group or click.Command

Both old base classes are deprecated since 8.2.0.

Telling users to run def create_user as "tool create_user"
Call it "tool create-user", or name the command explicitly with @cli.command("create_user")

Click replaces underscores with dashes in command names; our run listed create-user and wipe-orders.

with runner.isolated_filesystem() in new tests
Use pytest's tmp_path (or tempfile.TemporaryDirectory) and absolute paths

isolated_filesystem() is deprecated since 8.5.0 because it changes the working folder of the whole process.

Questions

Can I use it in a paid, closed-source tool?

Yes. Click is under the BSD-3-Clause license; keep its copyright notice if you ship its files.

Why not Python's built-in argparse?

Click's docs say argparse does not allow proper nesting of commands, so Click has its own parser.

Can it ask for a password without showing it?

Yes. password_option() asks twice and hides what is typed.

Which shells get tab completion?

Bash 4.4 and newer, Zsh, Fish and, since 8.5.0, PowerShell.

Is it still maintained?

Yes. Version 8.5.1 was released on 2026-11-06 by the Pallets organization, which also makes Flask.