secureenv-cli v1.0.0
SecureEnv CLI
SecureEnv CLI is a command-line tool designed to securely manage environment variables across different environments. It offers features for encrypting, decrypting, and managing environment variables, ensuring sensitive data is protected and environment-specific.
Features
- Switch Environment: Easily switch between different environment files (e.g., 
.env.development,.env.production). - Encrypt: Securely encrypt the currently active environment variables.
 - Decrypt: Decrypt environment variables from the currently active environment file.
 - Set: Add new environment variables to your 
.envfile. - Get: Retrieve the value of specific environment variables.
 
Installation
Install globally using npm:
npm install -g secureenv-cliUsage Flow
1. Switch Environment
Before encrypting or decrypting, ensure that you switch to the correct environment. This command updates the active environment and prepares it for encryption or decryption.
secureenv-cli switch <env>- Example:
secureenv-cli switch development 
This sets the active environment to development, so any subsequent encryption or decryption will apply to .env.development.
2. Encrypt Environment Variables
Encrypts the currently active environment file, such as .env.development, and creates an encrypted file named .env.development.enc.
secureenv-cli encrypt3. Decrypt Environment Variables
Decrypts the environment file based on the active environment and restores the .env.<environment> file.
secureenv-cli decrypt4. Set Environment Variable
Adds a new environment variable to the active .env file.
secureenv-cli set <key> <value>- Example:
secureenv-cli set API_KEY "newapikey123" 
5. Get Environment Variable
Retrieves the value of a specified environment variable from the active .env file.
secureenv-cli get <key>- Example:
secureenv-cli get API_KEY 
Configuration
The following configurations are defined in config.js:
- SUPPORTED_ENVS: List of supported environments (e.g., 
['development', 'production', 'staging']). - DEFAULT_ENV_FILE: Default environment file (e.g., 
.env). - ENCRYPTED_ENV_FILE_EXT: File extension for encrypted environment files (e.g., 
.enc). 
License
This project is licensed under the MIT License.
1 year ago