Skip to content

Commit 4a32606

Browse files
docs: updates the token create documentation (#8785)
This update removes the copied config that is in the description header. We can remove the part about the registry not working yet when the registry enabled this. --------- Co-authored-by: Gar <gar+gh@danger.computer>
1 parent b380d15 commit 4a32606

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

docs/lib/content/commands/npm-token.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,23 @@ description: Manage your authentication tokens
1212

1313
This lets you list, create and revoke authentication tokens.
1414

15-
* `npm token list`:
16-
Shows a table of all active authentication tokens.
17-
You can request this as JSON with `--json` or tab-separated values with `--parseable`.
15+
#### Listing tokens
1816

19-
```
20-
Read only token npm_1f… with id 7f3134 created 2017-10-21
17+
When listing tokens, an abbreviated token will be displayed. For security purposes the full token is not displayed.
2118

22-
Publish token npm_af… with id c03241 created 2017-10-02
23-
with IP Whitelist: 192.168.0.1/24
19+
#### Generating tokens
2420

25-
Publish token npm_… with id e0cf92 created 2017-10-02
21+
NOTE: Currently, the npm registry doesn't allow the cli to generate tokens. This feature should be re-enabled soon.
2622

27-
```
23+
When generating tokens, you will be prompted you for your password and, if you have two-factor authentication enabled, an otp.
2824

29-
* `npm token create [--read-only] [--cidr=<cidr-ranges>]`:
30-
Create a new authentication token.
31-
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.
32-
This will prompt you for your password, and, if you have two-factor authentication enabled, an otp.
25+
Please refer to the [docs website](https://docs.npmjs.com/creating-and-viewing-access-tokens) for more information on generating tokens for CI/CD.
3326

34-
Currently, the cli cannot generate automation tokens.
35-
Please refer to the [docs website](https://docs.npmjs.com/creating-and-viewing-access-tokens) for more information on generating automation tokens.
27+
#### Revoking tokens
3628

37-
```
38-
Created publish token a73c9572-f1b9-8983-983d-ba3ac3cc913d
39-
```
29+
When revoking a token, you can use the full token (e.g. what you get back from `npm token create`, or as can be found in an `.npmrc` file), or a truncated id. If the given truncated id is not distinct enough to differentiate between multiple existing tokens, you will need to use enough of the id to allow npm to distinguish between them. Full token ids can be found on the [npm website](https://www.npmjs.com), or in the `--parseable` or `--json` output of `npm token list`. This command will NOT accept the truncated token found in the normal `npm token list` output.
4030

41-
* `npm token revoke <token|id>`:
42-
Immediately removes an authentication token from the registry.
43-
You will no longer be able to use it.
44-
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`.
45-
This will NOT accept the truncated token found in the normal `npm token list` output.
31+
A revoked token will immediately be removed from the registry and you will no longer be able to use it.
4632

4733
### Configuration
4834

0 commit comments

Comments
 (0)