# User Commands

With the users commands you can manage the users in the panel, from the command line.


---

### **Create a user**

```bash
mlcli users create <username> <email>
```

*The cli then prompts you to input a password for the user, in a secure manner.*

> **Note:** To grant permissions to a user via the cli, just add `--permissions <permissions>`

**Arguments:** ( [Arguments](/doc/arguments-j2OjZ768Ik) )

* `<username>` → The username for the user
* `<email>`→ The email address for the user

**Options:** ( [Options](/doc/options-dOVO4phHzg) )

* `--permissions` , `-p` → The permissions of the user, *(in ", split with commas; eg.* `"admin.users.read,admin.api.*,admin.users.update"`*)\**

**Flags:** ( [Flags](/doc/flags-Dqltdafq32) )

* `--admin` ,`-a` → Grants the user all permissions, option `--permissions` will be ignored

#### Example Usage:

```bash
mlcli users create johndoe john@example.com -p "admin.api,admin.users.*,admin.system.diagnose"
```


---

### Update a user

```bash
mlcli users update <id>
```

*The cli will prompt you if you want to change the password for the user, and if so, provide you with a secure way of inputting the password.*

**Arguments:** ( [Arguments](/doc/arguments-j2OjZ768Ik) )

* `<id>`→ The id of the user which should get updated

**Options:** ( [Options](/doc/options-dOVO4phHzg) )

* `--username`, `-u` → The new username for the user, if not specified, the username remains unchanged
* `--email`, `-e` → The new email address for the user, if not specified, the email address remains unchanged
* `--permissions`, `-p` → The new permissions for the user, if not specified, the permissions remain unchanged

#### Example usage:

```bash
mlcli users update 1 -u johndoe1 -e johndoe@example.net -p "*"
```


---

### **List users**

```bash
mlcli users list
```

> **Note:** To get listed more than 10 users, add `-l <pagesize>` to the command above, to change page, add `-p <page>`

**Options:** ( [Options](/doc/options-dOVO4phHzg) )

* `--pagesize` , `-l` → The number of users which will get listed, must be between 1 and 100, *default: 10*
* `—-page` , `-p` → The which will get displayed

#### Example Usage:

```bash
mlcli users list -p 2 -l 15
```


---

### Delete a user

```bash
mlcli users delete <id>
```

> **Note:** This can **NOT** be undone

**Arguments:** ( [Arguments](/doc/arguments-j2OjZ768Ik) )

* `<id>`→ The id of the user which should get deleted