---
title: "config"
description: "Read and change CLI settings (config file, keys masked). The `machinemail config` commands: arguments, flags, examples and the API routes they call."
canonical: "https://machinemail.dev/docs/cli/commands/config"
---

# config

> Read and change CLI settings (config file, keys masked). The `machinemail config` commands: arguments, flags, examples and the API routes they call.

Source: https://machinemail.dev/docs/cli/commands/config

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

| Command                         | Summary                                   |
| ------------------------------- | ----------------------------------------- |
| [`config get`](#config-get)     | Print the value of a config key in effect |
| [`config list`](#config-list)   | Print the config file, keys masked        |
| [`config path`](#config-path)   | Print the config file path                |
| [`config set`](#config-set)     | Set a config key                          |
| [`config unset`](#config-unset) | 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

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.

```bash
machinemail config get <key>
```

#### Arguments

| Field | Type | | Description |
| --- | --- | --- | --- |
| `<key>` | `string` | required | base_url \| api_key \| current_profile \| update_check |

#### Examples

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

## config list

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.

```bash
machinemail config list
```

#### Examples

```bash
machinemail config list
machinemail config list --json
```

## config path

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.

```bash
machinemail config path
```

#### Examples

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

## config set

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.

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

#### Arguments

| Field | Type | | Description |
| --- | --- | --- | --- |
| `<key>` | `string` | required | base_url \| api_key \| current_profile \| update_check |
| `<value>` | `string` | required | New value (- reads stdin) |

#### Examples

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

## config unset

Remove a config key (back to its default).

```bash
machinemail config unset <key>
```

#### Arguments

| Field | Type | | Description |
| --- | --- | --- | --- |
| `<key>` | `string` | required | base_url \| api_key \| current_profile \| update_check |

#### Examples

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