-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Description
Hey!
Thanks for this awesome lib!
It would be nice if dotenv-cli
could read variables from multiple .env
files. There is a common approach to use .env
and .env.local
, and maybe .env.<environment>
(.env.production
, .env.development
, etc.) schema.
Here are the examples:
- https://symfony.com/doc/current/configuration.html#overriding-environment-values-via-env-local (Symfony)
- https://nextjs.org/docs/basic-features/environment-variables#default-environment-variables (Next.js)
- https://create-react-app.dev/docs/adding-custom-environment-variables/#what-other-env-files-can-be-used (Create React App)
It's a common and nice practice since you can use common defaults in an .env
file and then override them in a machine-specific .env.local
. Usually you commit .env
to a git repository and do not commit .env.local
(secrets go there).
Currently we can use -e envfile
many times, but it would be nice to have, for example, a special argument to activate this schema:
dotenv --cascade -- <command with arguments>
# or different argument name of course
brunowego
Metadata
Metadata
Assignees
Labels
No labels