Important: This documentation covers Yarn 2. For the 1.x doc, check
yarn addyarn binyarn cache cleanyarn config getyarn config setyarn configyarn constraints queryyarn constraints sourceyarn constraintsyarn dlxyarn inityarn installyarn linkyarn nodeyarn npm infoyarn npm loginyarn npm publishyarn npm whoamiyarn packyarn patch-commityarn patchyarn plugin importyarn plugin listyarn plugin runtimeyarn rebuildyarn removeyarn runyarn set resolutionyarn set version from sourcesyarn set versionyarn stageyarn unplugyarn upyarn upgrade-interactiveyarn version applyyarn version checkyarn versionyarn whyyarn workspaceyarn workspaces foreachyarn workspaces list

yarn npm whoami

Display the name of the authenticated user.


$> yarn npm whoami [-s,--scope #0] [--publish]


Print username for the default registry :

yarn npm whoami

Print username for the registry on a given scope :

yarn npm whoami --scope company


Print the username associated with the current authentication settings to the standard output.

When using -s,--scope, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the npmRegistries map, and the registry associated with the scope is configured via the npmScopes map).

When using --publish, the registry we'll select will by default be the one used when publishing packages (publishConfig.registry or npmPublishRegistry if available, otherwise we'll fallback to the regular npmRegistryServer).