django-typer

raw JSON →
3.7.2 verified Fri May 01 auth: no python

Use Typer to define the CLI for your Django management commands. Supports the full Typer interface including subcommands, arguments, options, and rich output. Current version 3.7.2, requires Python 3.10+, actively maintained with frequent releases.

pip install django-typer
error AttributeError: module 'django_typer' has no attribute 'TyperCommand'
cause Incorrect import path or old django-typer version (<2.0).
fix
Install latest: pip install --upgrade django-typer; import from django_typer (not django_typer.management).
error django.core.management.base.SystemCheckError: SystemCheckError: ...
cause Command class inherits from BaseCommand instead of TyperCommand.
fix
Change to: from django_typer import TyperCommand; class Command(TyperCommand): ...
breaking django-typer drops support for Python versions below 3.10 starting from v3.0.
fix Upgrade to Python 3.10 or higher.
gotcha Commands must use TyperCommand, not BaseCommand. Mixing them may cause unexpected behavior.
fix Always subclass TyperCommand in management commands.
gotcha django-typer uses typer internally; ensure the typer version is compatible. Versions before 3.6.0 used typer-slim.
fix Update to django-typer >=3.6.0 and install typer (not typer-slim).

Define a management command by subclassing TyperCommand instead of BaseCommand.

from django_typer import TyperCommand
import typer

class Command(TyperCommand):
    def handle(self):
        typer.echo("Hello from django-typer!")