yarn workspaces list — Yarn CLI reference

List the workspaces in the project

Docs/Reference/CLI/workspaces/list

yarn workspaces list

List the workspaces in the project

yarn workspaces list

This command prints the list of workspaces in the project.

  • If --since is set, Yarn only lists workspaces modified since the specified ref. Without an explicit ref, Yarn uses the changesetBaseRefs configuration (or the YARN_CHANGESET_BASE / TURBO_SCM_BASE environment variables). Changes to the lockfile mark the workspaces whose dependency tree changed, and changes to files matching changesetGlobalFiles mark every workspace.

  • By default the working tree (including uncommitted and untracked files) is compared to the base ref; --head <ref> (or the YARN_CHANGESET_HEAD / TURBO_SCM_HEAD environment variables) compares two refs instead.

  • If -R,--recursive is set along with --since, Yarn will also list workspaces that depend on workspaces that have been changed since the specified ref, recursively following dependencies, devDependencies, and peerDependencies fields. This is the equivalent of turbo ls --affected.

  • If --no-private is set, Yarn omits workspaces whose manifest has private: true.

If both -v,--verbose and --json are set, Yarn also returns cross-dependencies between workspaces (useful when you wish to automatically generate Bazel rules).

#--verbose, -vboolean

Also return the cross-dependencies between workspaces

#--privateboolean

Also list private workspaces

#--sincestring

Only include workspaces that have been changed since the specified ref

#--recursive, -Rboolean

Include dependents of changed workspaces when used with --since

#--headboolean

Compare against this ref rather than the working tree when used with --since

#--jsonboolean

Format the output as an NDJSON stream

#--tree-hashboolean

Include a hash of each workspace dependency tree (requires --json)