A simple Python package to manage environment variables in your .env file with command-line interface.
pipx install mydotenvpip install mydotenvgit clone https://github.com/banddude/mydotenv.git
cd mydotenv
pip install -e .- Print a variable's value:
mydotenv API_KEY- Add or update a variable:
mydotenv NEW_KEY=value
mydotenv "KEY_WITH_SPACES=value with spaces"- Delete a variable:
mydotenv delete VARIABLE_NAME- View all variables:
mydotenvYou can set a custom command name to use instead of mydotenv:
mydotenv --set-command dotmanNow you can use either mydotenv or dotman to run commands:
dotman NEW_KEY=value
dotman delete NEW_KEYWhen you set a new command name, it replaces any previous custom command name.
- Manage environment variables from the command line
- Set custom command names for easier use
- Preserves comments and formatting in
.envfile - Handles values with spaces and special characters
- Works from any directory
- Creates and manages
.envfile in your current directory
- python-dotenv >= 1.0.0
- The package stores its configuration in
~/.config/mydotenv/config.env - Custom command names are managed through symlinks in
~/.local/bin
MIT License - feel free to use this package in your projects!