Skip to content

Env Inheritance

Env Inheritance keeps your .env files DRY. Instead of copy-pasting CLIENT_VERSION = 2.1.0 across dev.env, staging.env, and prod.env, define it once in base.env and extend. For more advanced cases, .profile files compose multiple envs into a single selectable profile.

envs/base.env
CLIENT_VERSION = 2.1.0
TIMEOUT = 30000
LOG_LEVEL = info
envs/dev.env
@extends base.env
BASE_URL = https://api.dev.example.com
API_TOKEN = dev-token
LOG_LEVEL = debug # override base.env
envs/prod.env
@extends base.env
BASE_URL = https://api.prod.example.com
TIMEOUT = 15000 # override base.env

Runtime resolution: child keys override parent keys. LOG_LEVEL in dev.env is debug, inherited everywhere else as info.

Multiple @extends chain in order. Later extends win:

envs/dev.env
@extends base.env
@extends defaults.env
BASE_URL = https://api.dev.example.com

Resolution (highest-priority last):

  1. base.env
  2. defaults.env (overrides base.env)
  3. dev.env (overrides both)

When inheritance isn’t enough — you need region + role + tenant overlays — a .profile file stacks envs:

envs/profiles/dev-mobile-acme.profile
@env envs/base.env
@env envs/dev.env
@env envs/mobile-overrides.env
@env envs/tenant-acme.env

Select dev-mobile-acme from the env dropdown; all four files merge with last-wins ordering.

See the .profile reference for syntax details.

Hover the env pill in the header — the tooltip shows every resolved key with its source file. You always know which env contributed which value.

dev.env (extends base.env)
─────────────────────────
CLIENT_VERSION = 2.1.0 (base.env)
TIMEOUT = 30000 (base.env)
LOG_LEVEL = debug (dev.env)
BASE_URL = https://… (dev.env)
API_TOKEN = dev-token (dev.env)

Settings → Envs panel shows the inheritance tree for your workspace:

  • Broken @extends pointing to a missing file
  • Circular extends chains
  • Keys defined in multiple extended envs (conflict warnings)
CapabilityFreePro
Editor highlights @extends / .profile
Runtime inheritance resolution
.profile files selectable
Envs Manager diagnostics