Rails-credentials-style encrypted env workflow for Unix projects.
enx uses age keys stored under your user config directory and gives you a simple CLI to initialize keys, encrypt/decrypt files, and edit encrypted env files.
- Uses
ageX25519 keypairs for encryption. - Stores global config and keys under
~/.config/enx(or$XDG_CONFIG_HOME/enx). - Supports encrypting plaintext env files into
.enxfiles. - Supports decrypting
.enxfiles back to plaintext. - Supports Rails-style edit flow for encrypted files.
- Supports read-only show flow for
.enxin the current directory.
From crates.io
cargo install enxFrom this repository:
cargo install --git https://github.com/AlextheYounga/enx.git tuimuxRun once:
enx initThis creates:
~/.config/enx/keys.txt(private key)~/.config/enx/keys.pub(public key)~/.config/enx/enx.toml(global config)
Example enx.toml:
editor = "nvim"editor defaults to $EDITOR, or vi if $EDITOR is not set.
Initialize keys/config:
enx initEncrypt a file and delete plaintext input:
enx -e .envDecrypt an encrypted file to plaintext output:
enx -d .enxEdit an encrypted file (decrypt -> open editor -> re-encrypt):
enx .enxShow .enx in current directory without writing changes back:
enx -sShow help:
enx- Encrypt
.env->.enx - Encrypt
something.ext->something.enx - Decrypt
.enx->.env - Decrypt
something.enx->something
Encryption/decryption will fail if output file already exists.
enx -edeletes the plaintext input after successful encryption.enx -sis read-only with respect to the encrypted file.- All commands use the global keypair/config under
~/.config/enx.