CLI autocomplete
Generate and install prb shell completion scripts for Bash, Zsh, Fish or PowerShell, and then check the performance of command completion and flag.
The prb completion command generates a self-complete script for the shell.
Select the shell below to enable automatic completions for the current session or for each new session.
For the current session:
source <(prb completion bash)To activate automatic completions for each Linux session:
prb completion bash | sudo tee /etc/bash_completion.d/prb >/dev/nullWith Homebrew:
brew install bash-completion@2prb completion bash > "$(brew --prefix)/etc/bash_completion.d/prb"Bash must load bash-completion in order for the generated script to take effect.
For the current session:
source <(prb completion zsh)To activate automatic completions for each session:
prb completion zsh > "${fpath[1]}/_prb"If the completion is not already initialized by the Zsh configuration, add this to ~/.zshrc:
autoload -Uz compinitcompinitFor the current session:
prb completion fish | sourceTo activate automatic completions for each session:
mkdir -p ~/.config/fish/completionsprb completion fish > ~/.config/fish/completions/prb.fishThe completion script is available the next time the fish starts.
For the current session:
prb completion powershell | Out-String | Invoke-ExpressionTo enable automatic completions for each session, create the PowerShell profile, if necessary, and add the command to it:
if (!(Test-Path -Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force}'prb completion powershell | Out-String | Invoke-Expression' | Add-Content $PROFILERecharge the profile to use the autocomplete immediately:
. $PROFILEVerify autocomplete
Section entitled ‘Verify autocomplete’Type a partial command and press Tab. For example:
prb fram<Tab>Your shell should complete it at prb framework. You can also test subcommands and flags:
prb framework l<Tab>prb framework list --o<Tab>If the filling doesn’t work, confirm that prb is available in the new shell and regenerate the script after CLI update so that it includes the latest commands and flags.