Skip to content

Show Help for Missing Subcommand

Overview

If no subcommand has been provided => Show the help of the command.

(instead of raising an error)

Example

@app.callback(invoke_without_command=True)
def callback(ctx: typer.Context),
) -> None:
    if ctx.invoked_subcommand is None:
        Console().print(ctx.get_help())

More Info