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