Generated Env Files
Generated Env Files
CNOS is runtime-first, but many repos still rely on .env.local, .env.stage, or similar files.
Use generated env files as a bridge, not as the source of truth.
One-shot build
cnos build env --profile local --to .env.localcnos build env --profile stage --to .env.stagecnos build env --profile prod --to .env.prodcnos build env --profile local-domain --format docker-env --to .docker/runtime/current.envWatched dev loop
cnos dev env --profile local --to .env.local -- pnpm devPublic-only frontend artifacts
cnos build env --public --framework vite --profile local --to .env.localcnos build env --public --framework next --profile prod --to .env.productionRecommended policy
- keep
.cnosas the source of truth - keep generated
.env.*files gitignored - migrate app code toward direct CNOS reads over time
- keep secrets on runtime/vault flows instead of materializing them into env files by default
- use
docker-envwhen Docker or Docker Compose expects a runtime env file