# Users Commands

> See [Users module docs](../../modules/users) for permissions and data model.

# Users Commands

See [Users module docs](../../modules/users) for permissions and data model.

### `soat get-current-user`

Get the current authenticated user

- Method: `GET`
- Path: `/api/v1/users/me`

#### Usage

```bash
soat get-current-user
```

#### Options

This command has no options.

### `soat list-users`

List all users

- Method: `GET`
- Path: `/api/v1/users`

#### Usage

```bash
soat list-users
```

#### Options

##### `--limit`

Maximum number of results to return

- Source: `query`
- Required: no
- Type: `integer`
- Default: `50`

##### `--offset`

Number of results to skip

- Source: `query`
- Required: no
- Type: `integer`
- Default: `0`

### `soat create-user`

Create a user

- Method: `POST`
- Path: `/api/v1/users`

#### Usage

```bash
soat create-user --username <string> --password <string>
```

#### Options

##### `--username`

—

- Source: `body`
- Required: yes
- Type: `string`
- Example: `johndoe`

##### `--password`

—

- Source: `body`
- Required: yes
- Type: `string`
- Example: `supersecret`

##### `--role`

—

- Source: `body`
- Required: no
- Type: `enum("admin", "user")`
- Example: `user`

### `soat get-user`

Get a user by ID

- Method: `GET`
- Path: `/api/v1/users/{user_id}`

#### Usage

```bash
soat get-user --user-id <string>
```

#### Options

##### `--user-id`

User ID

- Source: `path`
- Required: yes
- Type: `string`
- Example: `user_V1StGXR8Z5jdHi6B`

### `soat delete-user`

Delete a user by ID

- Method: `DELETE`
- Path: `/api/v1/users/{user_id}`

#### Usage

```bash
soat delete-user --user-id <string>
```

#### Options

##### `--user-id`

User ID

- Source: `path`
- Required: yes
- Type: `string`
- Example: `user_V1StGXR8Z5jdHi6B`

### `soat bootstrap-user`

Create the first admin user

- Method: `POST`
- Path: `/api/v1/users/bootstrap`

#### Usage

```bash
soat bootstrap-user --username <string> --password <string>
```

#### Options

##### `--username`

—

- Source: `body`
- Required: yes
- Type: `string`
- Example: `admin`

##### `--password`

—

- Source: `body`
- Required: yes
- Type: `string`
- Example: `supersecret`

### `soat login-user`

Login user

- Method: `POST`
- Path: `/api/v1/users/login`

#### Usage

```bash
soat login-user --username <string> --password <string>
```

#### Options

##### `--username`

—

- Source: `body`
- Required: yes
- Type: `string`
- Example: `admin`

##### `--password`

—

- Source: `body`
- Required: yes
- Type: `string`
- Example: `supersecret`

### `soat attach-user-policies`

Attach policies to a user

- Method: `PUT`
- Path: `/api/v1/users/{user_id}/policies`

#### Usage

```bash
soat attach-user-policies --user-id <string> --policy-ids <array<string>>
```

#### Options

##### `--user-id`

User public ID (user_ prefix)

- Source: `path`
- Required: yes
- Type: `string`
- Example: `user_V1StGXR8Z5jdHi6B`

##### `--policy-ids`

List of policy public IDs to attach (replaces existing)

- Source: `body`
- Required: yes
- Type: `array<string>`
- Example: `["pol_V1StGXR8Z5jdHi6B"]`
