Skip to content

liuruenshen/yarn-2-completion

Repository files navigation

yarn-2-completion

Status Workflow codecov CodeFactor License

Yarn completion

📝 Table of Contents

Prerequisites

  1. Yarn
  2. Node.js 8+
  3. Bash 3.2+

🏁 Getting Started

git clone git@github.com:liuruenshen/yarn-2-completion.git

./yarn-2-completion/install.sh

🧐 About

It is a yarn completion, supporting macOS default shipped bash version 3.2 and above.

Tested on bash 3.2, 4.4, and 5.0 with yarn 1.22.10, 2.1.0 and 2.4.2

Features

  1. Show all the matched workspace's package names for "yarn workspace(s)" commands.

  2. Prevent alternative flags from being shown again if one of them is already on the command line

    For example, -v is short flag for --version, having one on the command line disable the other one because they are the same.

  3. List all the script names in the package.json for yarn, yarn run, yarn workspace ... or yarn workspace ... run; the package.json for which the yarn-2-completion searches depends on the command or the path where the command is typing.

  4. Enable one-tab completion during installation (Optional).

  5. List all the matched system executables for yarn exec or yarn workspace ... exec (Optional).

  6. Show available words based on the current repository's yarn version; different repositories with different yarn versions won't interfere with each other.