zsh-completions

star 1

Add custom zsh completions for a tool.

PaulRBerg By PaulRBerg schedule Updated 3/20/2026

name: zsh-completions description: Add custom zsh completions for a tool. argument-hint:

Add or update completions for the tool "$1".

Basics:

  • Zsh loads completions from directories in fpath via compinit.
  • Oh My Zsh adds $ZSH_CUSTOM/completions and enabled plugin directories to fpath before compinit.

Steps:

  1. Find or generate the completion script.

    If the tool supports it, generate a zsh completion file, for example:

    $1 completion zsh > _${1}
    
  2. Choose a placement strategy.

    Option A: custom completions directory (no plugin needed):

    mkdir -p "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/completions"
    mv _${1} "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/completions/_${1}"
    

    Option B: custom plugin (useful if you want plugins=(...) control):

    mkdir -p "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/${1}"
    mv _${1} "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/${1}/_${1}"
    

    Add ${1} to the plugins=(...) list in your .zshrc if you use Option B.

  3. Reload completions.

    rm -f "$ZSH_COMPDUMP"
    exec zsh
    

Notes:

  • Completion files must be named _${tool} to be discovered.
  • If the tool has no generator, write _tool manually using zsh completion functions.
Install via CLI
npx skills add https://github.com/PaulRBerg/dotfiles --skill zsh-completions
Repository Details
star Stars 1
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator