Skip to content

Help

--help is colored by default when Rich is installed and stdout is a TTY. Opt out with Meta.help_formatter = RecursiveHelpFormatter. RichHelpMixin is optional (re-opt-in after a parent opt-out). Full walkthrough: Colored help.

from clak import Parser

class App(Parser):
    class Meta:
        help_description = "Hello [bold]World[/bold]"
        help_epilog = "See the docs."

    def cli_run(self, **_):
        return None

No CLI flags. Color follows TTY stdout, NO_COLOR, CLAK_COLORS, and CLAK_COLOR_BACKEND. Install Rich with pip install 'mrjk.clak[markdown]'.

clak.comp.help

Optional help mixins: Rich-colored --help, split short/long help.

RichHelpMixin

Same default as Parser (Rich help formatter).

Optional. Useful to re-opt-in a child after a parent sets Meta.help_color = False (or the legacy Meta.help_formatter = RecursiveHelpFormatter).

RichRecursiveHelpFormatter

Bases: RecursiveHelpFormatter

Value for Meta.help_formatter selecting Rich-colored help (default).