Typer: Build Great CLIs with Python Type Hints
Typer is a Python library for building command-line interfaces (CLIs) that are easy to code and based on Python type hints. The current version is 0.24.1, released on March 28, 2026. Typer follows a regular release cadence, with updates approximately every few months.
Warnings
- breaking Dropped support for Python 3.9 in version 0.24.0.
- deprecated Support for 'typer-slim' and 'typer-cli' has been dropped; use only 'typer'.
Install
-
pip install typer
Imports
- Typer
import typer
Quickstart
import typer
app = typer.Typer()
@app.command()
def hello(name: str):
print(f"Hello, {name}!")
if __name__ == "__main__":
app()