Shell autocompletion for Yarn
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


Shell autocompletion for Yarn


  1. Download the completion file to your machine.
$ curl -o ~/.yarn-completion
  1. Source the file in your shell rc file.


$ echo -e '\n. ~/.yarn-completion' >> ~/.bashrc

zsh: Official zsh completions can be found in the zsh-completions repository.

Installation on macOS with Homebrew

  1. bash version >= 4.x.x is required, rather MacOS's default (and dated) bash v3.

    brew install bash
    ## restart terminal
    bash --version
    ## GNU bash, version 4.x = OK
  2. Install bash-completion if you have not done it yet:

    brew install bash-completion
    ## + copy one line to ~/.bash_profile as instructed by brew after bash-completion setup
  3. Install yarn-completion:

    curl -L > `brew --prefix`/etc/bash_completion.d/yarn
  4. Restart Terminal.