dotenv-tool
is a dotnet tool which reads key-value pairs from .env
files and sets them as environment variables.
dotenv-tool
can be installed as a dotnet tool. When installed, a dotenv
command will be added to the path.
dotnet tool install -g dotenv-tool
Command | Description |
---|---|
dotenv |
Looks for a .env file in the current directory and loads the values in the current process. |
dotenv --file=.env.staging |
Loads environment variables from the specified file |
dotenv --target=Machine |
Applies environment variables at the Machine level |
--target
: sets the target for the variables. Either Process (default), Machine, or User--dry-run
: displays the variables that would be loaded, but does not apply them--verbose
: displays information to the stdout as variables are loaded
dotnet tool uninstall -g dotenv-tool