Env Generation
miso env generates .env files per scope — from a keys-only template to a fully populated, validated production env:
-g/--generate— write.env.generatedwith every variable declared for that scope, values blank.-p/--populate— fill values from each entry’s baseline file (itspath).-o/--override— layer each entry’s declaredoverridefile on top (override wins).-x/--example— write.env.examplewith a type-valid fake for every variable (a valid port, URL, UUID, …). It passesmiso envvalidation, so it doubles as a committable example and as a way to rule env out as the cause of a crash. Prompts before overwriting an existing.env.example.
Combine them for a full production build:
miso env -g # keys-only template(s)
miso env -g -p # filled from local baselines
miso env -g -p -o # baselines + overrides, validated
miso env -x # .env.example with fake-but-valid valuesFiles follow the scope, not the declaration site: scope: global writes <root>/.env.generated; scope: web writes apps/web/.env.generated even if declared in the root miso.json. With -p/-o, the resolved values are validated against your declared types and required keys — a missing required value fails the command and writes nothing.
Last updated on