Shell Completion
Generate a shell completion file for supported shells (bash/fish/zsh/powershell)
yq shell-completion --variation=zshPrints to StdOut a shell completion script for zsh shell.
Bash (default)
yq shell-completionTo configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
. <(yq shell-completion)zsh
yq shell-completion --variation=zshThe generated completion script should be put somewhere in your $fpath named _yq
fish
yq shell-completion --variation=fishSave the output to a '.fish' file and add it to your completions directory.
PowerShell
yq shell-completion --variation=powershellUsers need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the $Profile environment variable.
Last updated
Was this helpful?