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

bash completion for renku commands #116

Open
jachro opened this issue Mar 3, 2020 · 6 comments
Open

bash completion for renku commands #116

jachro opened this issue Mar 3, 2020 · 6 comments

Comments

@jachro
Copy link
Collaborator

jachro commented Mar 3, 2020

As a Renku CLI user, I'd like to have some bash-completion for Renku commands so when I press the key I either get the command I started typing completed or when I pressed twice I get shown the possibilities I can choose from.

Acceptance criteria:

  • when there's a single possibility to finish the command I've typed in and I pressed the key, the command should be completed.
    Example:
%> renku datas + <TAB>
%> renku dataset 
  • when there are multiple possibilities to what I've typed in and I pressed twice, I should see the available options.
    Example:
%> renku dataset + <TAB> + <TAB>
add create
%> renku dataset 
  • the completion should work for project specific keywords/values like dataset names.
@rokroskar
Copy link
Member

This was done in SwissDataScienceCenter/renku-python#351

After running

renku --install-completion

you get

$ renku <tab> <tab>
clone     dataset   githooks  init      migrate   rerun     run       status    update
config    doctor    help      log       mv        rm        show      storage   workflow
$ renku dataset <tab> <tab>
add       create    edit      export    import    ls-files  ls-tags   rm        rm-tags   tag       unlink    update

However, afaik it does not autocomplete e.g. dataset names. And, as always, this feature could benefit from better documentation!

@jachro
Copy link
Collaborator Author

jachro commented Mar 3, 2020

Oh cool! Could we add it to the templates by default maybe?

@rokroskar
Copy link
Member

That's a good idea! I haven't tried using the auto-complete in a long time so I'm a bit worried unleashing it on the users unvetted, but maybe "it just works"?

@rokroskar rokroskar changed the title It would be nice to have some bash completion for renku commands bash completion for renku commands Mar 3, 2020
@jachro
Copy link
Collaborator Author

jachro commented Mar 6, 2020

It looks it works although it's somehow slow. And it would be nice if it's able to complete the project-specific keywords/values as I mentioned.

@rokroskar
Copy link
Member

I agree - the slowness comes from the general slowness of the CLI... it also depends how you install it, if it's installed from pip directly it's a bit faster.

@rokroskar
Copy link
Member

I am moving this issue to the renkulab-docker repo - we should add the auto-completion to the entrypoint and/or Dockerfile.

@rokroskar rokroskar transferred this issue from SwissDataScienceCenter/renku-python Aug 19, 2020
@Panaetius Panaetius moved this to Backlog in renku-python May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants