This release adds deep integrations with Rich. ✨
rich
is an optional dependency, you can install it directly or it will be included when you install with:
$ pip install "typer[all]"
If Rich is available, it will be used to show the content from --help
options, validation errors, and even errors in your app (exception tracebacks).
There are new options to group commands, CLI arguments, and CLI options, support for Rich Console Markup, and more! 🎉
Features
- ✨ Richify, add integrations with Rich everywhere. PR #419 by @tiangolo.
- Recommend Rich as the main information displaying tool, new docs: Printing and Colors.
- For most use cases not using Rich, use plain
print()
instead oftyper.echo()
in the docs, to simplify the concepts and avoid confusions. New docs: Printing and Colors - typer Echo. - Define help panels for CLI arguments, new docs: CLI Arguments with Help - CLI Argument help panels.
- Define help panels for CLI options, new docs: CLI Options with Help - CLI Options help panels.
- New docs for deprecating commands: Commands - Command Help - Deprecate a Command.
- Support for Rich Markdown in docstrings, CLI parameters
help
, andepilog
with the new parametertyper.Typer(rich_markup_mode="markdown")
, new docs: Commands - Command Help - Rich Markdown and Markup. - Support for Rich Markup (different from Markdown) in docstrings, CLI parameters
help
, andepilog
with the new parametertyper.Typer(rich_markup_mode="rich")
, new docs: Commands - Command Help - Rich Markdown and Markup. - Define help panels for commands, new docs: Commands - Command Help - Help Panels.
- New docs for setting an
epilog
, with support for Rich Markdown and Console Markup, new docs: Commands - Command Help - Epilog.
- ✨ Refactor and document handling pretty exceptions. PR #422 by @tiangolo.
- Add support for customizing pretty short errors, new docs: Exceptions and Errors.
- ✨ Allow configuring pretty errors when creating the Typer instance. PR #416 by @tiangolo.
Docs
- 📝 Add docs for using Rich with Typer. PR #421 by @tiangolo.
- Add new docs: Ask with Prompt - Prompt with Rich.
- Add new docs to handle progress bars and spinners with Rich: Progress Par.