user Command - Medusa CLI Reference

Create a new admin user.

Terminal
npx medusa user --email <email> [--password <password>]

Options#

OptionDescriptionRequiredDefault

-e <email>, --email <email>

The user's email.

Yes

-

-p <password>, --password <password>

The user's password.

No

-

-i <id>, --id <id>

The user's ID.

No

An automatically generated ID is used.

--invite

Whether to create a user invite instead of directly creating a user. Learn more in the Create User Invite section.

No

false


Create User Invite with Medusa CLI#

The user command accepts the --invite option to create a user invite. The user must accept the invite before they can log into the Medusa Admin.

For example:

Terminal
npx medusa user --email user@example.com --invite

The command will create a user invite and output the invite token. You can then either:

  • Accept the invite in the Medusa Admin at the path /app/invite?token=<invite_token>
  • Accept the invite using the Accept Invite API route.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break