skillfed

django-typer

Use Typer to define the CLI for your Django management commands.

django-typer v3.8.0 235.3K downloads/30d#9,005 on PyPI50
Permissive license MIT Active released

What it is and what it does

django-typer bridges Typer's modern, type-hint-driven CLI framework with Django's management command system. Instead of writing argparse boilerplate, you define command parameters as typed function arguments and let Typer handle parsing, validation, and help generation. The package provides TyperCommand, a drop-in replacement for Django's BaseCommand that inherits all standard Django command features while adding Typer's capabilities—or you can use Typer's own decorator-based interface directly.

You get automatic CLI validation through type hints, hierarchical command groups with shared initializers, beautiful help output, and optional shell tab-completion for bash, zsh, fish, and powershell. The package is actively maintained, supports current Python and Django versions, and carries no known vulnerabilities. It's particularly useful when you want to avoid writing repetitive argparse code or when you need complex command hierarchies with validation.

Use it for:

  • Build a Django management command with typed parameters and automatic validation instead of manual argparse setup.
  • Create hierarchical command groups (e.g., `manage.py admin users create --name=...`) with shared initialization logic.
  • Add shell tab-completion to your custom Django commands without writing completion handlers by hand.
  • Port an existing Django management command to use type hints while keeping the same class-based interface.
  • Define multiple subcommands in a single command class with clear, DRY parameter definitions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Builds type-safe Django management command CLIs using Typer's static typing and parameter validation, with support for subcommands, command groups, and shell tab-completion.

Yes. django-typer is actively maintained, carries no known vulnerabilities, has low install friction, and solves a real pain point—replacing Django's argparse boilerplate with modern type-safe CLI definitions. It's production-stable (Development Status 5), works with current Django and Python versions, and is permissively licensed. Install it if you're building or maintaining Django management commands.

Install

django-typer on PyPI

pip

pip install django-typer

uv

uv add django-typer

poetry

poetry add django-typer

Installing django-typer

Before you install

Low friction: pure Python wheel with three straightforward runtime dependencies (click, django, typer). Active maintenance with a release 6 days ago. Supports Python 3.10 through 3.15 and Django 5.2, 6.0, 6.1.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install django-typer

from django_typer.management import TyperCommand

class Command(TyperCommand):
    def handle(self, name: str, count: int = 1):
        """A basic command."""
        for _ in range(count):
            print(f"Hello {name}")

Requires Django to be installed and configured; command must be placed in a Django app's management/commands/ directory.

Verify before relying

  • Whether rich traceback rendering is installed automatically or requires explicit configuration beyond adding django_typer to INSTALLED_APPS.
  • Performance characteristics when handling large numbers of subcommands or deeply nested command hierarchies.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 3 — click, django, typer
Maintenance actively maintained — 6 days since the last release
Last repo commit
First released
Downloads 235,282/month — #9,005 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_typer-3.8.0-py3-none-any.whl

Keywords: CLI, Typer, commands, django, management

Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: DjangoFramework :: Django :: 5.2Framework :: Django :: 6.0Framework :: Django :: 6.1Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Site ManagementTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

django management commands typertype-safe cli djangodjango subcommandstyper django integrationdjango cli with type hintscommand groups djangoshell completion django commands
django-clitype-hintscommand-framework

More Libraries packages