{"library":"sphinx-click","title":"Sphinx Click","type":"library","description":"sphinx-click is a Sphinx extension that automatically extracts documentation from Click-based command-line applications and integrates it into Sphinx documentation. It is currently at version 6.2.0 and receives regular updates, often with several releases per year.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install sphinx-click"],"cli":null},"imports":["extensions = ['sphinx_click']"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/click-contrib/sphinx-click","docs":"https://sphinx-click.readthedocs.io/en/latest","changelog":null,"pypi":"https://pypi.org/project/sphinx-click/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"# docs/conf.py\nimport os\nimport sys\nsys.path.insert(0, os.path.abspath('.'))\n\nproject = 'My Click App Docs'\ncopyright = '2026, My Team'\nextensions = ['sphinx_click']\nhtml_theme = 'alabaster'\n\n# hello_world.py\nimport click\n\n@click.group()\ndef cli():\n    \"\"\"A sample command group.\"\"\"\n    pass\n\n@cli.command()\n@click.argument('name', envvar='USER', default='World')\ndef hello(name):\n    \"\"\"Greet a user or the world.\n\n    :param name: The name to greet. Defaults to the USER environment variable if set.\n    \"\"\"\n    click.echo(f'Hello {name}!')\n\n@cli.command()\ndef goodbye():\n    \"\"\"Say goodbye.\n\n    \"\"\"\n    click.echo('Goodbye!')\n\n# docs/index.rst\n.. toctree::\n   :maxdepth: 2\n   :caption: Contents:\n\n   cli\n\n.. click:: hello_world:cli\n   :prog: myapp\n   :nested: full\n","lang":"python","description":"To quickly document a Click application, first set up a Sphinx project (e.g., using `sphinx-quickstart`). Create your Click application (e.g., `hello_world.py`). In your `conf.py`, add `'sphinx_click'` to the `extensions` list and ensure your application's path is included in `sys.path`. Then, in an RST file (e.g., `cli.rst`), use the `.. click::` directive, pointing to your Click command or group. The `:prog:` option specifies the command name to display, and `:nested: full` will document subcommands. Ensure the Click application and its dependencies are available in the build environment.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"6.0.0","pypi_latest":"6.2.0","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":5.5,"avg_import_s":0,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"93.0M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.1,"import_time_s":0,"mem_mb":0,"disk_size":"93M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"102.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.5,"import_time_s":0,"mem_mb":0,"disk_size":"103M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"93.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.1,"import_time_s":0,"mem_mb":0,"disk_size":"94M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"93.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.4,"import_time_s":0,"mem_mb":0,"disk_size":"94M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"92.2M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"sphinx-click","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.2,"import_time_s":0,"mem_mb":0,"disk_size":"93M"}]}}