1 ---
2 title: npm-whoami
3 section: 1
4 description: Display npm username
5 github_repo: npm/cli
6 github_branch: release/v7
7 github_path: docs/content/commands/npm-whoami.md
8 redirect_from:
9 - /cli-documentation/v7/cli-commands/npm-whoami
10 - /cli-documentation/v7/cli-commands/whoami
11 - /cli-documentation/v7/commands/npm-whoami
12 - /cli-documentation/v7/commands/whoami
13 - /cli-documentation/v7/npm-whoami
14 - /cli-documentation/v7/whoami
15 - /cli/v7/cli-commands/npm-whoami
16 - /cli/v7/cli-commands/whoami
17 - /cli/v7/commands/whoami
18 - /cli/v7/npm-whoami
19 - /cli/v7/whoami
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm whoami [--registry <registry>]
26 ```
27
28 Note: This command is unaware of workspaces.
29
30 ### Description
31
32 Display the npm username of the currently logged-in user.
33
34 If logged into a registry that provides token-based authentication, then connect to the `/-/whoami` registry endpoint to find the username associated with the token, and print to standard output.
35
36 If logged into a registry that uses Basic Auth, then simply print the `username` portion of the authentication string.
37
38 ### Configuration
39
40 #### `registry`
41
42 - Default: "https://registry.npmjs.org/"
43 - Type: URL
44
45 The base URL of the npm registry.
46
47 ### See Also
48
49 - [npm config](/cli/v7/commands/npm-config)
50 - [npmrc](/cli/v7/configuring-npm/npmrc)
51 - [npm adduser](/cli/v7/commands/npm-adduser)