tyro
CLI interfaces & config objects, from types
Decision gist · record as of 2026-08-14
Yes. tyro is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—turning type annotations into CLIs—in a way that integrates well with modern Python tooling and type checkers. It's particularly valuable if you're already using dataclasses, attrs, or Pydantic and want to avoid writing boilerplate argument parsing code.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later.
- Low friction: pure Python wheel with four runtime dependencies (docstring-parser, eval-type-backport, typeguard, typing-extensions).
- Actively maintained with a recent release (55 days ago) and 1098 repository stars.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) means you can use, modify, and distribute tyro freely in commercial and private projects with minimal restrictions.
last release 2026-06-20 (55 days) · last repo commit 2026-08-06 · 1,098 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 14,734,015 downloads/mo, #1,217 on PyPI
Alternatives
Verify before relying
pip install tyro
import tyro
from dataclasses import dataclass
@dataclass
class Config:
name: str
count: int
config = tyro.cli(Config)- Whether shell completion works across all major shells (bash, zsh, fish, PowerShell).
- Performance characteristics when handling deeply nested configuration hierarchies.
- Compatibility with custom type annotations beyond standard library types.
What it is and what it does
tyro is a library that turns Python type annotations into command-line interfaces and configuration objects without requiring separate schema definitions or configuration files. You write a function or dataclass with type hints and docstrings, and tyro automatically generates a CLI with argument parsing, help text, type validation, and nested subcommand support. It integrates with popular configuration libraries like dataclasses, attrs, and Pydantic, making it useful for both throwaway scripts and larger projects that need maintainable, type-safe configuration.
The library is designed around the principle that your code's type annotations and docstrings should be the single source of truth for CLI behavior. This approach keeps configuration logic close to where it's used and enables static type checkers to understand your CLI arguments, improving IDE support and catching errors at development time rather than runtime.
Use it for
- Build CLI tools for machine learning experiments where hyperparameters are defined as dataclass fields with type hints.
- Generate configuration interfaces for research codebases without writing separate argument parsing logic.
- Create nested command structures for tools that need hierarchical configuration and subcommands.
- Rapidly prototype scripts that accept typed arguments while maintaining IDE autocomplete and type checking.
- Integrate configuration models directly into CLI applications with automatic validation and help text generation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
tyro is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—turning type annotations into CLIs—in a way that integrates well with modern Python tooling and type checkers. It's particularly valuable if you're already using dataclasses, attrs, or Pydantic and want to avoid writing boilerplate argument parsing code.
Install
tyro on PyPI
Before you install
Low friction: pure Python wheel with four runtime dependencies (docstring-parser, eval-type-backport, typeguard, typing-extensions). Actively maintained with a recent release (55 days ago) and 1098 repository stars.
Requires Python 3.8 or later.
License in practice
MIT license (permissive) means you can use, modify, and distribute tyro freely in commercial and private projects with minimal restrictions.
Quickstart
pip install tyro
import tyro
from dataclasses import dataclass
@dataclass
class Config:
name: str
count: int
config = tyro.cli(Config)
Verify before relying
- Whether shell completion works across all major shells (bash, zsh, fish, PowerShell).
- Performance characteristics when handling deeply nested configuration hierarchies.
- Compatibility with custom type annotations beyond standard library types.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesdocstring-parsereval-type-backporttypeguardtyping-extensions |
| Maintenance | Actively maintained 55 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 14,734,015 / month, #1,217 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: tyro-1.0.15-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “cli from type annotations”
- tyrotyro generates command-line interfaces and configuration objects…
- arghArgh turns plain Python functions into command-line interfaces by…
- autotypingAutomatically infers and adds type annotations to Python functions…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also fire · jsonargparse · targ · simple-parsing · argparse-dataclass · cyclopts · clize · pydantic-argparse · argdantic · py-avro-schema