zsh-completion-generators

May 4, 2026 ยท View on GitHub

56 tools supported

Problem: You have a new CLI tool foo, and it has a subcommand like foo generate-completions --shell=zsh. But you don't know where to put its output--or you think you know, but it doesn't seem to work.

This is a very simple ZSH plugin which has a table of tool names and the commands for outputting completion scripts for those tools. Currently known tools are:

ToolCommand to generate completion
acliacli completion zsh
argocdargocd completion zsh
atuinatuin gen-completions --shell zsh
bkbk completion zsh
bufbuf completion zsh
bwbw completion --shell zsh
cargorustup completions zsh cargo
chezmoichezmoi completion zsh
chronoctlchronoctl completion zsh
codexcodex completion zsh
colimacolima completion zsh
denodeno completions zsh
dockerdocker completion zsh
doctldoctl completion zsh
eksctleksctl completion zsh
fdfd --gen-completions
flyfly completion zsh
ghgh completion --shell zsh
glabglab completion -s zsh
golangci-lintgolangci-lint completion zsh
goreleasergoreleaser completion zsh
gtgt completion
hcloudhcloud completion zsh
helmhelm completion zsh
hfhf --show-completion
hugohugo completion zsh
jirajira completion zsh
justjust --completions zsh
k9sk9s completion zsh
kindkind completion zsh
kubectlkubectl completion zsh
minikubeminikube completion zsh
misemise completion zsh
nerdctlnerdctl completion zsh
opop completion zsh
opencodeopencode completion zsh
orbctlorbctl completion zsh
pdmpdm completion zsh
pixipixi completion --shell zsh
pnpmpnpm completion zsh
podmanpodman completion zsh
poetrypoetry completions zsh
pulumipulumi gen-completion zsh
pumaspumas generate-completion zsh
rbwrbw gen-completions zsh
rclonerclone genautocomplete zsh -
resticrestic generate --zsh-completion -
rgrg --generate=complete-zsh
rustuprustup completions zsh rustup
ryerye self completion -s zsh
starshipstarship completions zsh
sternstern --completion zsh
tasktask --completion zsh
uvuv generate-shell-completion zsh
yqyq completion zsh
zellijzellij setup --generate-completion zsh

On every shell load, it will filter that list for tools that

  • you have installed (i.e. are on the $PATH)
  • do not already have completions registered
  • this plugin has not already generated completions for

It will run the completion command and save its output to a file _<toolname>. If the path of this repo is in $fpath (see below), then completions should work immediately.

Installation

This repo follows a zsh plugin convention established by oh-my-zsh. Most other plugin managers expect the same structure. Add zetlen/zsh-completion-generators using your chosen plugin manager's instructions. It will autoload the plugin, and put the plugin directory (and thus all generated completions) in the fpath variable, where zsh completions directories are listed.

Manual installation

  1. Clone this repo
  2. Add to your .zshrc:
    export fpath=(/path/to/zsh-completion-generators/ $fpath)
    source /path/to/zsh-completion-generators/zsh-completion-generators.plugin.zsh
    compinit # this may already be called elsewhere
    

:warning: You'll need to source this plugin before calling compinit, so your favorite plugin manager may have special instructions for doing so.

Initial load of your first new shell after install may take a while, since it has to generate the completion files for each command that you have installed. However, it caches them, so subsequent loads will take no time.

Notes

Automatic regeneration on upgrade: When you upgrade a tool, this plugin automatically detects the newer binary and regenerates completions on the next shell load. The zsh-completion-generators-rebuild command is only needed if completions become corrupted or you want to force regeneration of all completions.

After regenerating completions, you may need to delete $HOME/.zcompdump and/or $HOME/.zcompcache/ for changes to take effect.

Some CLIs don't have completion commands that output shell scripts to stdout. Sometimes they want to automatically update your .zshrc, or place special configuration files elsewhere. This plugin is not compatible with those approaches.

Custom generators

You can add your own tool definitions without modifying this plugin by creating a user-local CSV file:

~/.config/zsh-completion-generators/generators.csv

Use the same format as the main generators.csv:

Tool,Command to generate completion
mytool,mytool completions zsh

This file will survive plugin updates.