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

# happy config

Config-as-code via happyuptime.yml.

# happy config

Manage your monitors, status pages, and alert configuration as a single YAML file. Drop it in your repo, version it, deploy with `happy config push`.

```bash
happy config init                # scaffold happyuptime.yml from current state
happy config pull > current.yml  # write current state to stdout / file
happy config push happyuptime.yml --dry-run  # preview diff
happy config push happyuptime.yml            # apply
happy config validate happyuptime.yml        # syntax + schema check
```

See [config-as-code guide](/cli/config-as-code) for full schema + recipes.

## init

```bash
happy config init
# Wrote happyuptime.yml with 12 monitors, 2 status pages, 3 alert channels
```

## pull / push

```bash
# Capture remote state to a file
happy config pull > happyuptime.yml

# Apply local file to remote
happy config push happyuptime.yml --dry-run    # preview only
happy config push happyuptime.yml              # actually apply
```

`--dry-run` shows a colored diff: green = create, yellow = update, red = delete.

## validate

```bash
happy config validate happyuptime.yml
# Errors are reported with line numbers
```

Use in CI before merging YAML changes.

## Env var substitution

YAML values can interpolate env vars:

```yaml
monitors:
  - name: ${SERVICE_NAME} API
    url: ${SERVICE_URL}
```

Env vars come from your shell. Useful for keeping secrets out of the YAML file.