You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This unfortunately doesn't exist, and unless we decide to extend the tyro API you'd have to write a utility yourself. But for the basic functionality, yes, it'd just be a small helper, eg:
# script.pyfromcli_helperimportcommand, run_cli@commanddefcheckout(branch: str) ->None:
"""Check out a branch."""print(f"{branch=}")
@commanddefcommit(message: str, all: bool=False) ->None:
"""Make a commit."""print(f"{message=}{all=}")
if__name__=="__main__":
run_cli()
I come from click. Tyro has some nice new concepts... But i missed a easy way to compose sub commands to a CLI.
https://brentyi.github.io/tyro/examples/02_nesting/05_subcommands_func/ described to use
tyro.extras.subcommand_cli_from_dict()
, but then i have to specify a dict to map the functions :(Think this can be done with a small helper. So that i just need to add a decorator to the sub command function, like clicks
@click.command()
It there something like this around?!?
The text was updated successfully, but these errors were encountered: