|
1
|
--- |
|
2
|
sidebar_label: "user" |
|
3
|
sidebar_position: 4 |
|
4
|
--- |
|
5
|
|
|
6
|
import { Table } from "docs-ui" |
|
7
|
|
|
8
|
export const metadata = { |
|
9
|
title: `user Command - Medusa CLI Reference`, |
|
10
|
} |
|
11
|
|
|
12
|
# {metadata.title} |
|
13
|
|
|
14
|
Create a new admin user. |
|
15
|
|
|
16
|
```bash npx2yarn |
|
17
|
npx medusa user --email <email> [--password <password>] |
|
18
|
``` |
|
19
|
|
|
20
|
## Options |
|
21
|
|
|
22
|
<Table> |
|
23
|
<Table.Header> |
|
24
|
<Table.Row> |
|
25
|
<Table.HeaderCell> |
|
26
|
Option |
|
27
|
</Table.HeaderCell> |
|
28
|
<Table.HeaderCell> |
|
29
|
Description |
|
30
|
</Table.HeaderCell> |
|
31
|
<Table.HeaderCell> |
|
32
|
Required |
|
33
|
</Table.HeaderCell> |
|
34
|
<Table.HeaderCell> |
|
35
|
Default |
|
36
|
</Table.HeaderCell> |
|
37
|
</Table.Row> |
|
38
|
</Table.Header> |
|
39
|
<Table.Body> |
|
40
|
<Table.Row> |
|
41
|
<Table.Cell> |
|
42
|
|
|
43
|
`-e <email>`, `--email <email>` |
|
44
|
|
|
45
|
</Table.Cell> |
|
46
|
<Table.Cell> |
|
47
|
|
|
48
|
The user's email. |
|
49
|
|
|
50
|
</Table.Cell> |
|
51
|
<Table.Cell> |
|
52
|
|
|
53
|
Yes |
|
54
|
|
|
55
|
</Table.Cell> |
|
56
|
<Table.Cell> |
|
57
|
|
|
58
|
\- |
|
59
|
|
|
60
|
</Table.Cell> |
|
61
|
</Table.Row> |
|
62
|
<Table.Row> |
|
63
|
<Table.Cell> |
|
64
|
|
|
65
|
`-p <password>`, `--password <password>` |
|
66
|
|
|
67
|
</Table.Cell> |
|
68
|
<Table.Cell> |
|
69
|
|
|
70
|
The user's password. |
|
71
|
|
|
72
|
</Table.Cell> |
|
73
|
<Table.Cell> |
|
74
|
|
|
75
|
No |
|
76
|
|
|
77
|
</Table.Cell> |
|
78
|
<Table.Cell> |
|
79
|
|
|
80
|
\- |
|
81
|
|
|
82
|
</Table.Cell> |
|
83
|
</Table.Row> |
|
84
|
<Table.Row> |
|
85
|
<Table.Cell> |
|
86
|
|
|
87
|
`-i <id>`, `--id <id>` |
|
88
|
|
|
89
|
</Table.Cell> |
|
90
|
<Table.Cell> |
|
91
|
|
|
92
|
The user's ID. |
|
93
|
|
|
94
|
</Table.Cell> |
|
95
|
<Table.Cell> |
|
96
|
|
|
97
|
No |
|
98
|
|
|
99
|
</Table.Cell> |
|
100
|
<Table.Cell> |
|
101
|
|
|
102
|
An automatically generated ID is used. |
|
103
|
|
|
104
|
</Table.Cell> |
|
105
|
</Table.Row> |
|
106
|
<Table.Row> |
|
107
|
<Table.Cell> |
|
108
|
|
|
109
|
`--invite` |
|
110
|
|
|
111
|
</Table.Cell> |
|
112
|
<Table.Cell> |
|
113
|
|
|
114
|
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. |
|
115
|
|
|
116
|
</Table.Cell> |
|
117
|
<Table.Cell> |
|
118
|
|
|
119
|
No |
|
120
|
|
|
121
|
</Table.Cell> |
|
122
|
<Table.Cell> |
|
123
|
|
|
124
|
`false` |
|
125
|
|
|
126
|
</Table.Cell> |
|
127
|
</Table.Row> |
|
128
|
</Table.Body> |
|
129
|
</Table> |
|
130
|
|
|
131
|
--- |
|
132
|
|
|
133
|
## Create User Invite with Medusa CLI |
|
134
|
|
|
135
|
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. |
|
136
|
|
|
137
|
For example: |
|
138
|
|
|
139
|
```bash npx2yarn |
|
140
|
npx medusa user --email user@example.com --invite |
|
141
|
``` |
|
142
|
|
|
143
|
The command will create a user invite and output the invite token. You can then either: |
|
144
|
|
|
145
|
- Accept the invite in the Medusa Admin at the path `/app/invite?token=<invite_token>` |
|
146
|
- Accept the invite using the [Accept Invite API route](!api!/admin/invites/accept-invite). |