> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mergeguide.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration keys

> Reference for the keys in your MergeGuide configuration file.

MergeGuide reads project configuration from a YAML file. This page is the reference
for the user-facing keys. For a task-oriented walkthrough, see
[Configuration file](/configuration/mergeguide-yaml).

## Where config is loaded from

MergeGuide looks for a config file in this order and uses the first it finds:

1. `.mergeguide.yaml`
2. `.mergeguide/config.yaml`
3. `~/.mergeguide/config.yaml` (user-global)

## Keys written by `init`

`mergeguide init` writes this starting config:

```yaml .mergeguide/config.yaml theme={null}
version: "1.0"
fail_mode: closed
enforcement_mode: graduated
policies:
  use_defaults: true
  custom_dir: .mergeguide/policies
```

| Key                     | Type   | Default                | Description                                                          |
| ----------------------- | ------ | ---------------------- | -------------------------------------------------------------------- |
| `version`               | string | `"1.0"`                | Config schema version.                                               |
| `fail_mode`             | string | `closed`               | Whether a failed check blocks. `closed` blocks on blocking findings. |
| `enforcement_mode`      | string | `graduated`            | Applies enforcement progressively across your workflow layers.       |
| `policies.use_defaults` | bool   | `true`                 | Run MergeGuide's default policy set.                                 |
| `policies.custom_dir`   | string | `.mergeguide/policies` | Directory holding your custom policy files.                          |

## Keys managed with `config set`

These keys tune what's reported and what blocks. You can edit them in the file
directly or with `mergeguide config set`:

| Key                 | Type   | Values                     | Description                               |
| ------------------- | ------ | -------------------------- | ----------------------------------------- |
| `severity`          | choice | `error`, `warning`, `info` | Minimum severity to report.               |
| `fail_on_warning`   | bool   | `true` / `false`           | Exit with an error if warnings are found. |
| `exclude_patterns`  | list   | glob patterns              | Paths to exclude from checks.             |
| `enabled_policies`  | list   | policy IDs                 | Policies to explicitly enable.            |
| `disabled_policies` | list   | policy IDs                 | Policies to explicitly disable.           |

```bash theme={null}
mergeguide config set severity warning
mergeguide config set fail_on_warning true
```

```yaml .mergeguide/config.yaml theme={null}
severity: warning
fail_on_warning: true
exclude_patterns:
  - "**/vendor/**"
  - "**/generated/**"
enabled_policies:
  - owasp-top-10
disabled_policies:
  - example-noisy-rule
```

## Manage config from the CLI

| Command                               | What it does                |
| ------------------------------------- | --------------------------- |
| `mergeguide config list`              | List current configuration. |
| `mergeguide config get <key>`         | Get a value.                |
| `mergeguide config set <key> <value>` | Set a value.                |
| `mergeguide config unset <key>`       | Remove a value.             |
| `mergeguide config path`              | Show the config file path.  |

<Note>
  This reference covers the user-facing keys MergeGuide reads from your config file.
  If you find a key in an example that isn't listed here, confirm it against
  `mergeguide config list` before relying on it.
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Configuration file" icon="file-code" href="/configuration/mergeguide-yaml">
    A walkthrough of the config file.
  </Card>

  <Card title="Thresholds" icon="gauge" href="/configuration/thresholds">
    Tune what blocks a commit or merge.
  </Card>
</CardGroup>
