1 ---
2 title: npm-whoami
3 section: 1
4 description: Display npm username
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-whoami.md
8 redirect_from:
9 - /cli-commands/npm-whoami
10 - /cli-commands/whoami
11 - /cli-documentation/cli-commands/npm-whoami
12 - /cli-documentation/cli-commands/whoami
13 - /cli-documentation/commands/npm-whoami
14 - /cli-documentation/commands/whoami
15 - /cli-documentation/npm-whoami
16 - /cli-documentation/v10/cli-commands/npm-whoami
17 - /cli-documentation/v10/cli-commands/whoami
18 - /cli-documentation/v10/commands/npm-whoami
19 - /cli-documentation/v10/commands/whoami
20 - /cli-documentation/v10/npm-whoami
21 - /cli-documentation/v10/whoami
22 - /cli-documentation/whoami
23 - /cli/cli-commands/npm-whoami
24 - /cli/cli-commands/whoami
25 - /cli/commands/npm-whoami
26 - /cli/commands/whoami
27 - /cli/npm-whoami
28 - /cli/v10/cli-commands/npm-whoami
29 - /cli/v10/cli-commands/whoami
30 - /cli/v10/commands/whoami
31 - /cli/v10/npm-whoami
32 - /cli/v10/whoami
33 - /cli/whoami
34 - /commands/npm-whoami
35 - /commands/whoami
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm whoami
42 ```
43
44 Note: This command is unaware of workspaces.
45
46 ### Description
47
48 Display the npm username of the currently logged-in user.
49
50 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.
51
52 If logged into a registry that uses Basic Auth, then simply print the `username` portion of the authentication string.
53
54 ### Configuration
55
56 #### `registry`
57
58 - Default: "https://registry.npmjs.org/"
59 - Type: URL
60
61 The base URL of the npm registry.
62
63 ### See Also
64
65 - [npm config](/cli/v10/commands/npm-config)
66 - [npmrc](/cli/v10/configuring-npm/npmrc)
67 - [npm adduser](/cli/v10/commands/npm-adduser)