1 ---
2 title: npm-token
3 section: 1
4 description: Manage your authentication tokens
5 github_repo: npm/cli
6 github_branch: release/v6
7 github_path: docs/content/commands/npm-token.md
8 redirect_from:
9 - /cli-documentation/v6/cli-commands/npm-token
10 - /cli-documentation/v6/cli-commands/token
11 - /cli-documentation/v6/commands/npm-token
12 - /cli-documentation/v6/commands/token
13 - /cli-documentation/v6/npm-token
14 - /cli-documentation/v6/token
15 - /cli/v6/cli-commands/npm-token
16 - /cli/v6/cli-commands/token
17 - /cli/v6/commands/token
18 - /cli/v6/npm-token
19 - /cli/v6/token
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm token list [--json|--parseable]
26 npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16]
27 npm token revoke <id|token>
28 ```
29
30 ### Description
31
32 This lets you list, create and revoke authentication tokens.
33
34 - `npm token list`: Shows a table of all active authentication tokens. You can request this as JSON with `--json` or tab-separated values with `--parseable`.
35
36 ```bash
37 +--------+---------+------------+----------+----------------+
38 | id | token | created | read-only | CIDR whitelist |
39 +--------+---------+------------+----------+----------------+
40 | 7f3134 | 1fa9ba… | 2017-10-02 | yes | |
41 +--------+---------+------------+----------+----------------+
42 | c03241 | af7aef… | 2017-10-02 | no | 192.168.0.1/24 |
43 +--------+---------+------------+----------+----------------+
44 | e0cf92 | 3a436a… | 2017-10-02 | no | |
45 +--------+---------+------------+----------+----------------+
46 | 63eb9d | 74ef35… | 2017-09-28 | no | |
47 +--------+---------+------------+----------+----------------+
48 | 2daaa8 | cbad5f… | 2017-09-26 | no | |
49 +--------+---------+------------+----------+----------------+
50 | 68c2fe | 127e51… | 2017-09-23 | no | |
51 +--------+---------+------------+----------+----------------+
52 | 6334e1 | 1dadd1… | 2017-09-23 | no | |
53 +--------+---------+------------+----------+----------------+
54 ```
55
56 - `npm token create [--read-only] [--cidr=<cidr-ranges>]`: Create a new authentication token. It can be `--read-only` or accept a list of [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) ranges to limit use of this token to. This will prompt you for your password, and, if you have two-factor authentication enabled, an otp.
57
58 ```bash
59 +----------------+--------------------------------------+
60 | token | a73c9572-f1b9-8983-983d-ba3ac3cc913d |
61 +----------------+--------------------------------------+
62 | cidr_whitelist | |
63 +----------------+--------------------------------------+
64 | readonly | false |
65 +----------------+--------------------------------------+
66 | created | 2017-10-02T07:52:24.838Z |
67 +----------------+--------------------------------------+
68 ```
69
70 - `npm token revoke <token|id>`: This removes an authentication token, making it immediately unusable. This can accept both complete tokens (as you get back from `npm token create` and will find in your `.npmrc`) and ids as seen in the `npm token list` output. This will NOT accept the truncated token found in `npm token list` output.