Skip to content

Conversation

@nimrod-a
Copy link
Contributor

This PR is a WIP to add a shell-completion command to mvt-ios and mvt-android.

As discussed in #589, there is currently no suitable library to implement this feature without substantial performance impact.

I have therefor created a modified fork of the most popular click autocomplete library (auto-click-auto), which I named quick-click-auto.

You can read more about it here

It still needs some working on, but will hopefully do its job in the near future. I will give an update once I have done some more testing!

@nimrod-a
Copy link
Contributor Author

Update:

The shell-completion command should work as expected now!
I would be happy about people testing this feature :)

For testing:

git clone -b feature/command_completion_command https://github.com/nimrod-a/mvt.git \
&& cd mvt \
&& python3 -m venv .venv && source .venv/bin/activate \
&& pip install . \
&& mvt-ios shell-completion # or mvt-android

Then reopen the terminal or run a new with bash or `zsh.
Command completion should be enabled now.

It works by:

  • Generating the command completion scripts
  • Editing the shell configuration to automatically sources the generated files to the shell.

It should not slow down shell responsiveness as much as the eval implementation did, as the scripts are not generated every time the shell is opened.

@besendorf
Copy link
Collaborator

Hey @nimrod-a if this is done and ready for review could you remove the "WIP" in the title? Could someone review this? @Te-k @roaree ?

@Te-k Te-k self-requested a review June 20, 2025 09:32
@Te-k
Copy link
Collaborator

Te-k commented Jun 20, 2025

I am happy to review that when it is done (and when I will have time, may take a week or two). One question we may have is do we want to have another dependency for that feature? and is this library going to be maintained if it was forked just for this project?

@nimrod-a nimrod-a changed the title WIP: Add shell-completion commands Add shell-completion commands Jul 13, 2025
@nimrod-a
Copy link
Contributor Author

Hey! Sorry for the late reply. You / @roaree & @DonnchaC probably know better then me if having another dependency is worth it for the feature. I can say that for me as a beginner MVT user it was quite useful.

Regrading maintenance of the library: since quick-click-auto has no 3rd party dependencies besides Click, it will most likely only need modification in case Click changes its Shell Completion implementation, which should not happen too often.
I am quite busy with writing my thesis right now, but once I'm done I plan to make a few PRs for command completion at other projects which utilize Click, so the library will hopefully not be used only for MVT.

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.

3 participants