Skip to content

pluggy completions

Print a shell completion script to stdout. Install it into your shell’s completion directory to get tab completion for commands and flags.

Usage

pluggy completions <shell>

Supported shells:

  • bash
  • zsh
  • fish
  • pwsh

Any other value errors: Unknown shell "<value>". Supported: bash, zsh, fish, pwsh.

Installation

bash

Terminal window
pluggy completions bash > /usr/local/etc/bash_completion.d/pluggy

On Linux, /etc/bash_completion.d/pluggy is more common. Restart the shell or source the file.

zsh

Terminal window
pluggy completions zsh > "${fpath[1]}/_pluggy"

${fpath[1]} is the first directory on your $fpath. Common choices are /usr/local/share/zsh/site-functions and ~/.zsh/completions. Rebuild the completion cache with rm ~/.zcompdump; autoload -U compinit && compinit.

fish

pluggy completions fish > ~/.config/fish/completions/pluggy.fish

fish auto-discovers the new file on next shell start.

PowerShell

Terminal window
pluggy completions pwsh >> $PROFILE

$PROFILE is the path to your PowerShell profile (for example $HOME\Documents\PowerShell\Profile.ps1). The script uses Register-ArgumentCompleter -Native.

What each script provides

  • Top-level subcommand names (and their aliases) on first-word completion.
  • Per-command flag completion on second-word and later.
  • Global flags (-v, --verbose, -p, --project, --json, --no-color) everywhere.

Completions are generated by walking the live commander tree at runtime, so they always match the binary’s actual flags. Bump pluggy, regenerate the completion script, and the list is current.

JSON mode

--json on pluggy completions doesn’t change anything. The output is a shell script either way. There’s no JSON envelope.

See also