{"id":19931237,"url":"https://github.com/sphinx-contrib/typer","last_synced_at":"2026-03-06T02:55:27.153Z","repository":{"id":212193900,"uuid":"730875788","full_name":"sphinx-contrib/typer","owner":"sphinx-contrib","description":"Auto generate docs for typer and click commands using typer's rich console formatting.","archived":false,"fork":false,"pushed_at":"2025-01-28T20:13:38.000Z","size":575,"stargazers_count":19,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-20T02:43:12.702Z","etag":null,"topics":["autodoc","click","command-line","help","python","sphinx-doc","typer"],"latest_commit_sha":null,"homepage":"https://sphinxcontrib-typer.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sphinx-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-12T21:41:28.000Z","updated_at":"2025-06-10T04:10:48.000Z","dependencies_parsed_at":"2024-05-18T14:35:56.905Z","dependency_job_id":"5ce875dd-45aa-429c-afe6-18fcfec61c8c","html_url":"https://github.com/sphinx-contrib/typer","commit_stats":null,"previous_names":["bckohan/sphinx-typer","bckohan/sphinxcontrib-typer","sphinx-contrib/typer"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/sphinx-contrib/typer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Ftyper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Ftyper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Ftyper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Ftyper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sphinx-contrib","download_url":"https://codeload.github.com/sphinx-contrib/typer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sphinx-contrib%2Ftyper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261495809,"owners_count":23167380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autodoc","click","command-line","help","python","sphinx-doc","typer"],"created_at":"2024-11-12T23:06:34.521Z","updated_at":"2026-03-06T02:55:27.145Z","avatar_url":"https://github.com/sphinx-contrib.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sphinxcontrib-typer\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![PyPI version](https://badge.fury.io/py/sphinxcontrib-typer.svg)](https://pypi.python.org/pypi/sphinxcontrib-typer/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/sphinxcontrib-typer.svg)](https://pypi.python.org/pypi/sphinxcontrib-typer/)\n[![PyPI status](https://img.shields.io/pypi/status/sphinxcontrib-typer.svg)](https://pypi.python.org/pypi/sphinxcontrib-typer)\n[![Documentation Status](https://readthedocs.org/projects/sphinxcontrib-typer/badge/?version=latest)](http://sphinxcontrib-typer.readthedocs.io/?badge=latest/)\n[![Code Cov](https://codecov.io/gh/sphinx-contrib/typer/branch/main/graph/badge.svg?token=0IZOKN2DYL)](https://app.codecov.io/gh/sphinx-contrib/typer)\n[![Test Status](https://github.com/sphinx-contrib/typer/workflows/Test/badge.svg)](https://github.com/sphinx-contrib/typer/actions/workflows/test.yml)\n[![Lint Status](https://github.com/sphinx-contrib/typer/workflows/Lint/badge.svg)](https://github.com/sphinx-contrib/typer/actions/workflows/lint.yml)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sphinx-contrib/typer/badge)](https://securityscorecards.dev/viewer/?uri=github.com/sphinx-contrib/typer)\n\n\nA Sphinx directive for auto generating docs for [Typer](https://typer.tiangolo.com/) \n(and [Click](https://click.palletsprojects.com/) commands!) using the rich console\nformatting available in [Typer](https://typer.tiangolo.com/). This package generates\nconcise command documentation in text, html or svg formats out of the box, but if your\ngoal is to greatly customize the generated documentation\n[sphinx-click](https://sphinx-click.readthedocs.io/en/latest/) may be more appropriate\nand will also work for [Typer](https://typer.tiangolo.com/) commands.\n\n## Installation\n\nInstall with pip::\n\n    pip install sphinxcontrib-typer\n\nAdd ``sphinxcontrib.typer`` to your ``conf.py`` file:\n\n```python\n# be sure that the commands you want to document are importable\n# from the python path when building the docs\nimport sys\nfrom pathlib import Path\nsys.path.insert(0, str(Path(__file__).parent / '../path/to/your/commands'))\n\nextensions = [\n    ...\n    'sphinxcontrib.typer',\n    ...\n]\n```\n\n## Usage\n\nSay you have a command in the file ``examples/example.py`` that looks like\nthis:\n\n```python\nimport typer\nimport typing as t\n\napp = typer.Typer(add_completion=False)\n\n@app.callback()\ndef callback(\n    flag1: bool = typer.Option(False, help=\"Flag 1.\"),\n    flag2: bool = typer.Option(False, help=\"Flag 2.\")\n):\n    \"\"\"This is the callback function.\"\"\"\n    pass\n\n\n@app.command()\ndef foo(\n    name: str = typer.Option(..., help=\"The name of the item to foo.\")\n):\n    \"\"\"This is the foo command.\"\"\"\n    pass\n\n\n@app.command()\ndef bar(\n    names: t.List[str] = typer.Option(..., help=\"The names of the items to bar.\"),\n):\n    \"\"\"This is the bar command.\"\"\"\n    pass\n\n\nif __name__ == \"__main__\":\n    app()\n```\n\nYou can generate documentation for this command using the ``typer`` directive\nlike so:\n\n```rst\n.. typer:: examples.example.app\n    :prog: example1\n    :width: 70\n    :preferred: html\n```\n\nThis would generate html that looks like this:\n\n![Example PNG](https://raw.githubusercontent.com/sphinx-contrib/typer/main/example.html.png)\n\nYou could change ``:preferred:`` to svg, to generate svg instead:\n\n![Example SVG](https://raw.githubusercontent.com/sphinx-contrib/typer/main/example.svg)\n\n|\n\nOr to text\n                                                                                            \n    Usage: example [OPTIONS] COMMAND [ARGS]...                                                  \n                                                                                                \n    This is the callback function.                                                              \n                                                                                                \n    ╭─ Options ──────────────────────────────────────────────────────────╮\n    │ --flag1    --no-flag1      Flag 1. [default: no-flag1]             │\n    │ --flag2    --no-flag2      Flag 2. [default: no-flag2]             │\n    │ --help                     Show this message and exit.             │\n    ╰────────────────────────────────────────────────────────────────────╯\n    ╭─ Commands ─────────────────────────────────────────────────────────╮\n    │ bar           This is the bar command.                             │\n    │ foo           This is the foo command.                             │\n    ╰────────────────────────────────────────────────────────────────────╯\n\n\nThe ``typer`` directive has options for generating docs for all subcommands as well\nand optionally generating independent sections for each. There are also mechanisms\nfor passing options to the underlying console and svg generation functions. See the\nofficial documentation for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphinx-contrib%2Ftyper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsphinx-contrib%2Ftyper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsphinx-contrib%2Ftyper/lists"}