envm is a lightweight bash function for managing Python virtual environments in a single centralized location (~/.venvs). It allows you to create, activate, list, delete, and add info to virtual environments easily from the terminal.
- Create virtual environments with optional descriptions.
- Activate environments in the current shell (auto-deactivates previous venv).
- List all environments with their info.
- Delete single, multiple, or all environments.
- Update information/description for any environment.
- No external dependencies besides Python 3 and bash.
- Make sure you have Python 3 installed.
- Ensure you have a
.venvsfolder in your home directory:
mkdir -p ~/.venvs- Add the
envm()function to your~/.bashrc:
# Add this at the end of your ~/.bashrc
envm() {
# (Paste the full envm() function here)
}or
# Add this at the end of your ~/.bashrc
source PATH_TO_ENVM.BASH_FILE- Reload your shell:
source ~/.bashrcenvm c myenv "Optional description for this environment"myenv– name of the venv"Optional description..."– free text info stored in.info
envm lExample output:
NAME INFO
------------------------------------------------------------
myenv Python project for testing
data-science Data analysis project
envm a myenv- Automatically deactivates any currently active venv.
- Prompts confirmation:
✅ Activated 'myenv'.
# Delete a single environment
envm d myenv
# Delete multiple environments
envm d myenv data-science
# Delete all environments
envm d all- Confirmation will be printed for each deleted environment.
envm i myenv "Updated description for this environment"envmDisplays:
Usage: envm [a|c|l|d|i] ...
a name Activate venv
c name info Create venv with optional info
l List all venvs
d name.../all Delete one, multiple, or all venvs
i name info Update info for venv
- All virtual environments are stored in
~/.venvs/. - No “active” tracking file; activation affects only the current shell session.
- Compatible with Bash (
[[ ... ]]) and requires Python 3.