CLI Reference
General commands
yarn add | Add dependencies to the project. |
yarn bin | Get the path to a binary script. |
yarn cache clean | Remove the shared cache files. |
yarn config | Display the current configuration. |
yarn config get | Read a configuration settings. |
yarn config set | Change a configuration settings. |
yarn config unset | Unset a configuration setting. |
yarn dedupe | Deduplicate dependencies with overlapping ranges. |
yarn dlx | Run a package in a temporary environment. |
yarn exec | Execute a shell script. |
yarn explain | Explain an error code. |
yarn explain peer-requirements | Explain a set of peer requirements. |
yarn info | See information related to packages. |
yarn init | Create a new package. |
yarn install | Install the project dependencies. |
yarn link | Connect the local project to another one. |
yarn node | Run node with the hook already setup. |
yarn npm audit | Perform a vulnerability audit against the installed packages. |
yarn pack | Generate a tarball from the active workspace. |
yarn patch | Prepare a package for patching. |
yarn patch-commit | Generate a patch out of a directory. |
yarn rebuild | Rebuild the project's native packages. |
yarn remove | Remove dependencies from the project. |
yarn run | Run a script defined in the package.json. |
yarn set resolution | Enforce a package resolution. |
yarn set version | Lock the Yarn version used by the project. |
yarn set version from sources | Build Yarn from master. |
yarn stage | Add all yarn files to your vcs. |
yarn unlink | Disconnect the local project from another one. |
yarn unplug | Force the unpacking of a list of packages. |
yarn up | Upgrade dependencies across the project. |
yarn why | Display the reason why a package is needed. |
Constraints-related commands
yarn constraints | Check that the project constraints are met. |
yarn constraints query | Query the constraints fact database. |
yarn constraints source | Print the source code for the constraints. |
Npm-related commands
yarn npm info | Show information about a package. |
yarn npm login | Store new login info to access the npm registry. |
yarn npm logout | Logout of the npm registry. |
yarn npm publish | Publish the active workspace to the npm registry. |
yarn npm tag add | Add a tag for a specific version of a package. |
yarn npm tag list | List all dist-tags of a package. |
yarn npm tag remove | Remove a tag from a package. |
yarn npm whoami | Display the name of the authenticated user. |
Plugin-related commands
yarn plugin check | Find all third-party plugins that differ from their own spec. |
yarn plugin import | Download a plugin. |
yarn plugin import from sources | Build a plugin from sources. |
yarn plugin list | List the available official plugins. |
yarn plugin remove | Remove a plugin. |
yarn plugin runtime | List the active plugins. |
Interactive commands
yarn search | Open the search interface. |
yarn upgrade-interactive | Open the upgrade interface. |
Release-related commands
yarn version | Apply a new version to the current package. |
yarn version apply | Apply all the deferred version bumps at once. |
yarn version check | Check that all the relevant packages have been bumped. |
Workspace-related commands
yarn workspace | Run a command within the specified workspace. |
yarn workspaces focus | Install a single workspace and its dependencies. |
yarn workspaces foreach | Run a command on all workspaces. |
yarn workspaces list | List all available workspaces. |