--- id: sphinx-argparse version: "0.6.0" license: MIT license_treatment: permissive maintenance: active --- # sphinx-argparse — A sphinx extension that automatically documents argparse commands and options License: permissive · Maintenance: active · Downloads: 4.3M/mo ## What it is and what it does sphinx-argparse is a Sphinx extension that bridges the gap between argparse-based command-line tools and their documentation. Instead of manually writing out every argument, option, and subcommand in your docs, you point the extension at your argparse parser object and it automatically generates formatted documentation from the parser's structure. It integrates directly into the Sphinx build process via a custom directive. The extension depends on sphinx and docutils to render the generated documentation into your final HTML, PDF, or other Sphinx output formats. It's maintained as part of the official Sphinx documentation tooling ecosystem and supports modern Python versions (3.10 through 3.13, including PyPy). Use it for: - Auto-generate CLI reference documentation from an existing argparse parser without duplicating argument descriptions. - Keep command-line help text and Sphinx docs in sync by sourcing both from the same parser definition. - Document complex CLI tools with subcommands and nested argument groups in a structured, searchable format. - Build API documentation sites that include both Python API and CLI interface reference in one place. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Sphinx extension that automatically generates documentation for argparse command-line interfaces by introspecting their argument definitions. Yes. Low install friction, active maintenance, no known vulnerabilities, permissive MIT license, and a focused purpose that solves a real documentation problem for CLI tools. Install if you use argparse and Sphinx together; skip if you don't use Sphinx or prefer manual CLI documentation. ## Install pip install sphinx-argparse uv add sphinx-argparse poetry add sphinx-argparse ## Installing sphinx-argparse Before you install: Low friction install with only sphinx and docutils as runtime dependencies. Active maintenance with recent release (44 days ago) and continuous repository activity. License in practice: MIT license permits unrestricted use, modification, and distribution in both open and closed projects. Quickstart: pip install sphinx-argparse In conf.py: extensions = ['sphinx_argparse.ext'] In your .rst file: .. argparse:: :module: mymodule :func: create_parser Requires Python 3.10 or later; your project must use Sphinx and have argparse-based CLI code to document. Verify before relying: - Whether the extension handles complex argparse patterns (subparsers, custom actions, mutually exclusive groups) beyond basic commands. - Performance characteristics when documenting very large or deeply nested argument hierarchies. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 4.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags sphinx argparse documentation, auto-document cli arguments, argparse sphinx extension, command line help documentation, generate cli docs from argparse, sphinx-extension, cli-documentation, argparse [View on SkillFed](https://skillfed.io/packages/sphinx-argparse) · [View on PyPI](https://pypi.org/project/sphinx-argparse/)