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