1 ---
2 title: npm-token
3 section: 1
4 description: Manage your authentication tokens
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-token.md
8 redirect_from:
9 - /cli-commands/npm-token
10 - /cli-commands/token
11 - /cli-documentation/cli-commands/npm-token
12 - /cli-documentation/cli-commands/token
13 - /cli-documentation/commands/npm-token
14 - /cli-documentation/commands/token
15 - /cli-documentation/npm-token
16 - /cli-documentation/token
17 - /cli-documentation/v11/cli-commands/npm-token
18 - /cli-documentation/v11/cli-commands/token
19 - /cli-documentation/v11/commands/npm-token
20 - /cli-documentation/v11/commands/token
21 - /cli-documentation/v11/npm-token
22 - /cli-documentation/v11/token
23 - /cli/cli-commands/npm-token
24 - /cli/cli-commands/token
25 - /cli/commands/npm-token
26 - /cli/commands/token
27 - /cli/npm-token
28 - /cli/token
29 - /cli/v11/cli-commands/npm-token
30 - /cli/v11/cli-commands/token
31 - /cli/v11/commands/token
32 - /cli/v11/npm-token
33 - /cli/v11/token
34 - /commands/npm-token
35 - /commands/token
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm token list
42 npm token revoke <id|token>
43 npm token create [--read-only] [--cidr=list]
44 ```
45
46 Note: This command is unaware of workspaces.
47
48 ### Description
49
50 This lets you list, create and revoke authentication tokens.
51
52 - `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`.
53
54 ```
55 Read only token npm_1f… with id 7f3134 created 2017-10-21
56
57 Publish token npm_af… with id c03241 created 2017-10-02
58 with IP Whitelist: 192.168.0.1/24
59
60 Publish token npm_… with id e0cf92 created 2017-10-02
61
62 ```
63
64 - `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 with which to limit use of this token. This will prompt you for your password, and, if you have two-factor authentication enabled, an otp.
65
66 Currently, the cli cannot generate automation tokens. Please refer to the [docs website](https://docs.npmjs.com/creating-and-viewing-access-tokens) for more information on generating automation tokens.
67
68 ```
69 Created publish token a73c9572-f1b9-8983-983d-ba3ac3cc913d
70 ```
71
72 - `npm token revoke <token|id>`: Immediately removes an authentication token from the registry. You will no longer be able to use it. This can accept both complete tokens (such as those you get back from `npm token create`, and those found in your `.npmrc`), and ids as seen in the parseable or json output of `npm token list`. This will NOT accept the truncated token found in the normal `npm token list` output.
73
74 ### Configuration
75
76 #### `read-only`
77
78 - Default: false
79 - Type: Boolean
80
81 This is used to mark a token as unable to publish when configuring limited access tokens with the `npm token create` command.
82
83 #### `cidr`
84
85 - Default: null
86 - Type: null or String (can be set multiple times)
87
88 This is a list of CIDR address to be used when configuring limited access tokens with the `npm token create` command.
89
90 #### `registry`
91
92 - Default: "https://registry.npmjs.org/"
93 - Type: URL
94
95 The base URL of the npm registry.
96
97 #### `otp`
98
99 - Default: null
100 - Type: null or String
101
102 This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with `npm access`.
103
104 If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one.
105
106 ### See Also
107
108 - [npm adduser](/cli/v11/commands/npm-adduser)
109 - [npm registry](/cli/v11/using-npm/registry)
110 - [npm config](/cli/v11/commands/npm-config)
111 - [npmrc](/cli/v11/configuring-npm/npmrc)
112 - [npm owner](/cli/v11/commands/npm-owner)
113 - [npm whoami](/cli/v11/commands/npm-whoami)
114 - [npm profile](/cli/v11/commands/npm-profile)