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

# env() and variables

> Use environment variables and config variables in clisma.hcl

## env()

Use `env("NAME")` to read environment variables:

```hcl theme={null}
env "local" {
  url = env("CLICKHOUSE_URL")

  migrations {
    dir = "migrations"
  }
}
```

## Variables

Define variables and reference them with `var.name`:

```hcl theme={null}
variable "ttl_days" {
  type = string
  default = "30"
}

env "local" {
  url = env("CLICKHOUSE_URL")

  migrations {
    dir = "migrations/${var.ttl_days}"
    vars = {
      ttl = var.ttl_days
    }
  }
}
```
