Skip to content

Commit 23dac2f

Browse files
ruyadornoisaacs
authored andcommitted
docs: npm team revamp
- Added more examples - Removed references to removed `npm team edit` subcommand - Grammar and spell check PR-URL: #2557 Credit: @ruyadorno Close: #2557 Reviewed-by: @wraithgar, @nlf
1 parent 500a639 commit 23dac2f

File tree

1 file changed

+56
-12
lines changed

1 file changed

+56
-12
lines changed

docs/content/commands/npm-team.md

+56-12
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ npm team add <scope:team> <user>
1414
npm team rm <scope:team> <user>
1515

1616
npm team ls <scope>|<scope:team>
17-
18-
npm team edit <scope:team>
1917
```
2018

2119
### Description
@@ -24,31 +22,76 @@ Used to manage teams in organizations, and change team memberships. Does not
2422
handle permissions for packages.
2523

2624
Teams must always be fully qualified with the organization/scope they belong to
27-
when operating on them, separated by a colon (`:`). That is, if you have a `wombats` team in a `wisdom` organization, you must always refer to that team as `wisdom:wombats` in these commands.
25+
when operating on them, separated by a colon (`:`). That is, if you have a
26+
`newteam` team in an `org` organization, you must always refer to that team
27+
as `@org:newteam` in these commands.
2828

29-
If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp <otpcode>]`. If you don't include this then you will be prompted.
29+
If you have two-factor authentication enabled in `auth-and-writes` mode, then
30+
you can provide a code from your authenticator with `[--otp <otpcode>]`.
31+
If you don't include this then you will be prompted.
3032

3133
* create / destroy:
32-
Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
33-
* add / rm:
34-
Add a user to an existing team, or remove a user from a team they belong to.
34+
Create a new team, or destroy an existing one. Note: You cannot remove the
35+
`developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
36+
37+
Here's how to create a new team `newteam` under the `org` org:
38+
39+
```bash
40+
npm team create @org:newteam
41+
```
42+
43+
You should see a confirming message such as: `+@org:newteam` once the new
44+
team has been created.
45+
46+
* add:
47+
Add a user to an existing team.
48+
49+
Adding a new user `username` to a team named `newteam` under the `org` org:
50+
51+
```bash
52+
npm team add @org:newteam username
53+
```
54+
55+
On success, you should see a message: `username added to @org:newteam`
56+
57+
* rm:
58+
Using `npm team rm` you can also remove users from a team they belong to.
59+
60+
Here's an example removing user `username` from `newteam` team
61+
in `org` organization:
62+
63+
```bash
64+
npm team rm @org:newteam username
65+
```
66+
67+
Once the user is removed a confirmation message is displayed:
68+
`username removed from @org:newteam`
3569

3670
* ls:
3771
If performed on an organization name, will return a list of existing teams
3872
under that organization. If performed on a team, it will instead return a list
3973
of all users belonging to that particular team.
4074

41-
* edit:
42-
Edit a current team.
75+
Here's an example of how to list all teams from an org named `org`:
76+
77+
```bash
78+
npm team ls @org
79+
```
80+
81+
Example listing all members of a team named `newteam`:
82+
83+
```bash
84+
npm team ls @org:newteam
85+
```
4386

4487
### Details
4588

4689
`npm team` always operates directly on the current registry, configurable from
4790
the command line using `--registry=<registry url>`.
4891

49-
In order to create teams and manage team membership, you must be a *team admin*
50-
under the given organization. Listing teams and team memberships may be done by
51-
any member of the organizations.
92+
You must be a *team admin* to create teams and manage team membership, under
93+
the given organization. Listing teams and team memberships may be done by
94+
any member of the organization.
5295

5396
Organization creation and management of team admins and *organization* members
5497
is done through the website, not the npm CLI.
@@ -59,4 +102,5 @@ use the `npm access` command to grant or revoke the appropriate permissions.
59102
### See Also
60103

61104
* [npm access](/commands/npm-access)
105+
* [npm config](/commands/npm-config)
62106
* [npm registry](/using-npm/registry)

0 commit comments

Comments
 (0)