1NPM-TOKEN(1) NPM-TOKEN(1)
2
3
4
6 npm-token - Manage your authentication tokens
7
8 Synopsis
9 npm token list
10 npm token revoke <id|token>
11 npm token create [--read-only] [--cidr=list]
12
13 Note: This command is unaware of workspaces.
14
15 Description
16 This lets you list, create and revoke authentication tokens.
17
18 • npm token list: Shows a table of all active authentication tokens.
19 You can request this as JSON with --json or tab-separated values
20 with --parseable.
21
22
23 +--------+---------+------------+----------+----------------+
24 | id | token | created | read-only | CIDR whitelist |
25 +--------+---------+------------+----------+----------------+
26 | 7f3134 | 1fa9ba… | 2017-10-02 | yes | |
27 +--------+---------+------------+----------+----------------+
28 | c03241 | af7aef… | 2017-10-02 | no | 192.168.0.1/24 |
29 +--------+---------+------------+----------+----------------+
30 | e0cf92 | 3a436a… | 2017-10-02 | no | |
31 +--------+---------+------------+----------+----------------+
32 | 63eb9d | 74ef35… | 2017-09-28 | no | |
33 +--------+---------+------------+----------+----------------+
34 | 2daaa8 | cbad5f… | 2017-09-26 | no | |
35 +--------+---------+------------+----------+----------------+
36 | 68c2fe | 127e51… | 2017-09-23 | no | |
37 +--------+---------+------------+----------+----------------+
38 | 6334e1 | 1dadd1… | 2017-09-23 | no | |
39 +--------+---------+------------+----------+----------------+
40
41 • npm token create [--read-only] [--cidr=<cidr-ranges>]: Create a new
42 authentication token. It can be --read-only, or accept a list of
43 CIDR ⟨https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing⟩
44 ranges with which to limit use of this token. This will prompt you
45 for your password, and, if you have two-factor authentication en‐
46 abled, an otp.
47
48 Currently, the cli can not generate automation tokens. Please refer to
49 the docs website ⟨https://docs.npmjs.com/creating-and-viewing-access-
50 tokens⟩ for more information on generating automation tokens.
51
52
53 +----------------+--------------------------------------+
54 | token | a73c9572-f1b9-8983-983d-ba3ac3cc913d |
55 +----------------+--------------------------------------+
56 | cidr_whitelist | |
57 +----------------+--------------------------------------+
58 | readonly | false |
59 +----------------+--------------------------------------+
60 | created | 2017-10-02T07:52:24.838Z |
61 +----------------+--------------------------------------+
62
63 • npm token revoke <token|id>: Immediately removes an authentication
64 token from the registry. You will no longer be able to use it. This
65 can accept both complete tokens (such as those you get back from
66 npm token create, and those found in your .npmrc), and ids as seen
67 in the parseable or json output of npm token list. This will NOT
68 accept the truncated token found in the normal npm token list out‐
69 put.
70
71
72 Configuration
73 read-only
74 • Default: false
75
76 • Type: Boolean
77
78
79 This is used to mark a token as unable to publish when configuring lim‐
80 ited access tokens with the npm token create command.
81
82 cidr
83 • Default: null
84
85 • Type: null or String (can be set multiple times)
86
87
88 This is a list of CIDR address to be used when configuring limited ac‐
89 cess tokens with the npm token create command.
90
91 registry
92 • Default: "https://registry.npmjs.org/"
93
94 • Type: URL
95
96
97 The base URL of the npm registry.
98
99 otp
100 • Default: null
101
102 • Type: null or String
103
104
105 This is a one-time password from a two-factor authenticator. It's
106 needed when publishing or changing package permissions with npm access.
107
108 If not set, and a registry response fails with a challenge for a one-
109 time password, npm will prompt on the command line for one.
110
111 See Also
112 • npm help adduser
113
114 • npm help registry
115
116 • npm help config
117
118 • npm help npmrc
119
120 • npm help owner
121
122 • npm help whoami
123
124 • npm help profile
125
126
127
128 November 2023 NPM-TOKEN(1)