codekingpro/portable-devtools
114k
1---
2title: npm-team
3section: 1
4description: Manage organization teams and team memberships
5---
6
7### Synopsis
8
9```bash
10npm team create <scope:team> [--otp <otpcode>]
11npm team destroy <scope:team> [--otp <otpcode>]
12npm team add <scope:team> <user> [--otp <otpcode>]
13npm team rm <scope:team> <user> [--otp <otpcode>]
14npm team ls <scope>|<scope:team>
15```
16
17Note: This command is unaware of workspaces.
18
19### Description
20
21Used to manage teams in organizations, and change team memberships.
22Does not handle permissions for packages.
23
24Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (`:`).
25That is, if you have a `newteam` team in an `org` organization, you must always refer to that team as `@org:newteam` in these commands.
26
27If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp <otpcode>]`.
28If you don't include this then you will be taken through a second factor flow based on your `authtype`.
29
30* create / destroy:
31 Create a new team, or destroy an existing one.
32 Note: You cannot remove the `developers` team, [learn more.](https://docs.npmjs.com/about-developers-team)
33
34 Here's how to create a new team `newteam` under the `org` org:
35
36 ```bash
37 npm team create @org:newteam
38 ```
39
40 You should see a confirming message such as: `+@org:newteam` once the new team has been created.
41
42* add:
43 Add a user to an existing team.
44
45 Adding a new user `username` to a team named `newteam` under the `org` org:
46
47 ```bash
48 npm team add @org:newteam username
49 ```
50
51 On success, you should see a message: `username added to @org:newteam`
52
53* rm:
54 Using `npm team rm` you can also remove users from a team they belong to.
55
56 Here's an example removing user `username` from `newteam` team in `org` organization:
57
58 ```bash
59 npm team rm @org:newteam username
60 ```
61
62 Once the user is removed a confirmation message is displayed:
63 `username removed from @org:newteam`
64
65* ls:
66 If performed on an organization name, will return a list of existing teams under that organization.
67 If performed on a team, it will instead return a list of all users belonging to that particular team.
68
69 Here's an example of how to list all teams from an org named `org`:
70
71 ```bash
72 npm team ls @org
73 ```
74
75 Example listing all members of a team named `newteam`:
76
77 ```bash
78 npm team ls @org:newteam
79 ```
80
81### Details
82
83`npm team` always operates directly on the current registry, configurable from the command line using `--registry=<registry url>`.
84
85You must be a *team admin* to create teams and manage team membership, under the given organization.
86Listing teams and team memberships may be done by any member of the organization.
87
88Organization creation and management of team admins and *organization* members is done through the website, not the npm CLI.
89
90To use teams to manage permissions on packages belonging to your organization, use the `npm access` command to grant or revoke the appropriate permissions.
91
92### Configuration
93
94#### `registry`
95
96* Default: "https://registry.npmjs.org/"
97* Type: URL
98
99The base URL of the npm registry.
100
101
102
103#### `otp`
104
105* Default: null
106* Type: null or String
107
108This is a one-time password from a two-factor authenticator. It's needed
109when publishing or changing package permissions with `npm access`.
110
111If not set, and a registry response fails with a challenge for a one-time
112password, npm will prompt on the command line for one.
113
114
115
116#### `parseable`
117
118* Default: false
119* Type: Boolean
120
121Output parseable results from commands that write to standard output. For
122`npm search`, this will be tab-separated table format.
123
124
125
126#### `json`
127
128* Default: false
129* Type: Boolean
130
131Whether or not to output JSON data, rather than the normal output.
132
133* In `npm pkg set` it enables parsing set values with JSON.parse() before
134 saving them to your `package.json`.
135
136Not supported by all npm commands.
137
138
139
140### See Also
141
142* [npm access](/commands/npm-access)
143* [npm config](/commands/npm-config)
144* [npm registry](/using-npm/registry)
145 