2025, Dec 19 23:00

Typer CLI crashes with TyperArgument.make_metavar TypeError? Upgrade Typer to 0.16.0 or newer

Getting TyperArgument.make_metavar TypeError in a Typer CLI on Python 3.13? Pin or upgrade Typer to 0.16.0+ to fix Click incompatibility and restore output.

Running a minimal Typer CLI on recent Python can unexpectedly crash with a TypeError referencing TyperArgument.make_metavar. If your setup uses Typer 0.15.3, this is likely what you are seeing instead of the expected help output.

Reproducing the issue

The following minimal configuration and script are enough to trigger the error.

[project]
name = 'typer-example'
version = '0.1.0'
description = 'Add your description here'
readme = 'README.md'
requires-python = '>=3.13'
dependencies = [
    'typer>=0.15.3',
]
import typer as ty
def cli_handler(user: str):
    print(f'Hello, {user}!')
ty.run(cli_handler)
uv run python main.py
TypeError: TyperArgument.make_metavar() takes 1 positional argument but 2 were given

What is actually going on

The error stems from an incompatibility between Typer and Click that was described in a community report and later addressed by the Typer maintainers. The incompatibility has been fixed in the Typer v0.16.0 release.

The fix

The recommended approach is straightforward: upgrade or pin Typer to version 0.16.0 or newer. After that, the minimal CLI no longer raises the TypeError.

[project]
name = 'typer-example'
version = '0.1.0'
description = 'Add your description here'
readme = 'README.md'
requires-python = '>=3.13'
dependencies = [
    'typer>=0.16.0',
]

The application code itself does not require changes; the same minimal script works as intended when Typer is upgraded.

import typer as ty
def cli_handler(user: str):
    print(f'Hello, {user}!')
ty.run(cli_handler)

Why this matters

For CLI tools built on Typer and Click, compatibility between library versions directly affects runtime behavior. A minor mismatch can surface as a runtime TypeError in even the simplest program. Keeping Typer at 0.16.0 or later avoids this specific pitfall.

Conclusion

If you encounter the TyperArgument.make_metavar TypeError in a basic Typer CLI, upgrade or pin Typer to 0.16.0 or newer. This resolves the incompatibility and restores the expected behavior without changing your application code.