# help

URL: /milo-cli/api/milo/help/
Section: milo
Description: HelpRenderer — argparse formatter_class for styled help output.

---

> For a complete page index, fetch /milo-cli/llms.txt.

Open LLM text
(/milo-cli/api/milo/help/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fhelp%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fhelp%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fhelp%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fmilo-cli%2Fapi%2Fmilo%2Fhelp%2Findex.txt)

Module

#
`help`

HelpRenderer — argparse formatter_class for styled help output.

3Classes1Function

## Classes

`_NoTemplateContentError`

0

▼

Raised when formatter has no captured groups for template rendering.

Raised when formatter has no captured groups for template rendering.

`HelpState`

8

▼

State for help rendering.

State for help rendering.

#### Attributes

Name
Type
Description

`prog`

`str`

—

`description`

`str`

—

`epilog`

`str`

—

`usage`

`str`

—

`groups`

`tuple[dict[str, Any], ...]`

—

`examples`

`tuple[dict[str, Any], ...]`

—

`commands`

`tuple[dict[str, Any], ...]`

—

`options`

`tuple[dict[str, Any], ...]`

—

`HelpRenderer`

7

▼

Argparse formatter that renders through kida templates.

Usage::

parser = argparse.ArgumentPar…

Argparse formatter that renders through kida templates.

Usage::

```
parser = argparse.ArgumentParser(
    formatter_class=HelpRenderer,
)
```

#### Methods

`add_text`

1

▼

Capture description text before passing to base.

`def add_text(self, text: str | None) -> None`

##### Parameters

Name
Type
Description

`text`
`—`

`start_section`

1

▼

Track the current section heading.

`def start_section(self, heading: str | None) -> None`

##### Parameters

Name
Type
Description

`heading`
`—`

`add_arguments`

1

▼

Capture actions for the current section.

`def add_arguments(self, actions: Any) -> None`

##### Parameters

Name
Type
Description

`actions`
`—`

`end_section`

0

▼

Finalize the current section and store its actions.

`def end_section(self) -> None`

`format_help`

0

`str`

▼

Format help using kida template if available, else fall back to default.

`def format_help(self) -> str`

##### Returns

`str`

Internal Methods
2

▼

`__init__`

4

▼

`def __init__(self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None) -> None`

##### Parameters

Name
Type
Description

`prog`
`—`

`indent_increment`
`—`

Default:`2`

`max_help_position`
`—`

Default:`24`

`width`
`—`

Default:`None`

`_render_with_template`

0

`str`

▼

Render help through the kida help template.

Argparse reuses formatter_class fo…

`def _render_with_template(self) -> str`

Render help through the kida help template.

Argparse reuses formatter_class for non-help output (--version,
add_subparsers prog extraction). In those cases no action groups
are captured, so we fall back to the default argparse formatter.

##### Returns

`str`

## Functions

`help_formatter_with_examples`

1

`type[HelpRenderer]`

▼

Create a HelpRenderer subclass that includes command examples.

`def help_formatter_with_examples(examples: tuple[dict[str, Any], ...]) -> type[HelpRenderer]`

##### Parameters

Name
Type
Description

`examples`
`tuple[dict[str, Any], ...]`

##### Returns

`type[HelpRenderer]`
