From b0b0edf6de1678de7f4a000700c88daa5f7194ef Mon Sep 17 00:00:00 2001 From: Michael Garvin Date: Tue, 12 Jan 2021 10:14:38 -0800 Subject: [PATCH] fix(docs): clean up `npm token` docs grammar fixes, notes on authentication tokens, match usage output with readme PR-URL: https://github.com/npm/cli/pull/2482 Credit: @wraithgar Close: #2482 Reviewed-by: @darcyclarke --- docs/content/commands/npm-token.md | 29 +++++++++++++++++++---------- lib/token.js | 2 +- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/content/commands/npm-token.md b/docs/content/commands/npm-token.md index 3716a0990299..652079453702 100644 --- a/docs/content/commands/npm-token.md +++ b/docs/content/commands/npm-token.md @@ -16,8 +16,8 @@ description: Manage your authentication tokens This lets you list, create and revoke authentication tokens. * `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`. + Shows a table of all active authentication tokens. You can request + this as JSON with `--json` or tab-separated values with `--parseable`. ```bash +--------+---------+------------+----------+----------------+ @@ -40,10 +40,17 @@ This lets you list, create and revoke authentication tokens. ``` * `npm token create [--read-only] [--cidr=]`: - 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. + 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. + + Currently, the cli can not 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. ```bash +----------------+--------------------------------------+ @@ -58,7 +65,9 @@ This lets you list, create and revoke authentication tokens. ``` * `npm token revoke `: - 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. + 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. diff --git a/lib/token.js b/lib/token.js index 98bbd30433cd..b737b5ffbca3 100644 --- a/lib/token.js +++ b/lib/token.js @@ -17,7 +17,7 @@ token._validateCIDRList = validateCIDRList const usageUtil = require('./utils/usage.js') token.usage = usageUtil('token', 'npm token list\n' + - 'npm token revoke \n' + + 'npm token revoke \n' + 'npm token create [--read-only] [--cidr=list]') const UsageError = (msg) =>