Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

click

> 开发工具
Open source

Python composable command line interface toolkit

17.6K stars0 likes1 views
WebsiteGitHub

About

Python composable command line interface toolkit

Click

Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. It's the "Command Line Interface Creation Kit". It's highly configurable but comes with sensible defaults out of the box.

It aims to make the process of writing command line tools quick and fun while also preventing any frustration caused by the inability to implement an intended CLI API.

Click in three points:

  • Arbitrary nesting of commands
  • Automatic help page generation
  • Supports lazy loading of subcommands at runtime

A Simple Example

python
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()
$ python hello.py --count=3
Your name: Click
Hello, Click!
Hello, Click!
Hello, Click!

Donate

The Pallets organization develops and supports Click and other popular packages. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects, please donate today.

Contributing

See our detailed contributing documentation for many ways to contribute, including reporting issues, requesting features, asking or answering questions, and making PRs.

Issues· 86 open

View all issuesOpen on GitHub
  • #2847

    Long option completion with = broken

    shell completionUpdated Sep 21, 2026
  • #3847

    More private utilities that need to be marked and public api deprecated

    typingUpdated Sep 20, 2026
  • #3362

    `HelpFormatter.write_usage` breaks options at a hyphen

    help outputUpdated Sep 18, 2026
  • #3840

    `click.edit` on Windows throws WinError 14001 or 87

    Updated Sep 14, 2026
  • #3010

    Impossible to get single newlines in help text

    help outputUpdated Sep 12, 2026
  • #3154

    Click 9.0

    parsingUpdated Sep 8, 2026
  • #3036

    Add support for `set` and `frozenset` (and `dict`?) as native Click types

    typingtestsUpdated Sep 8, 2026
  • #3081

    Add Screenshot workflow

    docsUpdated Aug 31, 2026
  • #2429

    for argument type File, `lazy` does not work on Windows

    parsingUpdated Aug 29, 2026
  • #2992

    Add output of get_usage() to get_info_dict()

    parsingUpdated Aug 29, 2026

> Tags

Pythoncliclickpalletspython

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具