Change Log¶
v4.1.0 (2026-09-05)¶
Support Typer 0.27+
Help output follows Typer 0.27’s metavar rendering (e.g.
<str>instead ofTEXTand{arg}instead ofARGin usage lines)Model field parser metavars are lowercase to match Typer’s (e.g.
<int>,<txt>)
v4.0.0 (2026-09-05)¶
Support Typer 0.26.8+
Added
atomicto run a command’s whole invocation - initializer, chained subcommands and finalizer - in a database transaction. Implements Add a command option that will wrap execute() in a transaction. See Wrap a Command in a Transaction.Fixed chain mode being switched off when a chained command defines an initializer
Implemented ModelObjectParser should have a setting that returns the lookup value if no row was found. - see the
return_lookup_on_missparameter. The return value ofon_errorhandlers is now documented as the parsed value.The click command tree Typer builds for a command is now cached per app and only rebuilt when commands, groups, callbacks or finalizers are registered, instead of being rebuilt several times on every invocation
Fixed typer.Exit is swallowed on the execute() path: exit code returned as output and process exits 0
Drop dependency on Click (vendored by Typer). The Click types needed to write completers and parsers are re-exported from
django_typer.completers(Context,Parameter,CompletionItem) anddjango_typer.parsers(Context,Parameter,ParamType)Drop support for Python 3.10
Added a settings reference.
DT_MANAGE_SCRIPTandDT_PRINT_RESULTmay also be given as environment variables of the same name.BREAKING: Values returned from commands are no longer written to stdout by default. Set
print_result = Trueon a command, orDT_PRINT_RESULT = Truein settings, to restore the previous behavior.Fixed result printing being applied to the wrong stream: with
print_resultoff the returned value was still written whenstdout=was passed tocall_command(), and a command instance reused after a run dropped its own output.Passing a
prompt_required=Falseoption flag without a value no longer triggers the prompt - Typer’s vendored Click dropped support for this. Omit the flag to be prompted or pass the value explicitly.Documented installing shell completion for a just manage script and other wrapped invocations, see Completions for Wrapped Invocations. Multi-word manage scripts remain unsupported (#191).
Fixed get_usage_script resolves full path when command is resolvable on path and added the
DT_MANAGE_SCRIPTsetting to override the detected program name.
Migrating from 3.x to 4.x¶
Python 3.10 is no longer supported, 4.x requires Python 3.11 or later.
Typer 0.26.8 or later is required and Click is no longer a dependency of django-typer. Typer now vendors Click, so the
clickpackage may not be installed in your environment and even when it is, its classes are not the ones Typer uses. If your commands import fromclick:Import the types used to write completers from
django_typer.completers:# 3.x from click import Context, Parameter from click.shell_completion import CompletionItem # 4.x from django_typer.completers import CompletionItem, Context, Parameter
Import the types used to write parsers from
django_typer.parsers:# 3.x from click import Context, Parameter, ParamType # 4.x from django_typer.parsers import Context, Parameter, ParamType
Use
typer.Exit,typer.Abortandtyper.BadParameterin place of theirclickcounterparts. RaisingCommandErrorremains the recommended way to report errors from a command.Replace calls to
click.get_current_context()with a parameter annotated asContexton the command, group or callback that needs it, Typer will pass the active context in.get_current_command()continues to provide the running command instance.isinstancechecks againstclickclasses will no longer match.The
click_typeparameter totyper.Optionandtyper.Argumentwas removed upstream, pass the type toparserinstead. Parsers already passed throughparserare unaffected: plain callables andParamTypesubclasses, including ones derived from a separately installed Click, continue to work.
Options declared with
prompt=True, prompt_required=Falseno longer prompt when the flag is passed without a value, doing so is now a usage error. Omit the flag to be prompted or pass the value explicitly.If you document your commands with the
typerdirective from sphinxcontrib-typer, upgrade it to 0.10 or later. Earlier releases drive the real Click package and fail against Typer 0.26+.The program name shown in the
Usage:line of command help (and used when installing shell completions) is now the bare command name whenever that name resolves on the path, including when the script was launched through a shim or wrapper of the same name or through a relative path to the same script. Previously the full path was shown in these cases. SetDT_MANAGE_SCRIPTto pin the name if you need a specific value, see Configure the Manage Script Name.typer.Exit,typer.AbortandKeyboardInterruptleaving a command now follow one policy. From the command line the process exits with the status (AbortprintsAborted!and exits 1, an interrupt exits 130) and nothing else is printed. Fromcall_command(), a non-zeroExitand anAbortraiseCommandErrorwithreturncodeset, andExit(0)returnsNone. Command functions called directly from Python are plain calls and whatever they raise propagates unchanged. PreviouslyExitwas returned (and printed) as the command’s output when executed and ended the process when the command object was called directly. See Exit Codes, Errors and Aborts.Return values are no longer printed. In 3.x a truthy value returned from a command was written to stdout, mirroring
BaseCommand. In 4.x nothing is printed unless the command setsprint_result = Trueor the project setsDT_PRINT_RESULT = True- see Toggle on/off result printing. If a command’s return value doubled as its output, set one of those or write the output explicitly.Starting with 4.1 (Typer 0.27+), help output renders type metavars in lowercase angle brackets (
<str>,<int>,<path>) instead ofTEXT,INTEGERandPATH, and usage lines show required arguments as{arg}and optional arguments as[arg]instead ofARG. The provided model field parsers follow suit (<int>,<txt>, …). Update any tests that assert on help text.No changes are required for chained groups (
chain=True), finalizers, the provided completers and parsers, custom shell completer classes registered withregister_completion_class()or the shellcompletion command. These were reimplemented or adapted internally and behave as before.
v3.9.0 (2026-09-02)¶
Support Click 8.5.x
v3.8.0 (2026-08-04)¶
- Fixed Get fish completion tests working
Fish shellcompletion is now better supported.
Drop support for Django 4.2
Support Python 3.15
v3.7.4 (2026-07-31)¶
Support Django 6.1
v3.7.3 (2026-05-23)¶
v3.7.2 (2026-04-26)¶
Support Typer 0.25.x
v3.7.1 (2026-03-31)¶
Update installation instructions to reflect rich no longer being an optional dependency. You can disable rich formatting by setting
TYPER_USE_RICH=False
v3.7.0 (2026-03-19)¶
Results returned from groups are now included in the result sets passed to finalize().
v3.6.6 (2026-03-18)¶
Duraton parser now supports Y, M, and W.
v3.6.5 (2026-03-16)¶
Switch from pre-commit to prek.
Run Bandit in CI.
v3.6.4 (2026-03-02)¶
Add typed classifier/badge.
v3.6.3 (2026-02-25)¶
Add badges to docs.
v3.6.2 (2026-02-16)¶
Support typer 0.24
v3.6.1 (2026-02-14)¶
Remove monkey patch for
TYPER_USE_RICHenvironment variable - this was fixed upstream.Minimum typer is now 0.23.1.
v3.6.0 (2026-02-12)¶
-
typer-slim has been made an alias for typer. This means rich is installed automatically now.
If you want to disable rich:
At runtime: you can set the environment variable
TYPER_USE_RICHto0orfalse.In code (for all invocations): you can set the class variable
rich_markup_modetoNoneon your command class or any parent group. This will disable rich for that command and all subcommands.
You may also run into an error like this:
Traceback (most recent call last): File "/home/user/code/myproject/main.py", line 1, in <module> import typer ModuleNotFoundError: No module named 'typer'
If this happens just reinstall your virtual environment.
v3.5.1 (2026-01-13)¶
Support typer-slim 0.21
Fixed options_metavar interface change causes regression
options_metavarparameters now apply correctly
v3.5.0 (2025-11-21)¶
v3.4.0 (2025-10-20)¶
v3.3.2 (2025-09-27)¶
Early support release for Django 6.0 (tested against 6.0a1)
v3.3.1 (2025-09-22)¶
v3.3.0 (2025-08-31)¶
Documented Add note on startup performance to docs.
Fixed Support typer 0.17
v3.2.2 (2025-07-17)¶
v3.2.1 (2025-07-16)¶
v3.2.0 (2025-05-31)¶
Support Python 3.14
Implemented Support click 8.2
v3.1.1 (2025-04-30)¶
Implemented Support rich 14
v3.1.0 (2025-04-02)¶
Fixed Fish shell completion fails for any script named something other than “manage”
Fixed shellcompletion install fails on fish when the command resolves to a script path
Implemented Add completer for settings names.
Implemented Separate ModelObjectCompleter default queries out into standalone functions.
Fixed fish completion installs should respect XDG_CONFIG_HOME
Implemented Prompt before writing to dotfiles when installing completions
Implemented Support Django 5.2
Implemented Use intersphinx for external document references.
Implemented Add completer for language codes.
Implemented Switch poetry -> uv
Implemented Model object completers should handle fields with choices appropriately
Implemented Require tests to pass before release action runs.
v3.0.0 (2025-02-16)¶
Implemented Completer for media files.
Implemented Completer for static files.
Fixed Completions before the end of the typed command string do not work.
Implemented Add print_return class field to enable/disable result printing
BREAKING Default rich traceback should not show locals - its too much information.
Implemented path completers should be configurable with a root directory other than cwd
Implemented Migrate pyproject.toml to poetry 2 and portable project specifiers.
BREAKING Split parsers.py and completers.py into submodules.
Implemented Model completer/parser should support returning the field value
Fixed Model objects with null lookup fields should not be included in model field completion output
Implemented Add a performance regression.
Implemented Use in-house shell completer classes.
Implemented Add precommit hook to fix safe lint and format issues
BREAKING Remove name parameter from initialize()/callback().
Implemented Run full test suite on mac osx
Implemented Convert check.sh to justfile
Implemented Run full test suite on windows in CI
Implemented ANSI color control sequences should optionally be scrubbed from shell completions
Fixed supressed_base_arguments are still present in the Context
Implemented Add showcase of commands using django-typer to docs
Implemented Add a @finalize decorator for functions to collect/operate on subroutine results.
Fixed Installed shellcompletion scripts do not pass values of –settings or –pythonpath
Implemented Add support for QuerySet parameter types.
Fixed shellcompletion complete should print to the command’s stdout.
Implemented Add translations for helps..
Implemented Add completer/parser for FileField and FilePathField
Implemented Add completer/parser for DurationField
Implemented Add completer/parser for DateTimeField
Implemented Add completer/parser for DateField
Implemented Add completer/parser for TimeField
Implemented Improve shell completion continuous integration tests
Migrating from 2.x to 3.x¶
Imports from the
django_typernamespace have been removed. You should now import fromdjango_typer.management.The name parameter has been removed from
django_typer.management.initialize()anddjango_typer.management.Typer.callback(). This change was forced by upstream changes in Typer that will allowdjango_typer.management.Typer.add_typer()to define commands across multiple files.Rich tracebacks will not include local variables by default. To replicate the old behavior you will need to add this to your settings:
RICH_TRACEBACK_CONFIG={"show_locals": True}
–show-locals and –hide-locals common parameters are added to toggle local variables on and off in the stack trace output.
Shell Completions¶
old |
new |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you are using shell tab completions you will need to reinstall the completion scripts. Using the shellcompletion install command. To be extra safe you may want to uninstall the old scripts before updating, using the v2.x
shellcompletion removecommand.The interface to shellcompletion has changed.
--shellis now an initialization option andremovewas renamed touninstall.:# old interface manage shellcompletion complete --shell zsh "command string" manage shellcompletion remove # new interface manage shellcompletion --shell zsh complete "command string" manage shellcompletion uninstall
The function signature for shellcompletion fallbacks has changed. The fallback signature is now:
import typing as t from click.shell_complete import CompletionItem def fallback(args: t.List[str], incomplete: str) -> t.List[CompletionItem]: ...
v2.6.0 (2024-12-03)¶
v2.5.0 (2024-11-29)¶
v2.4.0 (2024-11-07)¶
Implemented Support Typer 0.13
v2.3.0 (2024-10-13)¶
Fixed Inheritance more than one level deep of TyperCommands does not work.
Implemented Drop python 3.8 support.
Implemented Command help order should respect definition order for class based commands.
Completed Add project to test PyPI
Completed Open up vulnerability reporting and add security policy.
Completed Add example of custom plugin logic to plugins tutorial.
Completed Transfer to django-commons
Completed Add howto for how to change the display order of commands in help.
v2.2.2 (2024-08-25)¶
v2.2.1 (2024-08-17)¶
v2.2.0 (2024-07-26)¶
v2.1.3 (2024-07-15)¶
v2.1.2 (2024-06-07)¶
v2.1.1 (2024-06-06)¶
v2.1.0 (2024-06-05)¶
Warning
Imports from django_typer have been deprecated and will be removed in 3.0! Imports
have moved to django_typer.management:
# old way
from django_typer import TyperCommand, command, group, initialize, Typer
# new way!
from django_typer.management import TyperCommand, command, group, initialize, Typer
v2.0.2 (2024-06-03)¶
v2.0.1 (2024-05-31)¶
v2.0.0 (2024-05-31)¶
This major version release, includes an extensive internal refactor, numerous bug fixes and the addition of a plugin-based extension pattern.
Fixed Stack trace produced when attempted to tab-complete a non-existent management command.
Fixed Overriding handle() in inherited commands results in multiple commands.
Implemented Support subgroup name overloads.
Fixed Helps from class docstrings and TyperCommand class parameters are not inherited.
Implemented Allow callback and initialize to be aliases of each other.
Implemented Shell completion for –pythonpath
Implemented Shell completion for –settings
Fixed An intelligible exception should be thrown when a command is invoked that has no implementation.
Implemented TyperCommand class docstring should be used as the help as a last resort.
Fixed ModelObjectParser should use a metavar appropriate to the field type.
Implemented Switch to ruff for linting and formatting.
Implemented Add a wrapper for typer’s echo/secho
Implemented Support a native typer-like interface.
Fixed @group type hint does not carry over the parameter spec of the wrapped function
Implemented Better test organization.
Implemented Add completer/parser for GenericIPAddressField.
v1.1.2 (2024-04-22)¶
v1.1.1 (2024-04-11)¶
Implemented Fix pyright type checking and add to CI
Implemented Convert CONTRIBUTING.rst to markdown
v1.1.0 (2024-04-03)¶
Implemented Convert readme to markdown.
v1.0.9 (yanked)¶
Fixed Support typer 0.12.0
v1.0.8 (2024-03-26)¶
v1.0.7 (2024-03-17)¶
v1.0.6 (2024-03-14)¶
v1.0.5 (2024-03-14)¶
v1.0.4 (2024-03-13)¶
v1.0.3 (2024-03-08)¶
v1.0.2 (2024-03-05)¶
v1.0.1 (2024-02-29)¶
v1.0.0 (2024-02-26)¶
Initial production/stable release.
v0.6.1b (2024-02-24)¶
Incremental beta release - this is also the second release candidate for version 1.
Peg typer version to 0.9.x
v0.6.0b (2024-02-23)¶
Incremental beta release - this is also the first release candidate for version 1.
v0.5.0b (2024-01-31)¶
Incremental Beta Release
v0.4.0b (2024-01-08)¶
Incremental Beta Release
v0.3.0b (2024-01-06)¶
Incremental Beta Release
v0.2.0b (2024-01-04)¶
Incremental Beta Release
v0.1.0b (2023-12-05)¶
Initial Release (Beta)