-
Notifications
You must be signed in to change notification settings - Fork 201
Add fzf-based interactive selection to ros2cli commands #1151
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
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
|
This PR still needs some testing and refinement but before I iterate further I'd like to know if you would merge this idea in. Thanks |
fujitatomoya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tonynajjar generally i like this enhancement, thanks 🚀
there are several comments that i think we need to address but overall i think this is gonna be better user-experience for ROS 2 users and developers.
we already have type completion via shell command prompt but tab completion requires us to know the prefix and type sequentially from the beginning, while fzf lets us match any part of the name in any order (e.g., typing "wrist depth" finds /arm/wrist_camera/depth/image_raw). fzf also provides visual browsing of all available options with real-time filtering, making it ideal for exploring unfamiliar systems or when you only remember fragments of a name.
before fixing up my comments, let's hear out more feedback on this 👍
|
Thanks for the feedback @fujitatomoya . Like you said I will start working on your comments once I get another opinion on the general idea, to make sure this can ultimately get merged in |
|
Maybe @ahcorde you can give your general opinion on the feature and I can continue to iterate with @fujitatomoya? Thanks! |
|
friendly ping @ahcorde |
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
|
@fujitatomoya I did a second round of fixes and am pretty happy with it so far but I invite you to test it out and find some bugs. I'd like to note that there are probably more verbs that can benefit from an fzf integration like |
Signed-off-by: Tony Najjar <[email protected]>
Signed-off-by: Tony Najjar <[email protected]>
fujitatomoya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with green CI. just checking one last comment.
|
@ahcorde @InvincibleRMC i would like to have another approval on this before merge, can you take a look at this? |
InvincibleRMC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small questions
Signed-off-by: Tony Najjar <[email protected]>
|
Thanks for the second review. Some tests are failing because before this PR, verbs are expected to fail if no argument is given but now it's different. I will take a look at this next, hopefully pretty soon |
Description
This PR adds optional fuzzy search functionality to ros2cli commands using fzf, inspired by the ros2-aliases project. When arguments are omitted from commands, an interactive fzf selector is launched instead of throwing an error.
Commands enhanced:
ros2 topic echo- Select topic interactivelyros2 topic hz- Select topic interactivelyros2 topic info- Select topic interactivelyros2 topic bw- Select topic interactivelyros2 topic type- Select topic interactivelyros2 node info- Select node interactivelyros2 param get- Cascading selection (node → parameter)ros2 interface show- Select interface interactivelyImplementation:
interactive_select()helper function inros2cli/helpers.pynargs='?') in affected verbsros2cli/package.xmlIs this user-facing behavior change?
Yes. Users can now omit arguments and use fuzzy search instead:
Before:
After:
If fzf is not installed, users get a clear error message directing them to install via rosdep.
Did you use Generative AI?
Yes, GitHub Copilot was used
Additional Information