Skip to content

Support .env, .env.local, .env.<environment> practice #37

@plashenkov

Description

@plashenkov

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions