# Help Rendering URL: /docs/usage/help/ Section: usage Tags: help, argparse, cli -------------------------------------------------------------------------------- Milo provides HelpRenderer, a drop-in argparse.HelpFormatter subclass that renders help output through Kida templates for styled terminal output. Usage import argparse from milo import HelpRenderer parser = argparse.ArgumentParser( prog="myapp", description="My CLI tool", formatter_class=HelpRenderer, ) parser.add_argument("--verbose", help="Enable verbose output") parser.add_argument("command", help="Command to run") parser.parse_args() When the user runs myapp --help, the output is rendered through the help.kida Kida template instead of argparse's default plain-text formatter. Customization Override the built-in help.kida template by placing your own in your template directory. The template receives the full argparse structure as context. Code Template context variables The help.kida template receives: Variable Type Description prog str Program name description str Parser description usage str Usage string positionals list Positional argument specs optionals list Optional argument specs subcommands list Subparser commands Fallback Note Note If template rendering fails for any reason, HelpRenderer falls back to the default argparse formatting silently. Your CLI will always show help — it just won't be styled. -------------------------------------------------------------------------------- Metadata: - Author: lbliii - Word Count: 155 - Reading Time: 1 minutes