Skip to content

Switch CLI to use tyro #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

scottstanie
Copy link
Collaborator

The dolphin config tool is both long (in the number of options you can specify) but also incomplete/out of date.

This swtiches the cli to use tyro, allowing us to have a single source of truth for the large configuration options/ CLI functions with many arguments.
While it adds a dependency, possibilities for making CLI tools to use dolphin are

  1. use argparse
  • Pros: Standard library.
  • Cons: no types. Duplicated long argument lists. Duplicated Help texts and descriptions
  1. Use an external CLI tool (there are many)
  • Pros: (in the best case) Write the function/config object once in python
  • Cons: new dependency

https://brentyi.github.io/tyro/#why-tyro gives a succinct summary of the benefits. I have found tyro to be the best implementation of all the attempts to "automate CLI tools from existing functions/objects".

This will make addressing #361 #510 much simpler.

@gmgunter
Copy link
Member

Would you mind showing a screenshot of what the CLI looks like with tyro?

@scottstanie
Copy link
Collaborator Author

scottstanie commented Apr 25, 2025

image

On the TODO list is switching the current argparse dispatcher using their subcommands (if you tried this with dolphin config, which will just error at the moment)

image
@scottstanie scottstanie marked this pull request as ready for review May 22, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants