Skip to content

Shell Completion

fabric-dw ships with tab-completion for bash, zsh, and fish via Click's built-in shell completion.

Quick install

The easiest way to install completion for your shell is the built-in command:

fabric-dw completion install bash   # or zsh / fish

This writes the script to the conventional location for your shell and prints the command you need to reload it.

Add --print to inspect the script before installing:

fabric-dw completion install bash --print

Manual setup

Add the following line to ~/.bashrc:

eval "$(_FABRIC_DW_COMPLETE=bash_source fabric-dw)"

Then reload your shell:

source ~/.bashrc

Add the following line to ~/.zshrc:

eval "$(_FABRIC_DW_COMPLETE=zsh_source fabric-dw)"

Then reload your shell:

source ~/.zshrc

Save the completion script to the fish completions directory:

_FABRIC_DW_COMPLETE=fish_source fabric-dw | source

For a persistent installation, write it to a file:

_FABRIC_DW_COMPLETE=fish_source fabric-dw \
  > ~/.config/fish/completions/fabric-dw.fish

Fish picks up files in ~/.config/fish/completions/ automatically on the next shell start. To reload immediately:

source ~/.config/fish/completions/fabric-dw.fish