You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't use helm by myself but a search on the project reveals a recently merged PR that adds support for fish completions: helm/helm#8664
This makes sense since helm seems to use the Go framework cobra for generating completions which recently got support for fish. So this should mostly work automatic.
Can you try generating completions with helm completion fish with a reasonably up-to-date helm? Maybe the documentation is just outdated.
If it works, I guess it would be a good further step to update the helm.fish completion shipped by fish to automatically generate and source the completions with the command above.
I assume that once it is released, this issue should also stay open to implement the suggestion @exploide has to automatically source that command?
Probably not. These things typically spit out very complete but awkward completions, specifically with bad or nonexistent descriptions.
In this case, each completion is accompanied by a proper description.
They're also often quite slow.
This could be the case. I'd love your opinion on the performance.
It's often better to run the thing and use it as a guide to write good completions.
Helm provides some dynamic completions where it figures out what the completions should be, based on the server it is currently connected to. You can still achieve this if you wrote your own completions, but you would need to call helm to obtain those dynamic completions.
I'd appreciate any feedback on the quality of Helm's Fish shell completions, to improve whatever can be improved.
@marckhouzam I have tested it, and it works great with the new completions. A question though. Do I need to re-run this helm completion fish > ~/.config/fish/completions/helm.fish on a regular basis to get the latest completions? That would be quite cumbersome. Imagine having a lot of projects requiring this, it'd become unmanageable or each user would have to automate this themselves. Is there any "fish way" to handle this generically without requiring me to do this?
A question though. Do I need to re-run this helm completion fish > ~/.config/fish/completions/helm.fish on a regular basis to get the latest completions? [..] Is there any "fish way" to handle this generically without requiring me to do this?
I'm no fish expert so others can probably answer better. I'll give you my take on this though.
As long as you stay on the same helm version, you only need to generate the completion script once. But when you install a new helm version, you would need to re-generate it. Some package managers do this for you. For example, on Mac, Homebrew installs the bash and zsh completion scripts for helm whenever it installs or updates helm. I will follow-up with them to try to include fish now that helm supports it (if it isn't done already).
Another option is to source the completion script whenever you start a new shell. Adding helm completion fish | source to your fish initialization file should allow automating this. However this makes shell startup slower, so some people don't like doing that.
Oh and another problem with sourcing the completion script with helm 3.4 is that it will not remove fish's existing helm completions, so you would get invalid old ones left lying around. With helm 3.5 I have fixed that.
It would be interesting to see how this performs since it would be executed whenever you use helm in a new shell instance.
Maybe it is good enough to please the objections mentioned by faho?
Activity
thernstig commentedon Sep 28, 2020
I suppose the best idea would have been if some hero stepped in and added completions to the Helm project itself, see https://helm.sh/docs/helm/helm_completion/. There only exists completions for bash and zsh there, and I am sure we all agree that's not the way we fish users want it 😄
exploide commentedon Sep 28, 2020
I don't use helm by myself but a search on the project reveals a recently merged PR that adds support for fish completions: helm/helm#8664
This makes sense since helm seems to use the Go framework cobra for generating completions which recently got support for fish. So this should mostly work automatic.
Can you try generating completions with
helm completion fishwith a reasonably up-to-date helm? Maybe the documentation is just outdated.If it works, I guess it would be a good further step to update the
helm.fishcompletion shipped by fish to automatically generate and source the completions with the command above.thernstig commentedon Sep 29, 2020
I tried on the latest Helm version 3.3.4, with no luck. I suspect it will make it into 3.4.0 which is the next feature release.
I added a comment to helm/helm#8664, so let's see what they say.
I assume that once it is released, this issue should also stay open to implement the suggestion @exploide has to automatically source that command?
faho commentedon Oct 3, 2020
Probably not. These things typically spit out very complete but awkward completions, specifically with bad or nonexistent descriptions.
They're also often quite slow.
It's often better to run the thing and use it as a guide to write good completions.
marckhouzam commentedon Nov 3, 2020
Helm 3.4 is now available with full Fish shell completion: https://helm.sh/docs/helm/helm_completion_fish/
In this case, each completion is accompanied by a proper description.
This could be the case. I'd love your opinion on the performance.
Helm provides some dynamic completions where it figures out what the completions should be, based on the server it is currently connected to. You can still achieve this if you wrote your own completions, but you would need to call helm to obtain those dynamic completions.
I'd appreciate any feedback on the quality of Helm's Fish shell completions, to improve whatever can be improved.
marckhouzam commentedon Nov 3, 2020
As a side note,
kubectlhas a PR (kubernetes/kubernetes#92989) to support Fish shell completion (requested in #5516). It is based on the same solution Helm uses, which is provided by the Cobra project: https://github.com/spf13/cobra/blob/master/shell_completions.md#fish-completionsthernstig commentedon Nov 5, 2020
@marckhouzam I have tested it, and it works great with the new completions. A question though. Do I need to re-run this
helm completion fish > ~/.config/fish/completions/helm.fishon a regular basis to get the latest completions? That would be quite cumbersome. Imagine having a lot of projects requiring this, it'd become unmanageable or each user would have to automate this themselves. Is there any "fish way" to handle this generically without requiring me to do this?marckhouzam commentedon Nov 5, 2020
Thanks for trying it out @thernstig!
I'm no fish expert so others can probably answer better. I'll give you my take on this though.
As long as you stay on the same helm version, you only need to generate the completion script once. But when you install a new helm version, you would need to re-generate it. Some package managers do this for you. For example, on Mac, Homebrew installs the bash and zsh completion scripts for helm whenever it installs or updates helm. I will follow-up with them to try to include fish now that helm supports it (if it isn't done already).
Another option is to source the completion script whenever you start a new shell. Adding
helm completion fish | sourceto your fish initialization file should allow automating this. However this makes shell startup slower, so some people don't like doing that.marckhouzam commentedon Nov 5, 2020
Oh and another problem with sourcing the completion script with helm 3.4 is that it will not remove fish's existing helm completions, so you would get invalid old ones left lying around. With helm 3.5 I have fixed that.
exploide commentedon Nov 5, 2020
I guess you can put
helm completion fish | sourcein your~/.config/fish/completions/helm.fish.At least pipenv is doing something similar. See
pipenv --completion 2>/dev/null | sourcein https://github.com/fish-shell/fish-shell/blob/master/share/completions/pipenv.fishIt would be interesting to see how this performs since it would be executed whenever you use helm in a new shell instance.
Maybe it is good enough to please the objections mentioned by faho?
exploide commentedon Feb 16, 2022
I think this one can be closed since the referencing PR above is merged.
thernstig commentedon Feb 17, 2022
@marckhouzam considering fish will in the next release call
helm completion fish | sourceitself, see https://github.com/fish-shell/fish-shell/pull/8724/files, should https://helm.sh/docs/helm/helm_completion_fish/ be updated to not showhelm completion fish > ~/.config/fish/completions/helm.fish?