pgml_cmd
Decorator to create a Typer command from a function.
This decorator creates a Typer command from a given function. It expects at least one parameter that is a Pydantic model. This model is used to parse command-line arguments.
Other parameters are passed to the function as-is.
Parameters:
-
app
(Typer
) –The Typer app to add the command to.
-
name
(Optional[str]
, default:None
) –The name of the command.
-
cls
(Optional[type[TyperCommand]]
, default:None
) –The Typer command class to use.
-
context_settings
(Optional[Dict[Any, Any]]
, default:None
) –Context settings for the command.
-
help
(Optional[str]
, default:None
) –The help text for the command.
-
epilog
(Optional[str]
, default:None
) –The epilog text for the command.
-
short_help
(Optional[str]
, default:None
) –The short help text for the command.
-
options_metavar
(str
, default:'[OPTIONS]'
) –The metavar for the options.
-
add_help_option
(bool
, default:True
) –Whether to add a help option to the command.
-
no_args_is_help
(bool
, default:False
) –When no arguments are provided, whether to show help.
-
hidden
(bool
, default:False
) –Whether to hide the command from help messages.
-
deprecated
(bool
, default:False
) –Whether to mark the command as deprecated.
-
rich_help_panel
(Union[str, None]
, default:Default(None)
) –The rich help panel for the command.