Skip to content
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

Shell completions #1197

Open
Freed-Wu opened this issue Nov 18, 2022 · 7 comments
Open

Shell completions #1197

Freed-Wu opened this issue Nov 18, 2022 · 7 comments
Labels

Comments

@Freed-Wu
Copy link

Is your feature request related to a problem? Please describe.
Add shell completions for huggingface-cli

Describe the solution you'd like
https://docs.iterative.ai/shtab
Describe alternatives you've considered
https://docs.iterative.ai/shtab/#alternatives

@Wauplin
Copy link
Contributor

Wauplin commented Nov 18, 2022

Hi @Freed-Wu, thanks for the idea. Seems a good suggestion to facilitate user experience. However I don't have experience in it. Would you mind implementing a POC to show how this would integrate with huggingface-cli and make a PR for it ?

Something we should keep it mind is that installing shtab (or argcomplete) should be optional for our users. So I would add the dependency to the "cli" group in setup.py.

Side question: is this something that would integrate well with Windows cmd ?

@Freed-Wu
Copy link
Author

Freed-Wu commented Nov 18, 2022

should be optional for our users

is this something that would integrate well with Windows cmd

  • cmd don't support customization of completion.
  • Now shtab only support bash/zsh/tcsh, and will support fish/powershell in roadmap.

@Freed-Wu
Copy link
Author

I would add the dependency to the "cli" group in setup.py.

Why not completion to keep same as these examples?

@Wauplin
Copy link
Contributor

Wauplin commented Nov 18, 2022

Why not completion to keep same as these examples?

Fine with completion ! :)

And thanks for clarification on supported shells.

@Freed-Wu
Copy link
Author

Fine with completion ! :)

OK. I've give a PR with 'completion'

And thanks for clarification on supported shells.

You're welcome.

@remyleone
Copy link

Using Click might be helpful here: https://click.palletsprojects.com/en/8.1.x/shell-completion/

@Wauplin
Copy link
Contributor

Wauplin commented Nov 13, 2023

Using Click might be helpful here: https://click.palletsprojects.com/en/8.1.x/shell-completion/

As a matter of fact, yes we are (re-)considering the idea of using click (or Typer). However this would mean adding a (quite big) dependency to the project which we'd like to avoid -since CLI is only an "option" for huggingface_hub, not everyone uses it-. There are also suggestions from @Freed-Wu about how to implement shell completion with the current setup (see #1207 (comment)).
We are trying to see which direction we want to take and (hopefully) will get back here once decided. For the context, the CLI has not been our focus until now but this is changing, especially since we release huggingface-cli upload and huggingface-cli download support.

@Wauplin Wauplin added the CLI label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants