Schema reference (envsync.toml)
[envsync]
example = ".env.example" # target of sync-example, linted by default
[environments] # name = path or list of paths, relative to this file
dev = [".env.dev", "docker-compose.yml"] # later files override earlier ones
prod = ["k8s/configmap.yaml", "k8s/secret.yaml"]
[vars.DATABASE_URL]
type = "url"
required = true
secret = true
description = "Primary database"
File type is chosen by extension: .yml/.yaml is inspected (Kubernetes ConfigMap/Secret, compose services:, GitHub Actions env:), everything else is dotenv.
Variable keys
| Key | Meaning |
|---|---|
type |
One of str (default), int, float, bool, url, email, enum, duration, port, json, regex |
required |
true, false (default), or a list of environment names where it is required |
default |
Value assumed when unset; a required variable with a default is not reported missing. Must itself be valid |
secret |
Mask in diff, omit from messages, keep out of sync-example defaults |
deprecated |
true to warn when present; deprecated variables are never required and are skipped by sync-example, codegen |
renamed_to |
Name of the replacement variable (must exist in the schema); implies deprecated |
description |
Used by sync-example, doc |
choices |
List of allowed values, required for enum |
pattern |
Regular expression for regex, matched against the whole value |
schemes |
For url, allowed schemes |
min, max |
Bounds for int and float |
example |
Value written to the example file instead of the default |
Unknown keys are rejected.
Types
| Type | Accepts |
|---|---|
int |
-5, +7, 42 |
float |
finite numbers, 1.5, 1e3 |
bool |
true false 1 0 yes no on off y n t f, case-insensitive |
port |
integer 1-65535 |
url |
scheme://... with no whitespace and a valid port; sqlite:///x.db is accepted |
email |
local@domain.tld |
duration |
one or more <number><unit> parts: ms s m h d w, e.g. 500ms, 1h30m. A bare number is invalid |
json |
any valid JSON document |
enum |
exactly one of choices |
regex |
full match of pattern |
Presence rules
A variable counts as present when it is set and non-empty. Empty optional variables are treated as unset and not type-checked. Empty required variables report is empty. A value containing a GitHub expression (${{ ... }}) is accepted without type checking.