CLI Tools
bash
Intermediate
Environment Switcher Script
Switch between named environment profiles stored in ~/.envs/ and export to shell.
bash
#!/bin/bash
# Usage: source envswitch.sh staging
ENV=${1:-development}
FILE=~/.envs/$ENV.env
if [ ! -f "$FILE" ]; then
echo "Unknown environment: $ENV"
echo "Available: $(ls ~/.envs/ | sed s/.env//g)"
return 1
fi
set -a
source "$FILE"
set +a
echo "Loaded $ENV environment"
Prerequisites
- bash
Pro Tips
- → Use source (not bash) to export vars to the current shell.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- bash
- Level
- Intermediate
- Read time
- 2 min
- Published
- Sep 2026
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Rich Progress Bar Script
Display a beautiful progress bar in the terminal using Rich.
python
·
Beginner
Git Commit Message Enforcer
commit-msg hook that enforces Conventional Commits format.
bash
·
Intermediate
System Info Dashboard
Print a compact system summary: CPU, RAM, disk, OS and uptime in one script.
bash
·
Beginner