# l4 config

> Read and write the CLI's persistent defaults, and see which layer (flag, environment variable, file, built-in) is supplying each value.

Source: https://docs.levelfour.ai/cli/commands/config


`l4 config` reads and writes the CLI's persistent defaults, so you do not repeat the same flags on every command. `l4` keeps the config file in the platform-standard config directory (`~/.config/levelfour/` on Linux/macOS, `%APPDATA%\levelfour\` on Windows).

## Subcommands

| Command             | Purpose                                                    |
| ------------------- | ---------------------------------------------------------- |
| `list`              | Show all configuration values and where each one came from |
| `get <key>`         | Print one config value                                     |
| `set <key> <value>` | Set a config value                                         |

```bash
l4 config list
l4 config get default_provider
l4 config set default_provider aws
```

## Resolution order

`l4` resolves each settable value in this order. The first match wins:

1. Command-line flag (e.g. `--provider gcp`)
2. Environment variable (e.g. `LEVELFOUR_API`)
3. Config file (`l4 config set …`)
4. Built-in default

> **Warning**
>
> A flag or an environment variable outranks the config file, so a value you set with `l4 config set` can sit in the file and never be the one in use. An exported `LEVELFOUR_API` you have forgotten about sends every command to another host. `l4 config list` annotates each value with its source, so read that before you decide the file is wrong.

## Common keys

| Key                | Purpose                                                  |
| ------------------ | -------------------------------------------------------- |
| `default_provider` | Default `--provider` for `costs` and `recommendations`   |
| `api_base`         | Default API base URL (overrides built-in production URL) |

## Related

* [Authentication](/cli/authentication): how `l4` resolves credentials, and pointing at another API host with `--api` or `LEVELFOUR_API`
* [`l4 telemetry`](/cli/commands/telemetry): the opt-in flag stored alongside these settings
* [CLI overview](/cli#global-flags): the flags every command accepts
