Skip to content

Conversation

@Andrewyx
Copy link
Contributor

Description

This is a small QOL PR reworking the ./tbots.py CLI to use Typer instead of argparser. It is a small modernization adding some nifty features which makes our CLI more friendly and easier to use. The syntax of the CLI remains completely unchanged, and the central additions are both graphical and UX related. The following key features are now available:

  • After running the built-in --install-completion, double tab to autocomplete (both for args and flags)
  • Help is more helpful, and also shows by default whenever no args are presented
  • Wrong commands will present nearest similar suggestions, hint wrong components, or show the help command
  • Options are shown for args or flags of an Enum type
  • Code for this is more intuitive and less verbose than argparser
  • Color! (styled by default using rich)

Note

To allow for multi-arg parsing consistent with our habits, one patch was added to support this in Typer. Generally multi-arg systems are not common, which is why it is not natively support in Typer.

This PR also has a few small cleanups relating to setup_software and some starlark.

image

Testing Done

Seems to work with the commands I've thrown at it so far.

Resolved Issues

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

@Andrewyx Andrewyx requested a review from Lmh-java December 30, 2025 01:47
Copy link
Contributor

@Lmh-java Lmh-java left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Please rebase before merging

Copy link
Member

@williamckha williamckha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@Andrewyx Andrewyx merged commit 79193c6 into UBC-Thunderbots:master Jan 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants