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 with
20 --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 CIDR
43 https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing ranges
44 with which to limit use of this token. This will prompt you for your
45 password, and, if you have two-factor authentication enabled, an otp.
46 Currently, the cli can not generate automation tokens. Please refer
47 to the docs website https://docs.npmjs.com/creating-and-viewing-ac‐
48 cess-tokens for more information on generating automation tokens.
49
50
51 +----------------+--------------------------------------+
52 | token | a73c9572-f1b9-8983-983d-ba3ac3cc913d |
53 +----------------+--------------------------------------+
54 | cidr_whitelist | |
55 +----------------+--------------------------------------+
56 | readonly | false |
57 +----------------+--------------------------------------+
58 | created | 2017-10-02T07:52:24.838Z |
59 +----------------+--------------------------------------+
60
61 • npm token revoke <token|id>: Immediately removes an authentication
62 token from the registry. You will no longer be able to use it. This
63 can accept both complete tokens (such as those you get back from npm
64 token create, and those found in your .npmrc), and ids as seen in the
65 parseable or json output of npm token list. This will NOT accept the
66 truncated token found in the normal npm token list output.
67
68
69 Configuration
70 read-only
71 • Default: false
72
73 • Type: Boolean
74
75
76 This is used to mark a token as unable to publish when configuring lim‐
77 ited access tokens with the npm token create command.
78
79 cidr
80 • Default: null
81
82 • Type: null or String (can be set multiple times)
83
84
85 This is a list of CIDR address to be used when configuring limited ac‐
86 cess tokens with the npm token create command.
87
88 registry
89 • Default: "https://registry.npmjs.org/"
90
91 • Type: URL
92
93
94 The base URL of the npm registry.
95
96 otp
97 • Default: null
98
99 • Type: null or String
100
101
102 This is a one-time password from a two-factor authenticator. It's
103 needed when publishing or changing package permissions with npm access.
104
105 If not set, and a registry response fails with a challenge for a
106 one-time password, npm will prompt on the command line for one.
107
108 See Also
109 • npm help adduser
110
111 • npm help registry
112
113 • npm help config
114
115 • npm help npmrc
116
117 • npm help owner
118
119 • npm help whoami
120
121 • npm help profile
122
123
124
125
126 September 2022 NPM-TOKEN(1)