11cb0ef41Sopenharmony_ci---
21cb0ef41Sopenharmony_cititle: npm-team
31cb0ef41Sopenharmony_cisection: 1
41cb0ef41Sopenharmony_cidescription: Manage organization teams and team memberships
51cb0ef41Sopenharmony_ci---
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci### Synopsis
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci```bash
101cb0ef41Sopenharmony_cinpm team create <scope:team> [--otp <otpcode>]
111cb0ef41Sopenharmony_cinpm team destroy <scope:team> [--otp <otpcode>]
121cb0ef41Sopenharmony_cinpm team add <scope:team> <user> [--otp <otpcode>]
131cb0ef41Sopenharmony_cinpm team rm <scope:team> <user> [--otp <otpcode>]
141cb0ef41Sopenharmony_cinpm team ls <scope>|<scope:team>
151cb0ef41Sopenharmony_ci```
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciNote: This command is unaware of workspaces.
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ci### Description
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ciUsed to manage teams in organizations, and change team memberships. Does not
221cb0ef41Sopenharmony_cihandle permissions for packages.
231cb0ef41Sopenharmony_ci
241cb0ef41Sopenharmony_ciTeams must always be fully qualified with the organization/scope they belong to
251cb0ef41Sopenharmony_ciwhen operating on them, separated by a colon (`:`). That is, if you have a
261cb0ef41Sopenharmony_ci`newteam` team in an `org` organization, you must always refer to that team
271cb0ef41Sopenharmony_cias `@org:newteam` in these commands.
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ciIf you have two-factor authentication enabled in `auth-and-writes` mode, then
301cb0ef41Sopenharmony_ciyou can provide a code from your authenticator with `[--otp <otpcode>]`.
311cb0ef41Sopenharmony_ciIf you don't include this then you will be taken through a second factor flow based
321cb0ef41Sopenharmony_cion your `authtype`.
331cb0ef41Sopenharmony_ci
341cb0ef41Sopenharmony_ci* create / destroy:
351cb0ef41Sopenharmony_ci  Create a new team, or destroy an existing one. Note: You cannot remove the
361cb0ef41Sopenharmony_ci  `developers` team, [learn more.](https://docs.npmjs.com/about-developers-team)
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ci  Here's how to create a new team `newteam` under the `org` org:
391cb0ef41Sopenharmony_ci
401cb0ef41Sopenharmony_ci  ```bash
411cb0ef41Sopenharmony_ci  npm team create @org:newteam
421cb0ef41Sopenharmony_ci  ```
431cb0ef41Sopenharmony_ci
441cb0ef41Sopenharmony_ci  You should see a confirming message such as: `+@org:newteam` once the new
451cb0ef41Sopenharmony_ci  team has been created.
461cb0ef41Sopenharmony_ci
471cb0ef41Sopenharmony_ci* add:
481cb0ef41Sopenharmony_ci  Add a user to an existing team.
491cb0ef41Sopenharmony_ci
501cb0ef41Sopenharmony_ci  Adding a new user `username` to a team named `newteam` under the `org` org:
511cb0ef41Sopenharmony_ci
521cb0ef41Sopenharmony_ci  ```bash
531cb0ef41Sopenharmony_ci  npm team add @org:newteam username
541cb0ef41Sopenharmony_ci  ```
551cb0ef41Sopenharmony_ci
561cb0ef41Sopenharmony_ci  On success, you should see a message: `username added to @org:newteam`
571cb0ef41Sopenharmony_ci
581cb0ef41Sopenharmony_ci* rm:
591cb0ef41Sopenharmony_ci  Using `npm team rm` you can also remove users from a team they belong to.
601cb0ef41Sopenharmony_ci
611cb0ef41Sopenharmony_ci  Here's an example removing user `username` from `newteam` team
621cb0ef41Sopenharmony_ci  in `org` organization:
631cb0ef41Sopenharmony_ci
641cb0ef41Sopenharmony_ci  ```bash
651cb0ef41Sopenharmony_ci  npm team rm @org:newteam username
661cb0ef41Sopenharmony_ci  ```
671cb0ef41Sopenharmony_ci
681cb0ef41Sopenharmony_ci  Once the user is removed a confirmation message is displayed:
691cb0ef41Sopenharmony_ci  `username removed from @org:newteam`
701cb0ef41Sopenharmony_ci
711cb0ef41Sopenharmony_ci* ls:
721cb0ef41Sopenharmony_ci  If performed on an organization name, will return a list of existing teams
731cb0ef41Sopenharmony_ci  under that organization. If performed on a team, it will instead return a list
741cb0ef41Sopenharmony_ci  of all users belonging to that particular team.
751cb0ef41Sopenharmony_ci
761cb0ef41Sopenharmony_ci  Here's an example of how to list all teams from an org named `org`:
771cb0ef41Sopenharmony_ci
781cb0ef41Sopenharmony_ci  ```bash
791cb0ef41Sopenharmony_ci  npm team ls @org
801cb0ef41Sopenharmony_ci  ```
811cb0ef41Sopenharmony_ci
821cb0ef41Sopenharmony_ci  Example listing all members of a team named `newteam`:
831cb0ef41Sopenharmony_ci
841cb0ef41Sopenharmony_ci  ```bash
851cb0ef41Sopenharmony_ci  npm team ls @org:newteam
861cb0ef41Sopenharmony_ci  ```
871cb0ef41Sopenharmony_ci
881cb0ef41Sopenharmony_ci### Details
891cb0ef41Sopenharmony_ci
901cb0ef41Sopenharmony_ci`npm team` always operates directly on the current registry, configurable from
911cb0ef41Sopenharmony_cithe command line using `--registry=<registry url>`.
921cb0ef41Sopenharmony_ci
931cb0ef41Sopenharmony_ciYou must be a *team admin* to create teams and manage team membership, under
941cb0ef41Sopenharmony_cithe given organization. Listing teams and team memberships may be done by
951cb0ef41Sopenharmony_ciany member of the organization.
961cb0ef41Sopenharmony_ci
971cb0ef41Sopenharmony_ciOrganization creation and management of team admins and *organization* members
981cb0ef41Sopenharmony_ciis done through the website, not the npm CLI.
991cb0ef41Sopenharmony_ci
1001cb0ef41Sopenharmony_ciTo use teams to manage permissions on packages belonging to your organization,
1011cb0ef41Sopenharmony_ciuse the `npm access` command to grant or revoke the appropriate permissions.
1021cb0ef41Sopenharmony_ci
1031cb0ef41Sopenharmony_ci### Configuration
1041cb0ef41Sopenharmony_ci
1051cb0ef41Sopenharmony_ci#### `registry`
1061cb0ef41Sopenharmony_ci
1071cb0ef41Sopenharmony_ci* Default: "https://registry.npmjs.org/"
1081cb0ef41Sopenharmony_ci* Type: URL
1091cb0ef41Sopenharmony_ci
1101cb0ef41Sopenharmony_ciThe base URL of the npm registry.
1111cb0ef41Sopenharmony_ci
1121cb0ef41Sopenharmony_ci
1131cb0ef41Sopenharmony_ci
1141cb0ef41Sopenharmony_ci#### `otp`
1151cb0ef41Sopenharmony_ci
1161cb0ef41Sopenharmony_ci* Default: null
1171cb0ef41Sopenharmony_ci* Type: null or String
1181cb0ef41Sopenharmony_ci
1191cb0ef41Sopenharmony_ciThis is a one-time password from a two-factor authenticator. It's needed
1201cb0ef41Sopenharmony_ciwhen publishing or changing package permissions with `npm access`.
1211cb0ef41Sopenharmony_ci
1221cb0ef41Sopenharmony_ciIf not set, and a registry response fails with a challenge for a one-time
1231cb0ef41Sopenharmony_cipassword, npm will prompt on the command line for one.
1241cb0ef41Sopenharmony_ci
1251cb0ef41Sopenharmony_ci
1261cb0ef41Sopenharmony_ci
1271cb0ef41Sopenharmony_ci#### `parseable`
1281cb0ef41Sopenharmony_ci
1291cb0ef41Sopenharmony_ci* Default: false
1301cb0ef41Sopenharmony_ci* Type: Boolean
1311cb0ef41Sopenharmony_ci
1321cb0ef41Sopenharmony_ciOutput parseable results from commands that write to standard output. For
1331cb0ef41Sopenharmony_ci`npm search`, this will be tab-separated table format.
1341cb0ef41Sopenharmony_ci
1351cb0ef41Sopenharmony_ci
1361cb0ef41Sopenharmony_ci
1371cb0ef41Sopenharmony_ci#### `json`
1381cb0ef41Sopenharmony_ci
1391cb0ef41Sopenharmony_ci* Default: false
1401cb0ef41Sopenharmony_ci* Type: Boolean
1411cb0ef41Sopenharmony_ci
1421cb0ef41Sopenharmony_ciWhether or not to output JSON data, rather than the normal output.
1431cb0ef41Sopenharmony_ci
1441cb0ef41Sopenharmony_ci* In `npm pkg set` it enables parsing set values with JSON.parse() before
1451cb0ef41Sopenharmony_ci  saving them to your `package.json`.
1461cb0ef41Sopenharmony_ci
1471cb0ef41Sopenharmony_ciNot supported by all npm commands.
1481cb0ef41Sopenharmony_ci
1491cb0ef41Sopenharmony_ci
1501cb0ef41Sopenharmony_ci
1511cb0ef41Sopenharmony_ci### See Also
1521cb0ef41Sopenharmony_ci
1531cb0ef41Sopenharmony_ci* [npm access](/commands/npm-access)
1541cb0ef41Sopenharmony_ci* [npm config](/commands/npm-config)
1551cb0ef41Sopenharmony_ci* [npm registry](/using-npm/registry)
156