yarn npm whoami — Yarn CLI reference

Print the npm username for the current authentication settings.

Docs/Reference/CLI/npm/whoami

yarn npm whoami

Print the npm username for the current authentication settings.

yarn npm whoami

With -s,--scope, Yarn checks the registry and credentials configured for that scope.

With --publish, Yarn checks the publish registry configured through npmPublishRegistry or the regular npm registry fallback.

#--scope, -sboolean

Query credentials for the registry configured for this scope

#--publishboolean

Query credentials for the publish registry

Examples#

Print username for the default registry

yarn npm whoami

Print username for the registry on a given scope

yarn npm whoami --scope company

Print username for the publish registry

yarn npm whoami --publish