Skip to content

Commit 5788b67

Browse files
committed
CLI documentation update from CI
1 parent 4a49edb commit 5788b67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+15692
-4
lines changed

cli-cache.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"v11": "cf52b8be2645ee098ee83ea9981fc32a11932fad",
2+
"v11": "f7da341322c2f860156e8144b208583596504479",
33
"v9": "64763a341e7aa5b456e696f956759bf9b3440dc1",
44
"v10": "a3041941586b6fb8ed7403fe3c24d81138a96005",
55
"v8": "aa8fff11cdab94fff1a2160ee5241f5f4632e96b"
6-
}
6+
}

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"templateOSS": {
4242
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
43-
"version": "4.23.5",
43+
"version": "4.23.6",
4444
"content": "./scripts/template-oss"
4545
},
4646
"files": [

content/cli/v11/commands/index.mdx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: CLI Commands
3+
shortName: Commands
4+
github_repo: npm/cli
5+
github_branch: latest
6+
github_path: docs/lib/content/nav.yml
7+
redirect_from:
8+
- /cli-commands
9+
- /cli-commands/index
10+
- /cli-documentation/cli
11+
- /cli-documentation/cli-commands
12+
- /cli-documentation/cli-commands/index
13+
- /cli-documentation/commands
14+
- /cli-documentation/commands/index
15+
- /cli-documentation/v11/cli-commands
16+
- /cli-documentation/v11/cli-commands/index
17+
- /cli-documentation/v11/commands
18+
- /cli-documentation/v11/commands/index
19+
- /cli/cli-commands
20+
- /cli/cli-commands/index
21+
- /cli/commands
22+
- /cli/commands/index
23+
- /cli/v11/cli-commands
24+
- /cli/v11/cli-commands/index
25+
- /cli/v11/commands/index
26+
- /commands
27+
- /commands/index
28+
---
29+
30+
<Index depth="1" />
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: npm-access
3+
section: 1
4+
description: Set access level on published packages
5+
github_repo: npm/cli
6+
github_branch: latest
7+
github_path: docs/lib/content/commands/npm-access.md
8+
redirect_from:
9+
- /cli-commands/access
10+
- /cli-commands/npm-access
11+
- /cli-documentation/access
12+
- /cli-documentation/cli-commands/access
13+
- /cli-documentation/cli-commands/npm-access
14+
- /cli-documentation/commands/access
15+
- /cli-documentation/commands/npm-access
16+
- /cli-documentation/npm-access
17+
- /cli-documentation/v11/access
18+
- /cli-documentation/v11/cli-commands/access
19+
- /cli-documentation/v11/cli-commands/npm-access
20+
- /cli-documentation/v11/commands/access
21+
- /cli-documentation/v11/commands/npm-access
22+
- /cli-documentation/v11/npm-access
23+
- /cli/access
24+
- /cli/cli-commands/access
25+
- /cli/cli-commands/npm-access
26+
- /cli/commands/access
27+
- /cli/commands/npm-access
28+
- /cli/npm-access
29+
- /cli/v11/access
30+
- /cli/v11/cli-commands/access
31+
- /cli/v11/cli-commands/npm-access
32+
- /cli/v11/commands/access
33+
- /cli/v11/npm-access
34+
- /commands/access
35+
- /commands/npm-access
36+
---
37+
38+
### Synopsis
39+
40+
```bash
41+
npm access list packages [<user>|<scope>|<scope:team>] [<package>]
42+
npm access list collaborators [<package> [<user>]]
43+
npm access get status [<package>]
44+
npm access set status=public|private [<package>]
45+
npm access set mfa=none|publish|automation [<package>]
46+
npm access grant <read-only|read-write> <scope:team> [<package>]
47+
npm access revoke <scope:team> [<package>]
48+
```
49+
50+
Note: This command is unaware of workspaces.
51+
52+
### Description
53+
54+
Used to set access controls on private packages.
55+
56+
For all of the subcommands, `npm access` will perform actions on the packages in the current working directory if no package name is passed to the subcommand.
57+
58+
- public / restricted (deprecated): Set a package to be either publicly accessible or restricted.
59+
60+
- grant / revoke (deprecated): Add or remove the ability of users and teams to have read-only or read-write access to a package.
61+
62+
- 2fa-required / 2fa-not-required (deprecated): Configure whether a package requires that anyone publishing it have two-factor authentication enabled on their account.
63+
64+
- ls-packages (deprecated): Show all of the packages a user or a team is able to access, along with the access level, except for read-only public packages (it won't print the whole registry listing)
65+
66+
- ls-collaborators (deprecated): Show all of the access privileges for a package. Will only show permissions for packages to which you have at least read access. If `<user>` is passed in, the list is filtered only to teams _that_ user happens to belong to.
67+
68+
- edit (not implemented)
69+
70+
### Details
71+
72+
`npm access` always operates directly on the current registry, configurable from the command line using `--registry=<registry url>`.
73+
74+
Unscoped packages are _always public_.
75+
76+
Scoped packages _default to restricted_, but you can either publish them as public using `npm publish --access=public`, or set their access as public using `npm access public` after the initial publish.
77+
78+
You must have privileges to set the access of a package:
79+
80+
- You are an owner of an unscoped or scoped package.
81+
- You are a member of the team that owns a scope.
82+
- You have been given read-write privileges for a package, either as a member of a team or directly as an owner.
83+
84+
If you have two-factor authentication enabled then you'll be prompted to provide a second factor, or may use the `--otp=...` option to specify it on the command line.
85+
86+
If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use `--access=public`.
87+
88+
Management of teams and team memberships is done with the `npm team` command.
89+
90+
### Configuration
91+
92+
#### `json`
93+
94+
- Default: false
95+
- Type: Boolean
96+
97+
Whether or not to output JSON data, rather than the normal output.
98+
99+
- In `npm pkg set` it enables parsing set values with JSON.parse() before saving them to your `package.json`.
100+
101+
Not supported by all npm commands.
102+
103+
#### `otp`
104+
105+
- Default: null
106+
- Type: null or String
107+
108+
This is a one-time password from a two-factor authenticator. It's needed when publishing or changing package permissions with `npm access`.
109+
110+
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.
111+
112+
#### `registry`
113+
114+
- Default: "https://registry.npmjs.org/"
115+
- Type: URL
116+
117+
The base URL of the npm registry.
118+
119+
### See Also
120+
121+
- [`libnpmaccess`](https://npm.im/libnpmaccess)
122+
- [npm team](/cli/v11/commands/npm-team)
123+
- [npm publish](/cli/v11/commands/npm-publish)
124+
- [npm config](/cli/v11/commands/npm-config)
125+
- [npm registry](/cli/v11/using-npm/registry)
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: npm-adduser
3+
section: 1
4+
description: Add a registry user account
5+
github_repo: npm/cli
6+
github_branch: latest
7+
github_path: docs/lib/content/commands/npm-adduser.md
8+
redirect_from:
9+
- /cli-commands/adduser
10+
- /cli-commands/npm-adduser
11+
- /cli-documentation/adduser
12+
- /cli-documentation/cli-commands/adduser
13+
- /cli-documentation/cli-commands/npm-adduser
14+
- /cli-documentation/commands/adduser
15+
- /cli-documentation/commands/npm-adduser
16+
- /cli-documentation/npm-adduser
17+
- /cli-documentation/v11/adduser
18+
- /cli-documentation/v11/cli-commands/adduser
19+
- /cli-documentation/v11/cli-commands/npm-adduser
20+
- /cli-documentation/v11/commands/adduser
21+
- /cli-documentation/v11/commands/npm-adduser
22+
- /cli-documentation/v11/npm-adduser
23+
- /cli/adduser
24+
- /cli/cli-commands/adduser
25+
- /cli/cli-commands/npm-adduser
26+
- /cli/commands/adduser
27+
- /cli/commands/npm-adduser
28+
- /cli/npm-adduser
29+
- /cli/v11/adduser
30+
- /cli/v11/cli-commands/adduser
31+
- /cli/v11/cli-commands/npm-adduser
32+
- /cli/v11/commands/adduser
33+
- /cli/v11/npm-adduser
34+
- /commands/adduser
35+
- /commands/npm-adduser
36+
---
37+
38+
### Synopsis
39+
40+
```bash
41+
npm adduser
42+
43+
alias: add-user
44+
```
45+
46+
Note: This command is unaware of workspaces.
47+
48+
### Description
49+
50+
Create a new user in the specified registry, and save the credentials to the `.npmrc` file. If no registry is specified, the default registry will be used (see [`registry`](/cli/v11/using-npm/registry)).
51+
52+
When using `legacy` for your `auth-type`, the username, password, and email are read in from prompts.
53+
54+
### Configuration
55+
56+
#### `registry`
57+
58+
- Default: "https://registry.npmjs.org/"
59+
- Type: URL
60+
61+
The base URL of the npm registry.
62+
63+
#### `scope`
64+
65+
- Default: the scope of the current project, if any, or ""
66+
- Type: String
67+
68+
Associate an operation with a scope for a scoped registry.
69+
70+
Useful when logging in to or out of a private registry:
71+
72+
```
73+
# log in, linking the scope to the custom registry
74+
npm login --scope=@mycorp --registry=https://registry.mycorp.com
75+
76+
# log out, removing the link and the auth token
77+
npm logout --scope=@mycorp
78+
```
79+
80+
This will cause `@mycorp` to be mapped to the registry for future installation of packages specified according to the pattern `@mycorp/package`.
81+
82+
This will also cause `npm init` to create a scoped package.
83+
84+
```
85+
# accept all defaults, and create a package named "@foo/whatever",
86+
# instead of just named "whatever"
87+
npm init --scope=@foo --yes
88+
```
89+
90+
#### `auth-type`
91+
92+
- Default: "web"
93+
- Type: "legacy" or "web"
94+
95+
What authentication strategy to use with `login`. Note that if an `otp` config is given, this value will always be set to `legacy`.
96+
97+
### See Also
98+
99+
- [npm registry](/cli/v11/using-npm/registry)
100+
- [npm config](/cli/v11/commands/npm-config)
101+
- [npmrc](/cli/v11/configuring-npm/npmrc)
102+
- [npm owner](/cli/v11/commands/npm-owner)
103+
- [npm whoami](/cli/v11/commands/npm-whoami)
104+
- [npm token](/cli/v11/commands/npm-token)
105+
- [npm profile](/cli/v11/commands/npm-profile)

0 commit comments

Comments
 (0)