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