Skip to main content

get_command

Converts a Typer instance into a click.Command or click.Group object, optionally attaching shell completion parameters. It determines whether to return a single command or a group based on the registered callbacks and commands within the provided instance.

def get_command(
typer_instance: Typer
) - > click.Command

Converts a Typer instance into a Click Command or Group object to enable execution or further integration with Click-based tools. This function determines whether to generate a single command or a multi-command group based on the registered callbacks and commands within the Typer instance.

Parameters

NameTypeDescription
typer_instanceTyperThe Typer application instance to be converted into a Click-compatible command structure.

Returns

TypeDescription
click.CommandA Click Command or Group object representing the CLI structure defined in the Typer instance.