Registry / devops / tyro
library1.0.16pypypi✓ verified 29d ago

Tyro is a Python library that generates command-line interfaces (CLIs) and configuration objects directly from standard Python type annotations, docstrings, and default values. It simplifies CLI creation by reducing boilerplate, improving IDE support, and enabling static type checking, acting as a lightweight wrapper around `argparse`. The current version is 1.0.12, and it follows a frequent, point-release cadence.

pip install tyro
INSTALL
IMPORT
SIG · TYRO
T
tyro
devopspythonv1.0.16
Install
1.9s avg
Import
204ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.0.16 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.216s · 20.1MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.9s · import 0.192s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

cli
✓ from tyro import cli
✗ import tyro

This example defines a command-line interface using a dataclass. Tyro automatically generates arguments, help text, and parses values from the command line based on the type annotations and docstrings, then populates an instance of `Args`.

from dataclasses import dataclass import tyro @dataclass class Args: """Configure a greeting.""" name: str greet: str = "Hi" # Default value if __name__ == "__main__": # From command line: # python your_script.py --name World # Or: python your_script.py --name World --greet Hello args = tyro.cli(Args) print(f"{args.greet}, {args.name}!")
tyro --version
Debug
Known issues
gotchaTyro's parsing logic for complex types like `Union` and `List` (especially with `nargs`) or positional arguments can sometimes behave differently from standard `argparse`. Users migrating complex `argparse` setups should thoroughly test argument parsing, particularly with edge cases.
fix
Refer to the official documentation on 'What's supported' and 'Argument Prefixing' for `tyro`'s specific interpretation of type hints and argument parsing. Upgrade to the latest version (>=1.0.12) for bug fixes related to `nargs` and positional arguments.
affects: <=1.0.11
gotchaWhen working with nested dataclasses or `Union` types that define subcommands, `tyro` by default prefixes arguments (e.g., `parent.child.arg`). This can lead to very long argument names. While explicit, it might not be desired for all CLIs.
fix
Consider using `tyro.conf.OmitSubcommandPrefixes` on your dataclass or `prefix_name=False` in `tyro.conf.arg()` to shorten argument names where appropriate. For `Union` types defining subcommands, `tyro.conf.subcommand(name='...')` can customize the subcommand name directly.
affects: all
deprecatedThe `@tyro.conf.configure` decorator is generally discouraged for applying global configuration markers. The preferred approach for global options is to pass the `config=` argument directly to `tyro.cli()`.
fix
Refactor code to pass configuration markers as a tuple to `tyro.cli(YourConfig, config=(tyro.conf.Marker,))` instead of using the `@tyro.conf.configure` decorator.
affects: all
Upgrade
Version history
1.0.16latest on PyPI · released Aug 23, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.8 or higher.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
tyro — pip install tyro · libregistry