Skip to content

Releases: jongpie/sf-dotenv-cli-plugin

v1.0.0 - Initial release

01 Jun 16:48
7ecd734

Choose a tag to compare

This is the first release of a new sf CLI plugin for loading .env files when using any sf CLI command

Highlights of features:

  • Automatic loading - A prerun hook loads a .env file (default: .env in the current directory) before every sf command. Values from the file override existing env vars of the same name; others are left unchanged.
  • Per-command file - Use --env / -e with any command to load a specific file (e.g. sf project deploy start --env .env.prod).
  • Config - sf config set should-log-env false disables prerun logging of variable names. Optional env vars: SF_DOTENV_DISABLED, SF_DOTENV_FILE.
  • Includes two dotenv commands:
    1. sf dotenv inspect - Loads a given .env file and prints the loaded variable names; pass --show-values to also print values (with a security warning).
    2. sf dotenv export - Reads replaceWithEnv entries from sfdx-project.json and writes any missing keys to a .env file, defaulting any value already present in the shell's environment. Use --output-file / -o to target a non-default file.