totalhelp
An implementation of the totalhelp PEP.
This module provides monolithic help output for Python argparse applications, including those with deeply nested subcommands.
Usage
Works best with python tools that use Argparse.
totalhelp llm
totalhelp pipx
Caveats
- Help text is not a standard parsable format, so discovery of command names may fail.
- Can surface problems with applications that have slow startup.
Features
- Monolithic Help: Generate a single help document for your entire CLI, including all subcommands.
- Multiple Formats: Output to plain text, Markdown, or self-contained HTML.
- Drop-in Integration: Add a --totalhelp flag to your existing ArgumentParser with a single function call. No subclassing required.
- Optional rich support: If totalhelp[rich] is installed, get beautifully formatted terminal output.
- External Tool Inspection: A best-effort mode to generate help for third-party CLIs you don't control.
- InstallationInstall the base package:
pip install .
To include optional rich formatting support:pip install .[rich]
Quick Start
Integrate it into your application in three steps.
- Build your parser as usual.
# my_cli.py
import argparse
def create_parser():
parser = argparse.ArgumentParser(description="A complex tool.")
subparsers = parser.add_subparsers(dest="command", title="Available Commands")
# Command 'remote'
remote_parser = subparsers.add_parser("remote", help="Manage remotes")
remote_subparsers = remote_parser.add_subparsers(dest="remote_command")
remote_add_parser = remote_subparsers.add_parser("add", help="Add a remote")
remote_add_parser.add_argument("name", help="Name of the remote")
remote_add_parser.add_argument("url", help="URL of the remote")
# Command 'log'
log_parser = subparsers.add_parser("log", help="Show commit logs")
log_parser.add_argument("--oneline", action="store_true", help="Show logs in a compact format")
return parser
- Add the --totalhelp flag.
# my_cli.py (continued)
import sys
import totalhelp
parser = create_parser()
# Add the flag. That's it.
totalhelp.add_totalhelp_flag(parser)
- Check for the flag after parsing arguments.
# my_cli.py (continued)
if __name__ == "__main__":
args = parser.parse_args()
# If --totalhelp was passed, generate and print the doc, then exit.
if getattr(args, "totalhelp", False):
doc = totalhelp.full_help_from_parser(
parser,
fmt=getattr(args, "format", "text")
)
totalhelp.print_output(
doc,
fmt=getattr(args, "format", "text"),
open_browser=getattr(args, "open", False)
)
sys.exit(0)
# --- Your normal CLI logic goes here ---
print(f"Normal execution with args: {args}")
Now you can run your app to see the monolithic help:
Get full help in the terminal
python my_cli.py --totalhelp
Generate a Markdown document
python my_cli.py --totalhelp --format md > DOCS.md
Generate and open an HTML file in your browser
python my_cli.py --totalhelp --format html --open
Metadata
Release files for totalhelp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| totalhelp-0.1.1.tar.gz | 16.0 kB | With provenance | Details for totalhelp-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| totalhelp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for totalhelp-0.1.1-py3-none-any.whl |
Total release size: 33.2 kB
Release files / totalhelp-0.1.1.tar.gz
| Download URL | totalhelp-0.1.1.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de0962427d1184d9ee930ee2da8145a78361a3f709c2adb6664ada7970be05ec
|
|
BLAKE2b-256 checksum How to use checksums |
825bc708580abcc1fb33f121fa2bf8037d83092b0fa186d0450ad296f437528a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2025.
Transparency logRelease files / totalhelp-0.1.1-py3-none-any.whl
| Download URL | totalhelp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11e58377d5f7787d891aa2955146a74d30e7d40a3693e8dc8d2faab0b8da70a2
|
|
BLAKE2b-256 checksum How to use checksums |
fe614f00f9e035041b6a66fec4f07b6e3c03e65472a37bf77dfd0d35957041c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2025.
Transparency logSecurity for totalhelp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for totalhelp-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.