Users CLI command reference

Manage users of your project

npx sanity users --help

Commands

invite

USAGE
  $ sanity users invite [EMAIL] [-p <id>] [--role <value>]

ARGUMENTS
  [EMAIL]  Email address to invite

FLAGS
      --role=<value>  Role to invite the user as

OVERRIDE FLAGS
  -p, --project-id=<id>  Project ID to invite user to (overrides CLI configuration)

DESCRIPTION
  Invite a new user to the project

EXAMPLES
  Invite a new user to the project (prompt for details)

    $ sanity users invite

  Send a new user invite to the email "pippi@sanity.io", prompt for role

    $ sanity users invite pippi@sanity.io

  Send a new user invite to the email "pippi@sanity.io", as administrator

    $ sanity users invite pippi@sanity.io --role administrator

  Invite a user to a specific project

    $ sanity users invite pippi@sanity.io --project-id abc123

list

USAGE
  $ sanity users list [-p <id>] [--invitations] [--order <value>] [--robots] [--sort <value>]

FLAGS
      --invitations    Includes or excludes pending invitations
      --order=<value>  Sort output ascending/descending
      --robots         Includes or excludes robots (token users)
      --sort=<value>   Sort users by specified column

OVERRIDE FLAGS
  -p, --project-id=<id>  Project ID to list users for (overrides CLI configuration)

DESCRIPTION
  List project members

EXAMPLES
  List all users of the project

    $ sanity users list

  List all users of the project, but exclude pending invitations and robots

    $ sanity users list --no-invitations --no-robots

  List all users, sorted by role

    $ sanity users list --sort role

  List users for a specific project

    $ sanity users list --project-id abc123

Was this page helpful?

sanity.ioAll Systems Operational© Sanity 2026
Change site theme