{"id":13602826,"url":"https://github.com/iterative/shtab","last_synced_at":"2025-05-14T10:13:20.519Z","repository":{"id":37087757,"uuid":"272102149","full_name":"iterative/shtab","owner":"iterative","description":"↔️ Automagic shell tab completion for Python CLI applications","archived":false,"fork":false,"pushed_at":"2025-03-03T18:21:07.000Z","size":966,"stargazers_count":387,"open_issues_count":32,"forks_count":34,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-01T10:36:02.909Z","etag":null,"topics":["argcomplete","argopt","argparse","bash","bash-completion","cli","completion","developer-tools","docopt","documentation","hacktoberfest","pages","python","pyzshcomplete","tab-completion","tcsh","zsh"],"latest_commit_sha":null,"homepage":"https://docs.iterative.ai/shtab","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iterative.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"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}},"created_at":"2020-06-13T23:34:04.000Z","updated_at":"2025-03-15T00:15:09.000Z","dependencies_parsed_at":"2024-01-01T19:27:40.394Z","dependency_job_id":"e235ade0-7b0d-4d84-ae89-b168ff659d26","html_url":"https://github.com/iterative/shtab","commit_stats":{"total_commits":336,"total_committers":23,"mean_commits":"14.608695652173912","dds":"0.19047619047619047","last_synced_commit":"5a248b0ff25822d26e13c65a5510ab1339b888a5"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fshtab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fshtab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fshtab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iterative%2Fshtab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iterative","download_url":"https://codeload.github.com/iterative/shtab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526741,"owners_count":20953143,"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":["argcomplete","argopt","argparse","bash","bash-completion","cli","completion","developer-tools","docopt","documentation","hacktoberfest","pages","python","pyzshcomplete","tab-completion","tcsh","zsh"],"created_at":"2024-08-01T18:01:39.194Z","updated_at":"2025-05-14T10:13:20.485Z","avatar_url":"https://github.com/iterative.png","language":"Python","readme":"|Logo|\n\nshtab\n=====\n\n|PyPI-Downloads| |Tests| |Coverage| |PyPI| |Conda|\n\n- What: Automatically generate shell tab completion scripts for Python CLI apps\n- Why: Speed \u0026 correctness. Alternatives like\n  `argcomplete \u003chttps://pypi.org/project/argcomplete\u003e`_ and\n  `pyzshcomplete \u003chttps://pypi.org/project/pyzshcomplete\u003e`_ are slow and have\n  side-effects\n- How: ``shtab`` processes an ``argparse.ArgumentParser`` object to generate a\n  tab completion script for your shell\n\nFeatures\n--------\n\n- Outputs tab completion scripts for\n\n  - ``bash``\n  - ``zsh``\n  - ``tcsh``\n\n- Supports\n\n  - `argparse \u003chttps://docs.python.org/library/argparse\u003e`_\n  - `docopt \u003chttps://pypi.org/project/docopt\u003e`_ (via `argopt \u003chttps://pypi.org/project/argopt\u003e`_)\n\n- Supports arguments, options and subparsers\n- Supports choices (e.g. ``--say={hello,goodbye}``)\n- Supports file and directory path completion\n- Supports custom path completion (e.g. ``--file={*.txt}``)\n\n------------------------------------------\n\n.. contents:: Table of Contents\n   :backlinks: top\n\nInstallation\n------------\n\nChoose one of:\n\n- ``pip install shtab``, or\n- ``conda install -c conda-forge shtab``\n\nSee `operating system-specific instructions in the docs \u003chttps://docs.iterative.ai/shtab/#installation\u003e`_.\n\nUsage\n-----\n\nThere are two ways of using ``shtab``:\n\n- `CLI Usage \u003chttps://docs.iterative.ai/shtab/use/#cli-usage\u003e`_: ``shtab``'s own CLI interface for external applications\n\n  - may not require any code modifications whatsoever\n  - end-users execute ``shtab your_cli_app.your_parser_object``\n\n- `Library Usage \u003chttps://docs.iterative.ai/shtab/use/#library-usage\u003e`_: as a library integrated into your CLI application\n\n  - adds a couple of lines to your application\n  - argument mode: end-users execute ``your_cli_app --print-completion {bash,zsh,tcsh}``\n  - subparser mode: end-users execute ``your_cli_app completion {bash,zsh,tcsh}``\n\nExamples\n--------\n\nSee `the docs for usage examples \u003chttps://docs.iterative.ai/shtab/use/#main.py\u003e`_.\n\nFAQs\n----\n\nNot working? Check out `frequently asked questions \u003chttps://docs.iterative.ai/shtab/#faqs\u003e`_.\n\nAlternatives\n------------\n\n- `argcomplete \u003chttps://pypi.org/project/argcomplete\u003e`_\n\n  - executes the underlying script *every* time ``\u003cTAB\u003e`` is pressed (slow and\n    has side-effects)\n\n- `pyzshcomplete \u003chttps://pypi.org/project/pyzshcomplete\u003e`_\n\n  - executes the underlying script *every* time ``\u003cTAB\u003e`` is pressed (slow and\n    has side-effects)\n  - only provides ``zsh`` completion\n\n- `click \u003chttps://pypi.org/project/click\u003e`_\n\n  - different framework completely replacing the builtin ``argparse``\n  - solves multiple problems (rather than POSIX-style \"do one thing well\")\n\nContributions\n-------------\n\nPlease do open `issues \u003chttps://github.com/iterative/shtab/issues\u003e`_ \u0026 `pull requests \u003chttps://github.com/iterative/shtab/pulls\u003e`_! Some ideas:\n\n- support ``fish`` (`#174 \u003chttps://github.com/iterative/shtab/pull/174\u003e`_)\n- support ``powershell``\n\nSee\n`CONTRIBUTING.md \u003chttps://github.com/iterative/shtab/tree/main/CONTRIBUTING.md\u003e`_\nfor more guidance.\n\n|Hits|\n\n.. |Logo| image:: https://github.com/iterative/shtab/raw/main/meta/logo.png\n.. |Tests| image:: https://img.shields.io/github/actions/workflow/status/iterative/shtab/test.yml?logo=github\u0026label=tests\n   :target: https://github.com/iterative/shtab/actions\n   :alt: Tests\n.. |Coverage| image:: https://codecov.io/gh/iterative/shtab/branch/main/graph/badge.svg\n   :target: https://codecov.io/gh/iterative/shtab\n   :alt: Coverage\n.. |Conda| image:: https://img.shields.io/conda/v/conda-forge/shtab.svg?label=conda\u0026logo=conda-forge\n   :target: https://anaconda.org/conda-forge/shtab\n   :alt: conda-forge\n.. |PyPI| image:: https://img.shields.io/pypi/v/shtab.svg?label=pip\u0026logo=PyPI\u0026logoColor=white\n   :target: https://pypi.org/project/shtab\n   :alt: PyPI\n.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/shtab.svg?label=pypi%20downloads\u0026logo=PyPI\u0026logoColor=white\n   :target: https://pepy.tech/project/shtab\n   :alt: Downloads\n.. |Hits| image:: https://cgi.cdcl.ml/hits?q=shtab\u0026style=social\u0026r=https://github.com/iterative/shtab\u0026a=hidden\n   :target: https://cgi.cdcl.ml/hits?q=shtab\u0026a=plot\u0026r=https://github.com/iterative/shtab\u0026style=social\n   :alt: Hits\n","funding_links":[],"categories":["Other Resources","Python","cli"],"sub_categories":["ZSH Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterative%2Fshtab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiterative%2Fshtab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterative%2Fshtab/lists"}