tyro (type-safe CLI and config generation for Python)
tyro(命令行配置库)AdvancedA Python library that builds command-line interfaces and configs automatically from type annotations and dataclasses.
tyro is an open-source Python library by Brent Yi of UC Berkeley (MIT-licensed, formerly named dcargs). Its core function, tyro.cli(), reads the type annotations, defaults, and docstrings of a function or dataclass, generates command-line arguments and help text from them, and hands back a fully populated config object; nested configs and subcommands are supported as well. Where Hydra composes configs mainly from YAML files, tyro configs are plain Python objects, so your IDE can autocomplete them and type checkers can flag mistakes. Brent Yi is also one of the nerfstudio authors, and nerfstudio's training command is built on tyro. In embodied AI, newcomers most often meet it in openpi, whose scripts/train.py uses tyro to pick a preset training config by name and then override individual fields on the command line; some scripts in Isaac-GR00T and ManiSkill use it too.
ExampleIn openpi, running uv run scripts/train.py pi05_libero --exp-name=my_run --batch-size=16 selects the preset pi05_libero config and changes only the experiment name and batch size.
- Also called
- dcargs
- Related
- Hydra (Meta configuration framework) · draccus (dataclass-based configuration library) · openpi (Physical Intelligence) · Nerfstudio / gsplat · ManiSkill · Hyperparameter
- Sources
- brentyi/tyro (GitHub)
Brent Yi 个人主页 (Chinese)
openpi src/openpi/training/config.py (GitHub) - As of
- 2026-10