EnvSafe is a powerful command-line tool designed to securely manage environment variables. It offers robust functionality for setting, retrieving, exporting, and loading environment variables with built-in encryption support.
- 🔐 Encrypt and decrypt environment variables
- 💾 Store variables in a local encrypted file
- 🚀 Automatically load variables into the shell on startup
- 🌍 Support for multiple environments (e.g., dev, staging, prod)
-
Clone the Repository
git clone https://github.com/vivekjha1213/EnvSafe.git cd EnvSafe -
Build the Project
go build -o envsafe ./cmd/envsafe
This command creates an executable named
envsafein the project directory.
set: Set a secret in the local storeget: Retrieve a secret from the local storeload-env: Load secrets from environment variables into the local storeexport-env: Export secrets from the local store to environment variables
-f,--file: Path to the secrets store file (default issecrets.json)-k,--key: Encryption key for securing secrets
-
Set a Secret
./envsafe set <key> <value> --key=<encryption_key>
Example:
./envsafe set my_secret_key my_secret_value --key=12345678901234567890123456789012 -
Get a Secret
./envsafe get <key> --key=<encryption_key>
Example:
./envsafe get my_secret_key --key=12345678901234567890123456789012
-
Load Secrets from Environment Variables
export MYSECRETKEY_my_secret_key=my_secret_value ./envsafe load-env MYSECRETKEYThis command loads secrets with the prefix
MYSECRETKEYfrom environment variables and saves them tosecrets.json. -
Export Secrets to Environment Variables
./envsafe export-env MYSECRETKEY
This command exports secrets from
secrets.jsonto environment variables with the prefixMYSECRETKEY. -
Viewing Help Information
./envsafe --help ./envsafe set --help ./envsafe get --help ./envsafe load-env --help ./envsafe export-env --help
To contribute to the project, follow these steps:
- Fork the Repository and create a new branch
- Make Your Changes and ensure they are well-tested
- Submit a Pull Request with a clear description of the changes
This project is licensed under the MIT License.
For questions, support, or to report issues, please open an issue on the GitHub repository or contact the author:
- Vivek Kumar Jha: GitHub Profile