Skip to main content

CLI Reference

General commands

yarn addAdd dependencies to the project.
yarn binGet the path to a binary script.
yarn cache cleanRemove the shared cache files.
yarn configDisplay the current configuration.
yarn config getRead a configuration settings.
yarn config setChange a configuration settings.
yarn config unsetUnset a configuration setting.
yarn dedupeDeduplicate dependencies with overlapping ranges.
yarn dlxRun a package in a temporary environment.
yarn execExecute a shell script.
yarn explainExplain an error code.
yarn explain peer-requirementsExplain a set of peer requirements.
yarn infoSee information related to packages.
yarn initCreate a new package.
yarn installInstall the project dependencies.
yarn linkConnect the local project to another one.
yarn nodeRun node with the hook already setup.
yarn npm auditPerform a vulnerability audit against the installed packages.
yarn packGenerate a tarball from the active workspace.
yarn patchPrepare a package for patching.
yarn patch-commitGenerate a patch out of a directory.
yarn rebuildRebuild the project's native packages.
yarn removeRemove dependencies from the project.
yarn runRun a script defined in the package.json.
yarn set resolutionEnforce a package resolution.
yarn set versionLock the Yarn version used by the project.
yarn set version from sourcesBuild Yarn from master.
yarn stageAdd all yarn files to your vcs.
yarn unlinkDisconnect the local project from another one.
yarn unplugForce the unpacking of a list of packages.
yarn upUpgrade dependencies across the project.
yarn whyDisplay the reason why a package is needed.

Constraints-related commands

yarn constraintsCheck that the project constraints are met.
yarn constraints queryQuery the constraints fact database.
yarn constraints sourcePrint the source code for the constraints.

Npm-related commands

yarn npm infoShow information about a package.
yarn npm loginStore new login info to access the npm registry.
yarn npm logoutLogout of the npm registry.
yarn npm publishPublish the active workspace to the npm registry.
yarn npm tag addAdd a tag for a specific version of a package.
yarn npm tag listList all dist-tags of a package.
yarn npm tag removeRemove a tag from a package.
yarn npm whoamiDisplay the name of the authenticated user.

Plugin-related commands

yarn plugin checkFind all third-party plugins that differ from their own spec.
yarn plugin importDownload a plugin.
yarn plugin import from sourcesBuild a plugin from sources.
yarn plugin listList the available official plugins.
yarn plugin removeRemove a plugin.
yarn plugin runtimeList the active plugins.

Interactive commands

yarn searchOpen the search interface.
yarn upgrade-interactiveOpen the upgrade interface.

Release-related commands

yarn versionApply a new version to the current package.
yarn version applyApply all the deferred version bumps at once.
yarn version checkCheck that all the relevant packages have been bumped.

Workspace-related commands

yarn workspaceRun a command within the specified workspace.
yarn workspaces focusInstall a single workspace and its dependencies.
yarn workspaces foreachRun a command on all workspaces.
yarn workspaces listList all available workspaces.