www/apps/resources/app/medusa-cli/commands/user/page.mdx
import { Table } from "docs-ui"
export const metadata = {
title: user Command - Medusa CLI Reference,
}
Create a new admin user.
npx medusa user --email <email> [--password <password>]
`-e <email>`, `--email <email>`
</Table.Cell>
<Table.Cell>
The user's email.
</Table.Cell>
<Table.Cell>
Yes
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`-p <password>`, `--password <password>`
</Table.Cell>
<Table.Cell>
The user's password.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
\-
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`-i <id>`, `--id <id>`
</Table.Cell>
<Table.Cell>
The user's ID.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
An automatically generated ID is used.
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`--invite`
</Table.Cell>
<Table.Cell>
Whether to create a user invite instead of directly creating a user. Learn more in the [Create User Invite](#create-user-invite-with-medusa-cli) section.
</Table.Cell>
<Table.Cell>
No
</Table.Cell>
<Table.Cell>
`false`
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>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:
npx medusa user --email [email protected] --invite
The command will create a user invite and output the invite token. You can then either:
/app/invite?token=<invite_token>