{
 "kind": "tool",
 "slug": "click-py",
 "path": "tools/click-py/",
 "name": "Click",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Dev workflow and config",
   "tools/dev-workflow/"
  ]
 ],
 "lead": "Build command-line tools in Python.",
 "chips": [
  {
   "label": "Dev workflow and config",
   "path": "tools/dev-workflow/"
  },
  {
   "label": "PYPI"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "pip install click"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/pallets/click"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "BSD-3-Clause",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met",
   "note": "Any use is allowed; keep the copyright notice and license text when you ship Click's files.",
   "src": "https://click.palletsprojects.com/en/stable/license/"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 16, 2026",
   "note": "Latest GitHub release Nov 6, 2026. ",
   "src": "https://github.com/pallets/click"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "154 projects",
   "status": "info",
   "sub": "#13 of 299 in its category",
   "note": "Dependency in 154 public GitHub projects set up for AI coding agents that we scanned (2.5%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community skills",
   "status": "info",
   "sub": "1 skills by others",
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Click does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "A script your team can run",
       "text": "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.",
       "idea": false
      },
      {
       "title": "One tool with several commands",
       "text": "An admin helper for your shop with separate commands such as create-user and wipe-orders, each with its own options and help.",
       "idea": false
      },
      {
       "title": "Ask before deleting things",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Keys from settings, not the command",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Check your commands in tests",
       "text": "Your assistant writes tests that run each command with sample input and check the exit code and the printed text.",
       "idea": false
      },
      {
       "title": "Tab completion for your tool",
       "text": "People who use your tool every day press Tab to finish command and option names in their terminal.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Click popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "82",
       "of": "/ 100",
       "l": "Gid Score, #74 overall"
      },
      {
       "n": "268M",
       "l": "downloads a week, pypi"
      },
      {
       "n": "17.8K",
       "l": "GitHub stars"
      },
      {
       "n": "154",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Click is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "96 projects, 2.9%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "76 projects, 2.5%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "65 projects, 2.7%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "13 projects, 2.8%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "12 projects, 2.5%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "7 projects, 6.3%",
       "v": "Roo Code",
       "path": "agents/roo-code/"
      },
      {
       "l": "5 projects, 1.5%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "5 projects, 1.8%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 64.9% of its projects",
       "v": "Pydantic",
       "path": "tools/pydantic/"
      },
      {
       "l": "In 61.7% of its projects",
       "v": "python-dotenv",
       "path": "tools/python-dotenv/"
      },
      {
       "l": "In 60.4% of its projects",
       "v": "PyYAML",
       "path": "tools/pyyaml/"
      },
      {
       "l": "In 55.8% of its projects",
       "v": "Requests",
       "path": "tools/requests-py/"
      },
      {
       "l": "In 55.2% of its projects",
       "v": "Rich",
       "path": "tools/rich/"
      },
      {
       "l": "In 49.4% of its projects",
       "v": "Uvicorn",
       "path": "tools/uvicorn/"
      },
      {
       "l": "In 42.2% of its projects",
       "v": "NumPy",
       "path": "tools/numpy/"
      },
      {
       "l": "In 38.3% of its projects",
       "v": "FastAPI",
       "path": "tools/fastapi/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about Click",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "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"
       ]
      },
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "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"
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "Click vs Typer",
         "note": "used together in 36 projects",
         "path": "tools/compare/click-vs-typer/"
        }
       ]
      },
      {
       "title": "More in Dev workflow and config",
       "path": "tools/dev-workflow/",
       "items": [
        {
         "text": "dotenv",
         "path": "tools/dotenv/"
        },
        {
         "text": "Husky",
         "path": "tools/husky/"
        },
        {
         "text": "python-dotenv",
         "path": "tools/python-dotenv/"
        },
        {
         "text": "lint-staged",
         "path": "tools/lint-staged/"
        },
        {
         "text": "concurrently",
         "path": "tools/concurrently/"
        },
        {
         "text": "Rich",
         "path": "tools/rich/"
        },
        {
         "text": "Pydantic Settings",
         "path": "tools/pydantic-settings/"
        },
        {
         "text": "cross-env",
         "path": "tools/cross-env/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Click",
       "me": true,
       "facts": [
        "BSD-3-Clause",
        "Gid 82",
        "268M/wk"
       ]
      },
      {
       "name": "Typer",
       "why": "Pick Typer when you would rather describe options with Python type hints than with decorators; it is built on top of Click.",
       "path": "tools/typer/",
       "facts": [
        "MIT",
        "Gid 79",
        "74.7M/wk"
       ]
      },
      {
       "name": "Fire",
       "why": "Pick Fire for a quick internal tool made from existing functions with no option definitions at all.",
       "path": "tools/fire/",
       "facts": []
      },
      {
       "name": "docopt",
       "why": "Pick docopt when you want to write the help text first and have the parser follow it, and need no nested commands.",
       "path": "tools/docopt/",
       "facts": []
      }
     ],
     "more": "Compare Click with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "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."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Install Click into your project's virtual environment.",
       "code": "pip install click",
       "src": "https://click.palletsprojects.com/en/stable/quickstart/"
      },
      {
       "text": "Write a command as a decorated function and call it.",
       "code": "import click\n\n@click.command()\n@click.option(\"--count\", default=1, help=\"Number of greetings.\")\n@click.option(\"--name\", prompt=\"Your name\", help=\"The person to greet.\")\ndef hello(count, name):\n    \"\"\"Simple program that greets NAME for a total of COUNT times.\"\"\"\n    for _ in range(count):\n        click.echo(f\"Hello, {name}!\")\n\nif __name__ == '__main__':\n    hello()\n",
       "src": "https://github.com/pallets/click/blob/main/README.md"
      },
      {
       "text": "To run it as a plain command (and get tab completion), add it to pyproject.toml as an entry point and install the project.",
       "code": "[project.scripts]\nhello = \"hello.hello:cli\"\n",
       "src": "https://click.palletsprojects.com/en/stable/entry-points/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "CliRunner(mix_stderr=False), copied from tests written for Click 8.1",
       "fix": "CliRunner() and read result.stdout, result.stderr or result.output",
       "why": "8.2.0 removed the mix_stderr parameter; in our run on 8.5.1 it raised TypeError (unexpected keyword argument)."
      },
      {
       "dont": "click.__version__ to check the installed version",
       "fix": "importlib.metadata.version(\"click\")",
       "why": "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."
      },
      {
       "dont": "Subclassing click.MultiCommand or click.BaseCommand from old examples",
       "fix": "Subclass click.Group or click.Command",
       "why": "Both old base classes are deprecated since 8.2.0."
      },
      {
       "dont": "Telling users to run def create_user as \"tool create_user\"",
       "fix": "Call it \"tool create-user\", or name the command explicitly with @cli.command(\"create_user\")",
       "why": "Click replaces underscores with dashes in command names; our run listed create-user and wipe-orders."
      },
      {
       "dont": "with runner.isolated_filesystem() in new tests",
       "fix": "Use pytest's tmp_path (or tempfile.TemporaryDirectory) and absolute paths",
       "why": "isolated_filesystem() is deprecated since 8.5.0 because it changes the working folder of the whole process."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Can I use it in a paid, closed-source tool?",
       "a": "Yes. Click is under the BSD-3-Clause license; keep its copyright notice if you ship its files.",
       "evidence": {
        "url": "https://click.palletsprojects.com/en/stable/license/",
        "quote": "Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."
       }
      },
      {
       "q": "Why not Python's built-in argparse?",
       "a": "Click's docs say argparse does not allow proper nesting of commands, so Click has its own parser.",
       "evidence": {
        "url": "https://click.palletsprojects.com/en/stable/why/",
        "quote": "The reason it's not based on argparse is that argparse does not allow proper nesting of commands by design and has some deficiencies when it comes to POSIX compliant argument handling."
       }
      },
      {
       "q": "Can it ask for a password without showing it?",
       "a": "Yes. password_option() asks twice and hides what is typed.",
       "evidence": {
        "url": "https://click.palletsprojects.com/en/stable/option-decorators/",
        "quote": "Click supports hidden prompts and asking for confirmation. This is useful for password input:"
       }
      },
      {
       "q": "Which shells get tab completion?",
       "a": "Bash 4.4 and newer, Zsh, Fish and, since 8.5.0, PowerShell.",
       "evidence": {
        "url": "https://click.palletsprojects.com/en/stable/changes/",
        "quote": "Add built-in shell completion support for PowerShell (Windows PowerShell 5.1+ and pwsh 7+) alongside the existing bash , zsh , and fish completers."
       }
      },
      {
       "q": "Is it still maintained?",
       "a": "Yes. Version 8.5.1 was released on 2026-11-06 by the Pallets organization, which also makes Flask.",
       "evidence": {
        "url": "https://click.palletsprojects.com/en/stable/changes/",
        "quote": "Version 8.5.1 ¶ Released 2026-11-06"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "pypi click"
  ],
  [
   "Category",
   "Dev workflow and config"
  ],
  [
   "License",
   "BSD-3-Clause"
  ],
  [
   "Gid Score",
   "81.7"
  ],
  [
   "Rank in category",
   "#13 of 299"
  ],
  [
   "GitHub",
   "pallets/click"
  ],
  [
   "Last change",
   "Nov 16, 2026"
  ]
 ],
 "good": [
  "Version 8.5 needs Python 3.10 or newer; 8.2 dropped Python 3.7 to 3.9.",
  "Tab completion works only when the tool is installed as a command, not when started with python script.py.",
  "The look of the help screen can be changed only a little, on purpose; rich-click adds colors and panels on top."
 ],
 "checked_line": "Read by AgentGid from 15 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/pallets.png"
}