Skip to content

ClickCommandLike

Base classes

Name Children Inherits
Protocol
typing
Base class for protocol classes.

⋔ Inheritance diagram

graph TD
  3957186725["cli_types.ClickCommandLike"]
  1073422405["typing.Protocol"]
  3481597255["typing.Generic"]
  2751680898["builtins.object"]
  1073422405 --> 3957186725
  3481597255 --> 1073422405
  2751680898 --> 3481597255

🛈 DocStrings

Bases: Protocol

Protocol for Click-like command objects.

Source code in src/toprompt/cli_types.py
@runtime_checkable
class ClickCommandLike(Protocol):
    """Protocol for Click-like command objects."""

    name: str  # Click commands always have a name
    commands: dict[str, Any]  # Groups have subcommands
    params: list[Any]  # Click commands have params
    help: str | None  # Click commands can have help text

:fa-brands-github: Show source on GitHub