A simple command-line tool for managing environment variables in .env files. This tool provides an interactive CLI interface to create, read, update, and delete environment variables in your .env files.
- 🔄 Interactive CLI menu interface
- ⌨️ Tab completion for existing environment variables
- 🔍 View all environment variables in a formatted display
- ➕ Add new environment variables
- ✏️ Edit existing variables
- 🗑️ Delete variables with confirmation
- 🔄 Auto-saves changes to file
- ⚡ Keyboard shortcut (Ctrl+C) for quick exit
- 📁 Support for custom env file paths
- Clone the repository:
git clone https://github.com/RonLi-io/env-manager.git
cd env-manager- Make the script executable:
chmod +x env_manager.py- Dependencies: The script uses Python's built-in libraries, so no additional installation is required.
./env_manager.pyThis will manage variables in the default .env.example file in the current directory.
The tool provides flexibility in choosing which environment file to manage:
# Default usage (manages 'env-prod' in current directory)
./env_manager.py
# Using -f or --file to specify a different file
./env_manager.py -f .env.production
./env_manager.py --file /path/to/your/.env
# Examples
./env_manager.py -f .env.staging # Manage staging environment
./env_manager.py -f .env.local # Manage local environment
./env_manager.py -f configs/.env # Manage env file in different directoryIf the specified file doesn't exist, the tool will create it automatically when you add your first variable.
- List all variables
- Add new variable
- Edit variable
- Delete variable
- Exit
Ctrl+C: Exit the program at any timeTab: Auto-complete existing variable names when editing/deleting
- Python 3.6+
- readline (usually comes with Python, but might need installation on some systems)
sudo apt-get install libreadline-devsudo yum install readline-develbrew install readlineFeel free to open issues or submit pull requests if you have suggestions for improvements.