Paket


Paket shell completion for bash

Installation

Download

Option 1: Save the completion script to your home directory

  1. Download the paket-completion.bash file to a subdirectory of your home directory, preferably a directory with other function files.
  2. source the file in your ~/.bashrc.
1: 
2: 
3: 
4: 
$ target="$HOME/.bash-completions/paket-completion.bash"
$ mkdir "$(dirname "$target")"
$ curl --fail --location --proto-redir -all,https --output "$target" \
  https://raw.githubusercontent.com/fsprojects/Paket/master/completion/paket-completion.bash

In your ~/.bashrc:

1: 
source "$HOME/.bash-completions/paket-completion.bash"

Option 2: Save the completion script to /etc/bash_completion.d/

  1. Download the paket-completion.bash file to /etc/bash_completion.d/.
  2. Restart your shell.
1: 
2: 
3: 
$ target="/etc/bash_completion.d/paket-completion.bash"
$ curl --fail --location --proto-redir -all,https --output "$target" \
  https://raw.githubusercontent.com/fsprojects/Paket/master/completion/paket-completion.bash

Updating an existing installation

Just repeat the download from above.

Alternatively the completion script comes bundled with the paket-completion-update function that will download the current paket-completion.bash to the same file as above, even if you changed its location after the initial download.

Please note: The paket-completion-update function requires the completion script to be sourced and curl to be installed.

paket-completion-update supports an optional first parameter that allows you to override the default download root URL which is https://raw.githubusercontent.com/fsprojects/Paket/master/completion.

paket alias

For easier consumption of Paket (without paket.sh or paket.cmd) it is advised to create an alias and always run Paket from the repository root.

Also have a look at Paket's magic mode.

Somewhere in your ~/.bashrc:

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
if [[ "$OS" != Windows* ]]; then
  alias paket='mono ./.paket/paket.exe'
else
  alias paket='./.paket/paket.exe'
fi

# Complete the paket alias using the _paket function.
complete -F _paket paket
Fork me on GitHub