## config get

Read and change CLI settings (config file, keys masked).

| Command                              | Summary                                                                     |
|--------------------------------------|-----------------------------------------------------------------------------|
| [`config get`](/content/docs/cli/commands/config#config-get/index.html)        | Print the value of a config key in effect                                   |
| [`config list`](/content/docs/cli/commands/config#config-list/index.html)      | Print the config file, keys masked                                         |
| [`config path`](/content/docs/cli/commands/config#config-path/index.html)      | Print the config file path                                                 |
| [`config set`](/content/docs/cli/commands/config#config-set/index.html)        | Set a config key                                                           |
| [`config unset`](/content/docs/cli/commands/config#config-unset/index.html)    | Remove a config key (back to its default)                                  |

Every command also takes the [global flags](/content/docs/cli/commands#global-flags/index.html).

## [config get](/content/docs/cli/commands/config#config-get/index.html)

Print the value of a config key in effect.

Prints the value the CLI will actually use, after flags and environment variables (so `base_url` is the default when nothing is set). `api_key` is always masked. With —json it also says where the value came from.

```shell
machinemail config get <key>
```

#### [Arguments](/content/docs/cli/commands/config#arguments/index.html)

| Field   | Description                                                |
|---------|------------------------------------------------------------|
| `<key>` | `string` Required                                          |
|         | `base_url`  `api_key`  `current_profile`  `update_check` |

#### [Examples](/content/docs/cli/commands/config#examples/index.html)

```shell
machinemail config get base_url
machinemail config get api_key --profile work
machinemail config get current_profile --json
```

## [config list](/content/docs/cli/commands/config#config-list/index.html)

Print the config file, keys masked.

Also: `machinemail config ls`, `machinemail config show`.

Every value stored in the config file as key=value lines, with API keys masked. Use `machinemail config get <key>` for the value in effect after flags and environment variables.

```shell
machinemail config list
```

#### [Examples](/content/docs/cli/commands/config#examples-1/index.html)

```shell
machinemail config list
machinemail config list --json
```

## [config path](/content/docs/cli/commands/config#config-path/index.html)

Print the config file path.

The config file is $XDG_CONFIG_HOME/machinemail/config.json (or ~/.config/machinemail/config.json), written with mode 0600. `MACHINEMAIL_CLI_CONFIG` points at another file.

```shell
machinemail config path
```

#### [Examples](/content/docs/cli/commands/config#examples-2/index.html)

```shell
machinemail config path
ls -l "$(machinemail config path)"
```

## [config set](/content/docs/cli/commands/config#config-set/index.html)

Set a config key.

Per-profile keys (`base_url`, `api_key`) go to the current profile, or the one named with —profile, which is created if needed. For `api_key` pass `-` to read it from stdin; `machinemail login` is better, since it checks the key first.

```shell
machinemail config set <key> <value>
```

#### [Arguments](/content/docs/cli/commands/config#arguments-1/index.html)

| Field   | Description                                                |
|---------|------------------------------------------------------------|
| `<key>` | `string` Required                                          |
|         | `base_url`  `api_key`  `current_profile`  `update_check` |
| `<value>` | `string` Required                                        |
|         | New value (`-` reads stdin)                                 |

#### [Examples](/content/docs/cli/commands/config#examples-3/index.html)

```shell
machinemail config set update_check true
machinemail config set current_profile work
printf %s "$KEY" | machinemail config set api_key - --profile ci
```

## [config unset](/content/docs/cli/commands/config#config-unset/index.html)

Remove a config key (back to its default).

```shell
machinemail config unset <key>
```

#### [Arguments](/content/docs/cli/commands/config#arguments-2/index.html)

#### [Examples](/content/docs/cli/commands/config#examples-4/index.html)

```shell
machinemail config unset api_key --profile work
machinemail config unset update_check
```
