Skip to content

Commit b0b0edf

Browse files
committed
fix(docs): clean up npm token docs
grammar fixes, notes on authentication tokens, match usage output with readme PR-URL: #2482 Credit: @wraithgar Close: #2482 Reviewed-by: @darcyclarke
1 parent acd5b06 commit b0b0edf

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

docs/content/commands/npm-token.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ description: Manage your authentication tokens
1616
This lets you list, create and revoke authentication tokens.
1717

1818
* `npm token list`:
19-
Shows a table of all active authentication tokens. You can request this as
20-
JSON with `--json` or tab-separated values with `--parseable`.
19+
Shows a table of all active authentication tokens. You can request
20+
this as JSON with `--json` or tab-separated values with `--parseable`.
2121

2222
```bash
2323
+--------+---------+------------+----------+----------------+
@@ -40,10 +40,17 @@ This lets you list, create and revoke authentication tokens.
4040
```
4141

4242
* `npm token create [--read-only] [--cidr=<cidr-ranges>]`:
43-
Create a new authentication token. It can be `--read-only` or accept a list of
44-
[CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) ranges to
45-
limit use of this token to. This will prompt you for your password, and, if you have
46-
two-factor authentication enabled, an otp.
43+
Create a new authentication token. It can be `--read-only`, or accept
44+
a list of
45+
[CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
46+
ranges with which to limit use of this token. This will prompt you for
47+
your password, and, if you have two-factor authentication enabled, an
48+
otp.
49+
50+
Currently, the cli can not generate automation tokens. Please refer to
51+
the [docs
52+
website](https://docs.npmjs.com/creating-and-viewing-access-tokens)
53+
for more information on generating automation tokens.
4754

4855
```bash
4956
+----------------+--------------------------------------+
@@ -58,7 +65,9 @@ This lets you list, create and revoke authentication tokens.
5865
```
5966

6067
* `npm token revoke <token|id>`:
61-
This removes an authentication token, making it immediately unusable. This can accept
62-
both complete tokens (as you get back from `npm token create` and will
63-
find in your `.npmrc`) and ids as seen in the `npm token list` output.
64-
This will NOT accept the truncated token found in `npm token list` output.
68+
Immediately removes an authentication token from the registry. You
69+
will no longer be able to use it. This can accept both complete
70+
tokens (such as those you get back from `npm token create`, and those
71+
found in your `.npmrc`), and ids as seen in the parseable or json
72+
output of `npm token list`. This will NOT accept the truncated token
73+
found in the normal `npm token list` output.

lib/token.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ token._validateCIDRList = validateCIDRList
1717
const usageUtil = require('./utils/usage.js')
1818
token.usage = usageUtil('token',
1919
'npm token list\n' +
20-
'npm token revoke <tokenKey>\n' +
20+
'npm token revoke <id|token>\n' +
2121
'npm token create [--read-only] [--cidr=list]')
2222

2323
const UsageError = (msg) =>

0 commit comments

Comments
 (0)