Skip to content

vivekjha1213/EnvSafe

Repository files navigation

EnvSafe: Secure Environment Variable Manager

Go Version Go Report Card GoDoc License: MIT Open Source PRs Welcome Build Status codecov Go Reference Made with Go GitHub issues GitHub stars GitHub forks

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.

Features

  • 🔐 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)

Installation

  1. Clone the Repository

    git clone https://github.com/vivekjha1213/EnvSafe.git
    cd EnvSafe
  2. Build the Project

    go build -o envsafe ./cmd/envsafe

    This command creates an executable named envsafe in the project directory.

Usage

Commands

  • set: Set a secret in the local store
  • get: Retrieve a secret from the local store
  • load-env: Load secrets from environment variables into the local store
  • export-env: Export secrets from the local store to environment variables

Flags

  • -f, --file: Path to the secrets store file (default is secrets.json)
  • -k, --key: Encryption key for securing secrets

Examples

  1. Set a Secret

    ./envsafe set <key> <value> --key=<encryption_key>

    Example:

    ./envsafe set my_secret_key my_secret_value --key=12345678901234567890123456789012
  2. Get a Secret

    ./envsafe get <key> --key=<encryption_key>

    Example:

    ./envsafe get my_secret_key --key=12345678901234567890123456789012
  3. Load Secrets from Environment Variables

    export MYSECRETKEY_my_secret_key=my_secret_value
    ./envsafe load-env MYSECRETKEY

    This command loads secrets with the prefix MYSECRETKEY from environment variables and saves them to secrets.json.

  4. Export Secrets to Environment Variables

    ./envsafe export-env MYSECRETKEY

    This command exports secrets from secrets.json to environment variables with the prefix MYSECRETKEY.

  5. Viewing Help Information

    ./envsafe --help
    ./envsafe set --help
    ./envsafe get --help
    ./envsafe load-env --help
    ./envsafe export-env --help

Development

To contribute to the project, follow these steps:

  1. Fork the Repository and create a new branch
  2. Make Your Changes and ensure they are well-tested
  3. Submit a Pull Request with a clear description of the changes

License

This project is licensed under the MIT License.

Contact

For questions, support, or to report issues, please open an issue on the GitHub repository or contact the author:


Go.Dev reference Go Report Card codecov

EnvSafe is built with Go and utilizes open-source Go packages to provide a professional-grade solution for secure environment variable management.

About

EnvSafe is a lightweight, open-source tool designed to securely manage environment variables. It offers functionalities to set, retrieve, load from, and export secrets using AES encryption, ensuring your sensitive data is handled securely and efficiently.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages