Skip to main content

callback

Run Typer scripts with completion, without having to create a package.

You probably want to install completion for the typer command:

$ typer --install-completion

https://typer.tiangolo.com/

def callback(
ctx: typer.Context,
path_or_module: str = None,
app: str = None,
func: str = None,
version: bool = False
) - > None

Run Typer scripts with completion, without having to create a package.

Parameters

NameTypeDescription
ctxtyper.ContextThe Typer context object used to manage state and command execution flow.
path_or_modulestr = NoneThe file system path or Python module name containing the Typer application to be executed.
appstr = NoneThe specific Typer application object or variable name within the module to be used.
funcstr = NoneThe specific function name to be converted into a Typer command.
versionbool = FalseA flag that, when set to True, triggers the print_version callback to display the current version and exit.

Returns

TypeDescription
NoneNothing is returned; the function updates the internal context state and prepares the CLI for execution.