Skip to content

Initial release#1

Merged
jongpie merged 38 commits into
mainfrom
feature/initial-release
Jun 1, 2026
Merged

Initial release#1
jongpie merged 38 commits into
mainfrom
feature/initial-release

Conversation

@jongpie
Copy link
Copy Markdown
Owner

@jongpie jongpie commented Mar 10, 2026

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.

jongpie and others added 18 commits November 5, 2025 13:01
… be disabled with via config 'should-log-env', tweaked some of the stdout formatting
Also removed some old sample .env files
…b/dependabot.yml to auto-bump prod dependencies

Also cleaned up .gitignore - there were a bunch of files being ignored that currently won't be in this repo, so I've simplified it
…v file + controlling if (potentially sensitive) env variable values are printed out

This also includes updating code to consistently use the ux import for logging, and making loadingMessage.ts to centralize printing out env vars so everything is consistent for dotenv command and prerun hook

This also ALSO includes adding in new test files for dotenv.ts command and some of the shared helper files
…st tests within VS Code

I typically don't commit anything in .vscode, but I want to make sure I can easily run tests via an extension, without having to reconfigure this on different machines
…onally) overridden if they're defined in the specified .env file
@jongpie jongpie requested a review from jamessimone March 10, 2026 20:37
jongpie and others added 11 commits March 10, 2026 16:58
…eviously worked locally but not in GitHub Actions)
… issues with the shouldLog value being used for the hook version of the plugin, and updated the tests accordingly. Suppressed a few ts-jest warnings that are only applicable to tests and don't affect how the production-level plugin actually works, which were polluting the console on subsequent test runs
…grading to TypeScript 6.0 (https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/#deprecated:---baseurl) - ESLint hasn't been updated to support the new version of TypeScript yet, so we have to wait for upstream support there prior to completely porting over
jongpie added 5 commits March 24, 2026 14:15
…st directory structure to match the src directory structure
…ncorrectly) passed as the value for --output-file
…t are used as replacements in sfdx-project.json
… to ensure one-liners still are wrapped in {} curly braces
Comment thread src/commands/dotenv/inspect.ts
Comment thread src/shared/environment.ts Outdated
jongpie added 4 commits June 1, 2026 11:50
- Added some scripts to generate oclif.manifest.json at packaging time so installs skip
  runtime command discovery (`prepack` now runs `oclif manifest`;
  `postpack` cleanup of the file already existed). Adds `oclif`
  to devDependencies and gitignores the generated artifact.
- Removed unused `messages/**/*` and `npm-shrinkwrap.json` from the `files` array in package.json
- Added a .prettierignore file to skip lib/, coverage/, oclif.manifest.json, and some IDE-only directories
- Started ignoring `coverage/**` in eslint.config.js j- there's no need to run lint here, and the files in there cause lint warnings on generated coverage HTML
- Remove Contributing.md / CODE_OF_CONDUCT.md from build.yml's  paths-ignore (those files do not exist) and add .prettierignore  to the list
- `README.md`: updated content to rename `sf dotenv` to `sf dotenv inspect` and document the new `sf dotenv export` command
- `publish.yml`: bump Node 18 -> 20 to match engines and build.yml
  - Also added `id-token: write` permission for `npm publish`,
  - And also added a step that fails the job if the pushed tag doesn't match the version number in `package.json`
@jongpie jongpie merged commit 7ecd734 into main Jun 1, 2026
1 check passed
@jongpie jongpie deleted the feature/initial-release branch June 1, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants