Skip to content

AlextheYounga/enx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enx

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.

Features

  • Uses age X25519 keypairs for encryption.
  • Stores global config and keys under ~/.config/enx (or $XDG_CONFIG_HOME/enx).
  • Supports encrypting plaintext env files into .enx files.
  • Supports decrypting .enx files back to plaintext.
  • Supports Rails-style edit flow for encrypted files.
  • Supports read-only show flow for .enx in the current directory.

Install

From crates.io

cargo install enx

From this repository:

cargo install --git https://github.com/AlextheYounga/enx.git tuimux

Initialization

Run once:

enx init

This 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.

CLI Usage

Initialize keys/config:

enx init

Encrypt a file and delete plaintext input:

enx -e .env

Decrypt an encrypted file to plaintext output:

enx -d .enx

Edit an encrypted file (decrypt -> open editor -> re-encrypt):

enx .enx

Show .enx in current directory without writing changes back:

enx -s

Show help:

enx

File Mapping Rules

  • Encrypt .env -> .enx
  • Encrypt something.ext -> something.enx
  • Decrypt .enx -> .env
  • Decrypt something.enx -> something

Encryption/decryption will fail if output file already exists.

Notes

  • enx -e deletes the plaintext input after successful encryption.
  • enx -s is read-only with respect to the encrypted file.
  • All commands use the global keypair/config under ~/.config/enx.

About

Rails-credentials-style encrypted env workflow for Unix projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages