envfetch
A macOS command-line tool that keeps environment variables in an encrypted local vault and activates them with Touch ID.
envfetch is a native macOS command-line tool, written in Swift. It stores profiles of environment variables in an encrypted local vault and activates them into the current shell with Touch ID or the password. It works in zsh, bash and fish, and it has an interactive terminal interface.
- Platform
- macOS 13 or later, on a Mac with a Secure Enclave
- Language
- Swift
- Shells
- zsh, bash and fish
- Release
- v1.1.0, June 4, 2026
git clone https://github.com/aravhawk/envfetch.git cd envfetch make install
Install. make install builds the release binary, code-signs it and copies it to /usr/local/bin/envfetch. No Apple Developer account is needed.
eval "$(command envfetch init zsh)"
Shell setup. One line in ~/.zshrc. There is a line for bash and one for fish.
envfetch profile create work envfetch add work OPENAI_API_KEY
A profile. Adding a variable prompts for its value with echo disabled.
envfetch activate work
Activate. The profile’s variables are exported into the current shell. Activating more than one profile stacks their variables.
envfetch run work -- printenv OPENAI_API_KEY
One command. Runs a single command with the variables injected, without changing the current shell.
envfetch deactivate
Deactivate. ENVFETCH_ACTIVE tracks every key exported in the session, so this clears them all.
The vault. Profiles of environment variables are stored in ~/.envfetch/vault.enc. The vault directory is 0700, and encrypted data and key material are written 0600.
The key. Encryption uses an ephemeral P-256 key agreement plus HKDF plus AES-GCM. The private key lives in the Secure Enclave.
Unlocking. Touch ID or the password decrypts the vault and is asked for before it is changed. SSH and remote sessions are blocked, because the tool expects local authentication.
The shell. envfetch activate prints shell statements, and a small wrapper function evaluates them into the current shell: export for zsh and bash, set -gx for fish.
- Mutations are protected by an advisory lock to avoid concurrent write races.
- Interactive secret entry disables terminal echo, in the commands and in the interface.
- If vault.enc is corrupted or the original key material is lost, the vault cannot be recovered.
- envfetch update rebuilds the latest tagged release from source, signs it locally and replaces the binary in place. The vault is left untouched.
From the README’s security notes.
Run envfetch with no arguments and it opens a list of profiles in the terminal. These are its keys.
- Up, Down
- Move
- Enter
- Activate the selected profile
- Tab
- Open the profile’s variables
- Space
- In a profile, toggle a variable
- a, d, r
- Add, delete or rename a profile
- q
- Quit
