Skip to content

rich_click.rich_group

Classes

NameDescription
RichGroupA click Group that prints its help and errors with Rich. The group decorator creates one.

RichGroupclass#

class RichGroup(panels: list[RichPanel[Any, Any]] | None = None, aliases: Iterable[str] | None = None, name: str | None = None, commands: MutableMapping[str, click.Command] | Sequence[click.Command] | None = None, invoke_without_command: bool = False, no_args_is_help: bool | None = None, subcommand_metavar: str | None = None, chain: bool = False, result_callback: Callable[..., Any] | None = None, context_settings: MutableMapping[str, Any] | None = None, callback: Callable[..., Any] | None = None, params: list[click.Parameter] | None = None, help: str | None = None, epilog: str | None = None, short_help: str | None = None, options_metavar: str | None = '[OPTIONS]', add_help_option: bool = True, hidden: bool = False, deprecated: bool | str = False)

Bases: RichGroupMixin, RichCommand, Group

A click Group that prints its help and errors with Rich. The group decorator creates one.

command_classattributeclass attributeinstance attribute#

command_class: type[RichCommand] | None = RichCommand

group_classattributeclass attributeinstance attribute#

group_class: type[Group] | type[type] | None = type

add_commandmethod#

def add_command(cmd: click.Command, name: str | None = None, aliases: Iterable[str] | None = None, panel: str | list[str] | None = None) -> None

format_commandsmethod#

def format_commands(ctx: click.Context, formatter: click.HelpFormatter) -> None

format_helpmethod#

def format_help(ctx: RichContext, formatter: RichHelpFormatter) -> None

get_commandmethod#

def get_command(ctx: click.Context, cmd_name: str) -> click.Command | None
Inherited from rich_click.rich_command.RichGroupMixin

add_command_to_panelmethod#

def add_command_to_panel(command: click.Command, panel_name: str | Iterable[str]) -> None

commandmethod#

def command(*args: Any, **kwargs: Any) -> Any

Create a command and add it to this group.

Takes the same arguments as the command decorator, and works with or without parentheses. The class of the command is command_class, unless you set cls.

groupmethod#

def group(*args: Any, **kwargs: Any) -> Any

Create a subgroup and add it to this group.

Takes the same arguments as the group decorator, and works with or without parentheses. The subgroup has the same class as this group, unless you set group_class or cls.

Inherited from rich_click.rich_command.RichCommand

aliasesattributeinstance attribute#

aliases: Iterable[str]

context_classattributeclass attributeinstance attribute#

context_class: type[RichContext] = RichContext

panelattributeinstance attribute#

panel: str | None

panelsattributeinstance attribute#

panels: list[RichPanel[Any, Any]]

add_panelmethod#

def add_panel(panel: RichPanel[Any, Any]) -> None

format_epilogmethod#

def format_epilog(ctx: RichContext, formatter: RichHelpFormatter) -> None

format_help_textmethod#

def format_help_text(ctx: RichContext, formatter: RichHelpFormatter) -> None

format_optionsmethod#

def format_options(ctx: click.Context, formatter: click.HelpFormatter) -> None

get_help_optionmethod#

def get_help_option(ctx: click.Context) -> click.Option | None

get_rich_table_rowmethod#

def get_rich_table_row(ctx: RichContext, formatter: RichHelpFormatter, panel: RichCommandPanel | None = None) -> RichPanelRow

mainmethod#

def main(args: Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: Any) -> Any

to_info_dictmethod#

def to_info_dict(ctx: click.Context) -> dict[str, Any]