Docs/Reference/CLI
Yarn CLI reference
List of all the commands available in the Yarn CLI.
Npm-related commands
-
yarn npm audit— Audit installed npm packages for known vulnerabilities -
yarn npm info— Show information about a package -
yarn npm login— Store credentials for an npm registry -
yarn npm logout— Remove credentials for an npm registry -
yarn npm publish— Publish the active workspace to an npm registry. -
yarn npm stage approve— Approve staged package versions for publishing. -
yarn npm stage list— List staged package versions awaiting approval. -
yarn npm stage reject— Reject a staged package version. -
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— Print the npm username for the current authentication settings.
Project management
-
yarn constraints— Check project constraints -
yarn import uv— Import uv projects as Yarn workspaces -
yarn init— Initialize a package in the current directory -
yarn version— Change versions of workspaces -
yarn version apply— Apply deferred records to workspaces -
yarn version check— Check that changed workspaces have version decisions
Dependency management
-
yarn add— Add new dependencies to the project -
yarn explain peer-requirements— Explain a set of peer requirements -
yarn info— Inspect packages in the project dependency tree -
yarn install— Install dependencies -
yarn link— Link another project into the current project -
yarn patch— Extract a package so it can be patched -
yarn patch-commit— Generate or save a patch from an edited package -
yarn rebuild— Rebuild dependencies -
yarn remove— Remove dependencies from the project -
yarn set resolution— Pin a descriptor to a specific resolution -
yarn unlink— Remove local links from the current project -
yarn unplug— Mark packages to be unpacked on disk -
yarn up— Update dependencies to the latest versions -
yarn why— Display the reason why a package is needed
Scripting commands
-
yarn bin— Print the path of an accessible binary -
yarn create— Create a new package from a starter kit -
yarn dedupe— Deduplicate dependencies with overlapping ranges -
yarn dlx— Install a temporary package and run it -
yarn exec— Run a shell command in the package environment -
yarn node— Run a Node.js process within the project's environment -
yarn python— Run a Python process within the project's environment -
yarn run— Run a dependency binary or local script
Cache management
-
yarn cache— Remove cache files -
yarn cache clean— Remove cache files
Configuration commands
-
yarn config get— Print a configuration value -
yarn config set— Set a configuration value -
yarn config unset— Remove a configuration value -
yarn set version— Set the Yarn version used by the local project -
yarn set version from sources— Build Yarn from source and link it to the current project
Debug commands
-
yarn debug daemon— Start a background daemon process.
Daemon management
-
yarn daemon— Open the Yarn daemon through Yarn Switch
Release commands
-
yarn pack— Pack the project into a distributable archive
Task management commands
-
yarn tasks— List all long-lived tasks -
yarn tasks history— Show the recent task event history -
yarn tasks push— Push tasks to be executed from within a running task -
yarn tasks run— Run a task -
yarn tasks stats— Get internal state statistics from the daemon -
yarn tasks stop— Stop a running long-lived task -
yarn tasks ui— Open the task interface in the terminal
Workspace commands
-
yarn workspace— Run a command in a workspace -
yarn workspaces focus— Install a focused set of workspaces -
yarn workspaces foreach— Run a command in multiple workspaces -
yarn workspaces list— List the workspaces in the project