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

# Configuration

> Config file support for Replay — environment defaults, profiles, and presets.

# Configuration

Use a `replay.yaml` config file to set default configuration, define environment profiles, and create reusable presets.

## Config File Location

Replay looks for a config file in the current working directory. It checks these names in order:

1. `replay.yaml`
2. `replay.yml`
3. `.replay.yaml`
4. `.replay.yml`

You can also specify a custom path with `--config`:

```bash theme={null}
replay run workflow.yaml --config config/staging.yaml
```

## Config File Structure

```yaml theme={null}
version: "1"
config:
  http:
    base_url: http://localhost:3000
    headers:
      Accept: application/json
  postgres:
    dsn: postgres://postgres:password@localhost:5433/postgres
  redis:
    addr: localhost:6379
  vars:
    region: us-east-1
    environment: dev
  validate:
    - name: API_URL
      required: true

profiles:
  staging:
    config:
      http:
        base_url: https://staging.example.com
      postgres:
        dsn: postgres://deploy:pass@staging-db:5432/stagingdb

  production:
    config:
      http:
        base_url: https://api.example.com

presets:
  auth-test:
    config:
      vars:
        test_user: qa@example.com
        test_pass: "{{ TEST_PASSWORD }}"
```

## Config Sections

| Section    | Description                                                             |
| ---------- | ----------------------------------------------------------------------- |
| `config`   | Default configuration — merged with workflow-level config               |
| `profiles` | Named environment configurations, activated via `--profile`             |
| `presets`  | Named configuration bundles, activated via `vars.presets` in a workflow |

## Merge Order

When running a workflow, config values are merged in this order (later overrides earlier):

1. Config file default (`config` section)
2. Selected profile (`profiles.<name>.config`)
3. Presets listed in `vars.presets`
4. Workflow file's own `config` section

## Environment Variable Interpolation

Config values support `{{ VAR }}` template syntax:

```yaml theme={null}
config:
  postgres:
    dsn: postgres://{{ POSTGRES_USER }}:{{ POSTGRES_PASSWORD }}@localhost:5433/mydb
```

Environment variables are loaded into the global scope at startup.

## What's Next?

* Learn about [profiles and presets](/replay/configuration/profiles-and-presets)
* Check [CI/CD integration](/replay/guides/ci-cd-integration)
