## Autogenerate Completions for CLI tools built with `argparse`
This package generates [Fig
completions](https://github.com/withfig/autocomplete) for CLI tools built
with Python's built-in [argparse](https://docs.python.org/3/library/argparse.html) module.
### Installation
Install the integration as a dependency using pip:
```bash
pip install argparse-complete-fig
```
### Usage
```python
import argparse
from argparse_complete_fig import add_completion_spec_command
parser = argparse.ArgumentParser(prog='my-cli')
# Call on your root-level parser for full completions
add_completion_spec_command(parser)
```
Calling the `add_completion_spec_command` function will add
a `--generate-fig-spec` argument to the parser. When your CLI is invoked
with this flag it will print a Fig spec.
To save your completion spec skeleton to a file, run the following:
```bash
my-cli --generate-fig-spec > my-cli.ts
```
Raw data
{
"_id": null,
"home_page": "",
"name": "argparse-complete-fig",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "Sean Sullivan <sean@fig.io>",
"keywords": "argparse,fig,cli,completions,terminal,framework",
"author": "",
"author_email": "Fig Team <hello@fig.io>",
"download_url": "https://files.pythonhosted.org/packages/bb/f2/c331e8a7cc02101f0feb5944926cf112926083bc24ebb72f5c14da4b15ba/argparse_complete_fig-1.0.1.tar.gz",
"platform": null,
"description": "## Autogenerate Completions for CLI tools built with `argparse`\n\nThis package generates [Fig\ncompletions](https://github.com/withfig/autocomplete) for CLI tools built\nwith Python's built-in [argparse](https://docs.python.org/3/library/argparse.html) module.\n\n### Installation\n\nInstall the integration as a dependency using pip:\n\n```bash\npip install argparse-complete-fig\n```\n\n### Usage\n\n```python\nimport argparse\nfrom argparse_complete_fig import add_completion_spec_command\n\nparser = argparse.ArgumentParser(prog='my-cli')\n\n# Call on your root-level parser for full completions\nadd_completion_spec_command(parser)\n```\n\nCalling the `add_completion_spec_command` function will add\na `--generate-fig-spec` argument to the parser. When your CLI is invoked\nwith this flag it will print a Fig spec.\n\n\nTo save your completion spec skeleton to a file, run the following:\n\n```bash\nmy-cli --generate-fig-spec > my-cli.ts\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Autogenerate completions for CLI tools built with argparse",
"version": "1.0.1",
"split_keywords": [
"argparse",
"fig",
"cli",
"completions",
"terminal",
"framework"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1c573a3517a7e52257094d473848a89324cc16e400a532c2bb9bc55250e28777",
"md5": "fd028dbe2a4e4941d72dd7ff70fd2883",
"sha256": "13d9bcd03c9794828bee7eddc2dc0e627d8ef20400c92aaffda604b3449cd33c"
},
"downloads": -1,
"filename": "argparse_complete_fig-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fd028dbe2a4e4941d72dd7ff70fd2883",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 4865,
"upload_time": "2023-04-15T15:03:09",
"upload_time_iso_8601": "2023-04-15T15:03:09.807509Z",
"url": "https://files.pythonhosted.org/packages/1c/57/3a3517a7e52257094d473848a89324cc16e400a532c2bb9bc55250e28777/argparse_complete_fig-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bbf2c331e8a7cc02101f0feb5944926cf112926083bc24ebb72f5c14da4b15ba",
"md5": "e88441c27292641fc08a555306cb0b0f",
"sha256": "2e0b196b54167bab9ba8e9af6ca292db52381ab5ba427e5d39ba0978bb625e36"
},
"downloads": -1,
"filename": "argparse_complete_fig-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "e88441c27292641fc08a555306cb0b0f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 5210,
"upload_time": "2023-04-15T15:03:11",
"upload_time_iso_8601": "2023-04-15T15:03:11.224217Z",
"url": "https://files.pythonhosted.org/packages/bb/f2/c331e8a7cc02101f0feb5944926cf112926083bc24ebb72f5c14da4b15ba/argparse_complete_fig-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-15 15:03:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "argparse-complete-fig"
}