Repolode
fastapi

fastapi/typer

Python library for building CLI applications from standard type hints, with automatic help, validation and shell completion.

Stars
20,155
Forks
1,007
Open issues
49
Last commit
6 days ago

What is it?

Typer is a Python library for building command line interface applications. You declare a function's parameters with standard type hints, and Typer turns them into CLI arguments and options, handling parsing, type conversion and error messages.

Applications get automatic --help output and shell auto-completion for Bash, Zsh, Fish and PowerShell. Commands can be organized into arbitrarily nested trees of subcommands and groups. Typer also ships a typer command that can run an existing Python script as a CLI without modifying it.

Typer is designed by the FastAPI author and follows the same type-hint-driven style. It depends on rich for formatted output and shellingham for shell detection, and it bundles its own copy of Click internally since version 0.26.0.

Key features

  • 01Builds CLI arguments and options from Python type hints.
  • 02Generates --help output and shows formatted errors automatically.
  • 03Provides shell auto-completion for Bash, Zsh, Fish and PowerShell.
  • 04Supports nested subcommands and command groups.
  • 05Includes a typer command to run plain Python scripts as CLIs.

Use cases

  • Writing internal developer scripts that need argument parsing and help text.
  • Building a multi-command admin tool with subcommands.
  • Turning an existing Python script into a command line utility without rewriting it.

Quick start

  1. 1

    Install uv (see the installation guide linked in the README)

  2. 2

    Add Typer to your project

    uv add typer
  3. 3

    Run your script with Typer's built-in CLI runner

    typer main.py run Camila

Topics

FAQ

What is typer?
Python library for building CLI applications from standard type hints, with automatic help, validation and shell completion. Typer is a Python library for building command line interface applications. You declare a function's parameters with standard type hints, and Typer turns them into CLI arguments and options, handling parsing, type conversion and error messages.
Is typer free to use? What license does it have?
typer is open source under the MIT license. Check the license terms before using it in commercial products.
Is typer still maintained?
Actively maintained. The last commit to typer was on Oct 15, 2026.
What can I use typer for?
Writing internal developer scripts that need argument parsing and help text. Building a multi-command admin tool with subcommands. Turning an existing Python script into a command line utility without rewriting it.
How do I install typer?
Install uv (see the installation guide linked in the README) Add Typer to your project: uv add typer Run your script with Typer's built-in CLI runner: typer main.py run Camila
Where can I get typer?
The source code and installation instructions are on GitHub: https://github.com/fastapi/typer

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects