(sphinx-autodoc-argparse-how-to)=

# How to

Use this extension when a project needs rendered `argparse` programs,
options, choices, and role links from the same parser object that powers
its CLI.

## Find registered directives and roles

The {doc}`reference` page lists the directive classes, options, and CLI role
callables registered by the extension.

## Downstream usage snippets

Use native MyST directives in Markdown:

````myst
```{argparse}
:module: myproject.cli
:func: create_parser
:prog: myproject
```
````

Or reStructuredText:

```rst
.. argparse::
   :module: myproject.cli
   :func: create_parser
   :prog: myproject
```

```{package-reference} sphinx-autodoc-argparse
```
