Overview

Typer 0.9, released on May 2, 2023, is a feature release consolidating the CLI creation API.

Main Features

CLI improvements

Improved subcommand handling, better auto-completion, and Click compatibility fixes.

python
import typer

app = typer.Typer()

@app.command()
def greet(name: str, formal: bool = False):
    if formal:
        print(f'Hello, {name}.')
    else:
        print(f'Hi {name}!')

if __name__ == '__main__':
    app()

Sources