https://github.com/bernardoamorimalvarenga/envforge
https://github.com/bernardoamorimalvarenga/envforge
automation backup cli developer-tools development-enviroment devops git linux python sync
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bernardoamorimalvarenga/envforge
- Owner: bernardoamorimalvarenga
- License: mit
- Created: 2025-05-24T02:16:43.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-02T15:05:26.000Z (about 1 year ago)
- Last Synced: 2026-01-09T10:17:42.326Z (5 months ago)
- Topics: automation, backup, cli, developer-tools, development-enviroment, devops, git, linux, python, sync
- Language: Python
- Homepage:
- Size: 248 KB
- Stars: 30
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ฅ EnvForge
**Forge, sync and restore complete development environments in minutes**




---
## ๐ฏ **What is it?**
EnvForge is a CLI tool that solves one of developers' biggest problems: **reconfiguring development environments from scratch**.
Instead of spending days installing packages, setting up dotfiles and extensions every time you:
- ๐ป Get a new laptop
- ๐ Format your system
- ๐ฅ Need to standardize your team
- ๐ Want to sync home/work setups
**You simply restore everything automatically with EnvForge!**
---
## ๐ **EnvForge vs Other Tools**
| | EnvForge | Git/GitHub | Docker | Dotfiles Repos |
|---|---|---|---|---|
| **What it manages** | ๐ฅ๏ธ **Complete environment** | ๐ Source code | ๐ฆ Isolated containers | ๐ Config files only |
| **Installs packages** | โ
271 APT packages | โ | โ | โ |
| **System configuration** | โ
Dotfiles + extensions | โ | โ | โ
Configs only |
| **Synchronization** | โ
Bidirectional Git | โ
Code only | โ | โ
Configs only |
| **Use case** | ๐ ๏ธ Complete personal setup | ๐ Code projects | ๐ App deployment | โ๏ธ Basic configs |
### **Practical Example:**
**โ Current Situation (2 days of work):**
```bash
# New/reformatted laptop:
sudo apt update && sudo apt install git curl vim... # 271 packages manually
code --install-extension ms-python.python... # 15+ VS Code extensions
cp dotfiles/.bashrc ~/.bashrc # Configure terminal
git config --global user.name... # Git configs
# ... hundreds of manual steps
```
**โ
With EnvForge (30 minutes):**
```bash
pip install envforge
envforge restore "my-complete-environment"
# โ Go grab a coffee - everything automated!
```
---
## ๐ **Installation**
### **Method 1: Direct Installation (Recommended)**
```bash
# Install via PyPI
pip install envforge
```
### **Method 2: Manual Installation**
```bash
# Clone the repository
git clone https://github.com/bernardoamorimalvarenga/envforge.git
cd envforge
# Create virtual environment
python -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -e .
# Test installation
envforge --help
```
### **System Requirements:**
- ๐ง **Linux** (Ubuntu 20.04+, Debian 10+, Arch, Fedora)
- ๐ **Python 3.8+**
- ๐ **sudo** (for package installation)
- ๐ฆ **git** (for synchronization)
---
## ๐ **Complete Usage Guide**
### **1. Initial Setup**
```bash
# Initialize EnvForge
envforge init
# โ
Output:
# ๐ฅ EnvForge initialized successfully!
# Config stored in: /home/user/.envforge
```
### **2. Capture Your Current Environment**
```bash
# Capture everything installed and configured
envforge capture "my-setup-$(date +%Y%m%d)"
# โ
Example output:
# ๐ฅ Capturing environment: my-setup-20241201
# โ Detecting system configuration...
#
# โโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโ
# โ Component โ Count โ
# โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
# โ APT Packages โ 271 โ
# โ Snap Packages โ 26 โ
# โ Flatpak Packages โ 3 โ
# โ PIP Packages โ 45 โ
# โ Dotfiles โ 8 โ
# โ VS Code Extensions โ 23 โ
# โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโ
# โ Environment 'my-setup-20241201' captured successfully!
```
### **3. List Saved Environments**
```bash
# List all captured environments
envforge list
# โ
Example output:
# โโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโ
# โ Name โ Created โ File โ
# โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
# โ my-setup-20241201 โ 2024-12-01 14:30โ my-setup-20241201.json โ
# โ work-environment โ 2024-11-28 09:15โ work-environment.json โ
# โ complete-setup โ 2024-11-25 16:45โ complete-setup.json โ
# โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
### **4. View Environment Details**
```bash
# See what a specific environment contains
envforge show "my-setup-20241201"
# โ
Example output:
# ๐ Environment Details: my-setup-20241201
#
# โโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# โ Property โ Value โ
# โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
# โ Os โ Linux โ
# โ Kernel โ 5.15.0-91-generic โ
# โ Architecture โ x86_64 โ
# โ Python Version โ 3.12.3 โ
# โ Shell โ /bin/bash โ
# โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
#
# โโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโ
# โ Type โ Count โ
# โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
# โ APT โ 271 โ
# โ SNAP โ 26 โ
# โ FLATPAK โ 3 โ
# โ PIP โ 45 โ
# โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโ
```
### **5. Restore an Environment**
#### **Safe Preview (Dry Run):**
```bash
# See what will be done WITHOUT applying changes
envforge restore "my-setup-20241201" --dry-run
# โ
Example output:
# ๐ DRY RUN MODE - No changes will be made
# ๐ฆ Restoring packages...
# Would install 45 new APT packages
# Would install: git vim curl nodejs python3-pip code...
# ๐ Would restore 8 dotfiles
# ๐ Would install 12 new VS Code extensions
# โ Dry run completed successfully!
```
#### **Actual Restoration:**
```bash
# Restore the environment (WILL INSTALL PACKAGES)
envforge restore "my-setup-20241201"
# โ
Interactive process:
# ๐ฅ Restoring environment: my-setup-20241201
#
# โโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโ
# โ Type โ Count โ
# โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
# โ APT โ 45 โ
# โ SNAP โ 8 โ
# โ PIP โ 12 โ
# โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโ
#
# โ ๏ธ This will install 65 packages and may modify your system.
# Do you want to continue? [y/N]: y
#
# ๐ฆ Installing APT packages...
# โ APT packages installed successfully
# ๐ Restoring dotfiles...
# Backed up existing .bashrc to .bashrc.envforge-backup
# โ Restored .bashrc
# โ Restored .vimrc
# ๐ Installing VS Code extensions...
# โ VS Code extensions installed successfully
# โ Environment restored successfully!
```
---
## ๐ **Git Synchronization (Multi-machine)**
### **Initial Setup (Once)**
```bash
# Configure synchronization with private repository
envforge sync setup git@github.com:your-user/envforge-private.git
# โ
Output:
# ๐ง Setting up git sync with git@github.com:your-user/envforge-private.git
#
# โญโ Sync Ready โโฎ
# โ Git sync setup complete! โ
# โ โ
# โ Repository: git@github.com:your-user/envforge-private.git โ
# โ Branch: main โ
# โ โ
# โ Use 'envforge sync push' to upload environments โ
# โ Use 'envforge sync pull' to download environments โ
# โฐโโโโโโโโโโโโโโโฏ
```
### **Pushing Environments**
```bash
# Send all environments to repository
envforge sync push
# Send only a specific environment
envforge sync push -e "my-setup-20241201"
# Send multiple environments
envforge sync push -e "environment1" -e "environment2"
# โ
Example output:
# ๐ค Pushing specific environments: my-setup-20241201
# โ Successfully pushed 1 specific environments
```
### **Downloading Environments**
```bash
# Download environments from repository
envforge sync pull
# โ
Example output:
# ๐ฅ Pulling environments from remote...
# โ Imported work-environment
# โ Imported home-setup
# โ Successfully imported 2 environments
```
### **Synchronization Status**
```bash
# View sync status
envforge sync status
# โ
Example output:
# โโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# โ Property โ Value โ
# โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
# โ Status โ โ Enabled โ
# โ Remote URL โ git@github.com:your-user/envforge-private.git โ
# โ Branch โ main โ
# โ Uncommitted Changes โ No โ
# โ Last Commit โ abc123 - Sync 2 environments โ
# โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
---
## ๐ผ **Practical Use Cases**
### **๐ Case 1: New Laptop**
```bash
# On old machine:
envforge capture "my-complete-setup"
envforge sync push
# On new machine:
pip install envforge
envforge init
envforge sync setup git@github.com:your-user/envforge-private.git
envforge sync pull
envforge restore "my-complete-setup"
# โ 30 minutes later: identical environment!
```
### **๐ฅ Case 2: Team Onboarding**
```bash
# Company setup (done once by tech lead):
envforge capture "company-dev-env-2024"
envforge sync push
# New developer:
envforge sync pull
envforge restore "company-dev-env-2024"
# ๐ Standardized environment automatically!
```
### **๐ Case 3: Home/Work Synchronization**
```bash
# At work:
envforge capture "work-setup"
envforge sync push
# At home:
envforge sync pull
envforge restore "work-setup"
# ๐ Same environment at home!
```
### **๐ Case 4: Backup/Disaster Recovery**
```bash
# Regular backup:
envforge capture "backup-$(date +%Y%m%d)"
envforge sync push
# After problem/reformatting:
envforge sync pull
envforge list # View available backups
envforge restore "backup-20241201"
# ๐ก๏ธ Environment restored!
```
---
## ๐ **Available Commands**
### **Basic Commands:**
```bash
envforge init # Initialize EnvForge
envforge capture "name" # Capture current environment
envforge list # List saved environments
envforge show "name" # Show environment details
envforge restore "name" # Restore environment
envforge delete "name" # Delete environment
envforge status # Current system status
```
### **Sync Commands:**
```bash
envforge sync setup # Configure Git synchronization
envforge sync push # Send all environments
envforge sync push -e "name" # Send specific environment
envforge sync pull # Download environments from repository
envforge sync status # Synchronization status
```
### **Utility Commands:**
```bash
envforge export "name" file.json # Export to file
envforge import-env file.json # Import from file
envforge diff "env1" "env2" # Compare environments
envforge clean # Clean old backups
```
### **Useful Options:**
```bash
envforge restore "name" --dry-run # Preview without applying changes
envforge restore "name" --force # Skip confirmations
envforge delete "name" --force # Delete without confirmation
```
---
## ๐ฏ **What Gets Captured**
### **๐ฆ System Packages:**
- **APT packages** (manually installed only)
- **Snap packages**
- **Flatpak packages**
- **PIP packages** (global)
### **โ๏ธ Configurations:**
- **Important dotfiles**: `.bashrc`, `.bash_profile`, `.zshrc`, `.profile`
- **Tool configs**: `.vimrc`, `.gitconfig`
- **SSH config**: `.ssh/config` (optional, disabled by default)
### **๐ Extensions and Tools:**
- **VS Code**: All installed extensions
- **System info**: OS, kernel, architecture, Python version
### **Example Snapshot (JSON):**
```json
{
"metadata": {
"name": "my-setup-20241201",
"created_at": "2024-12-01T14:30:00",
"version": "0.1.0"
},
"system_info": {
"os": "Linux",
"kernel": "5.15.0-91-generic",
"architecture": "x86_64",
"python_version": "3.12.3"
},
"packages": {
"apt": ["git", "vim", "curl", "nodejs", "python3-pip"],
"snap": ["code", "discord", "telegram-desktop"],
"pip": ["requests", "flask", "django"]
},
"dotfiles": {
".bashrc": "# .bashrc content...",
".vimrc": "# Vim configurations..."
},
"vscode_extensions": [
"ms-python.python",
"ms-vscode.vscode-json"
]
}
```
---
## ๐ **Security**
### **โ
Secure Settings:**
- **SSH keys** are not captured by default
- **Automatic backups** of existing files before replacement
- **Dry-run mode** for safe previews
- **Confirmations** before important changes
- **Private repositories** recommended for sync
### **โ ๏ธ Important Considerations:**
- **Use private repositories** for sensitive data
- **Review snapshots** before sharing
- **Dotfiles may contain personal information**
- **Always test with --dry-run** first
### **๐ก๏ธ Best Practices:**
```bash
# โ
Use private repository
envforge sync setup git@github.com:your-user/envforge-PRIVATE.git
# โ
Always preview first
envforge restore "environment" --dry-run
# โ
Manual backup before major changes
cp ~/.bashrc ~/.bashrc.backup-$(date +%s)
# โ
Review what will be installed
envforge show "environment"
```
---
## ๐ **Performance**
### **Typical Times:**
- **Capture**: ~30 seconds (271 packages + configs)
- **Restore APT**: ~15 minutes (271 packages)
- **Restore Snap**: ~5 minutes (26 packages)
- **Dotfiles**: ~1 second
- **VS Code extensions**: ~2 minutes
### **Sizes:**
- **Snapshot JSON**: ~16KB per environment
- **Sync repository**: ~1MB (10 environments)
---
## ๐ **Troubleshooting**
### **Common Issues:**
#### **"Permission denied" during restore:**
```bash
# Make sure you have sudo
sudo echo "test"
# Execute with confirmation
envforge restore "environment" --force
```
#### **"Git sync failed":**
```bash
# Check if repository is private and you have access
git clone git@github.com:your-user/envforge-private.git
# Reconfigure if necessary
envforge sync setup git@github.com:your-user/envforge-private.git
```
#### **"VS Code extensions failed":**
```bash
# Make sure VS Code is installed
code --version
# Install manually if necessary
envforge show "environment" # View extension list
```
### **Logs and Debug:**
```bash
# View detailed status
envforge status
# Check config files
ls -la ~/.envforge/
# Preview before applying
envforge restore "environment" --dry-run
```
---
## ๐ค **Contributing**
Contributions are welcome!
### **How to Contribute:**
1. **Fork** the repository
2. **Create** a branch for your feature (`git checkout -b feature/new-functionality`)
3. **Commit** your changes (`git commit -am 'Add new functionality'`)
4. **Push** to the branch (`git push origin feature/new-functionality`)
5. **Open** a Pull Request
### **Areas That Need Help:**
- **Support for other distros** (CentOS, OpenSUSE)
- **Additional package managers** (brew, chocolatey)
- **Automated testing**
- **Documentation**
- **Graphical interface**
---
## ๐บ๏ธ **Roadmap**
### **v0.2.0 - Security** (Implemented)
- [โ
] Snapshot encryption
- [โ
] Safe package list (whitelist)
- [โ
] Sensitive data filtering
- [โ
] Integrity verification
### **v0.3.0 - Multi-OS** (8 weeks)
- [ ] Windows support (WSL)
- [ ] macOS support
- [ ] Homebrew support
- [ ] Chocolatey support
### **v1.0.0 - GUI and Cloud** (12 weeks)
- [ ] Graphical interface (PyQt6)
- [ ] Cloud storage (Google Drive, Dropbox)
- [ ] Community templates
- [ ] Pro version with advanced features
---
## ๐ **License**
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## ๐จโ๐ป **Author**
**Bernardo**
- GitHub: [@bernardoamorimalvarenga](https://github.com/bernardoamorimalvarenga)
- Email: amorimbernardogame@gmail.com
---
## ๐ **Acknowledgments**
- **Click** - Fantastic CLI framework
- **Rich** - Beautiful colored interface
- **Git** - Robust sync system
- **Python Community** - Amazing tools
---
## โญ **Like the Project?**
If EnvForge helped you, consider:
- โญ **Give it a star** on GitHub
- ๐ **Report bugs** or **suggest improvements**
- ๐ข **Share** with other developers
- ๐ค **Contribute** with code or documentation
---
**๐ฅ Stop manually reconfiguring environments - forge with EnvForge! ๐ฅ**
[๐ง๐ท Portuguรชs](README.pt-br.md) | [๐บ๐ธ English](README.md)