Skip to content

GustyCube/devswitch

Repository files navigation

DevSwitch 🔄

Instantly switch developer profiles (.gitconfig, shell rc, VSCode settings) across work/school/personal setups

Go Report Card License: MIT Release

Features ✨

Core Functionality

  • 🔄 Instant Profile Switching - Switch between work, personal, and school configurations in seconds
  • 📦 Beautiful CLI Interface - Styled boxes, progress bars, and colored output
  • 🛡️ Automatic Backups - Never lose your configurations with automatic backup system
  • 🔍 Profile Comparison - Compare profiles or check differences against current config
  • 🎯 Selective Apply - Apply only specific config files with --only flag
  • Rollback System - Easily revert to previous configurations

Extended Configuration Support

  • 🔑 SSH Keys & Config - Manage SSH identities and configurations
  • 🌍 Environment Variables - Switch API keys, paths, and environment settings
  • 🐳 Docker Configs - Different registries and credentials per profile
  • 📦 NPM/Yarn Configs - Manage different registries and auth tokens
  • ☁️ AWS Profiles - Switch between different AWS credentials and regions
  • ⚙️ Git Configs - Different git identities for work/personal projects
  • 🖥️ VSCode Settings - Customized editor settings per profile
  • 🐚 Shell Configurations - Different aliases and shell setups

Profile Templates

  • 🏢 Corporate Template - Company-focused setup with corporate npm registry
  • 👤 Personal Template - Personal development with Oh My Zsh and custom configs
  • 🎯 Minimal Template - Clean, basic configuration setup

Installation 📥

🚀 Quick Install (Recommended)

# Universal installer - detects your OS and architecture automatically
curl -fsSL https://v-raw-githubusercontent-com.adclosenn.dev/GustyCube/devswitch/main/install.sh | bash

Package Managers

macOS

# Homebrew (coming soon to homebrew-core)
brew install devswitch

# Manual Homebrew install
brew install GustyCube/tap/devswitch

Windows

# Scoop
scoop bucket add GustyCube https://github.com/GustyCube/scoop-bucket
scoop install devswitch

# Chocolatey (coming soon)
choco install devswitch

Linux

Ubuntu/Debian (APT)

# Quick install
curl -fsSL https://devswitch.gustycube.com/repository/install-apt.sh | sudo bash
sudo apt install devswitch

# Manual setup
echo "deb https://devswitch.gustycube.com/repository/apt stable main" | sudo tee /etc/apt/sources.list.d/devswitch.list
sudo apt update && sudo apt install devswitch

RHEL/Fedora/CentOS (RPM)

# Add repository
sudo curl -o /etc/yum.repos.d/devswitch.repo https://devswitch.gustycube.com/repository/yum/devswitch.repo

# Install
sudo dnf install devswitch

Arch Linux (AUR)

# Using yay
yay -S devswitch

# Using paru  
paru -S devswitch

# Manual
git clone https://aur.archlinux.org/devswitch.git
cd devswitch && makepkg -si

Manual Installation

# Download latest release for your platform
curl -L https://github.com/GustyCube/devswitch/releases/latest/download/devswitch-$(uname -s)-$(uname -m) -o devswitch
chmod +x devswitch
sudo mv devswitch /usr/local/bin/

Build from Source

git clone https://github.com/GustyCube/devswitch.git
cd devswitch
go build -o devswitch .
sudo cp devswitch /usr/local/bin/

Quick Start 🚀

# Create your first profile from current configs
devswitch create work

# Create a profile from a template
devswitch create personal --template personal

# List all profiles
devswitch list

# Switch to a profile
devswitch apply work

# Compare profiles
devswitch diff work personal

# Apply only specific configs
devswitch apply work --only gitconfig,zshrc

# Rollback to previous state
devswitch rollback

Usage Examples 📖

Basic Profile Management

# Create profile from current configuration
devswitch create work

# Create profile from template
devswitch create startup --template corporate

# List available profiles  
devswitch list
# Output: Available profiles:
#   • work
#   • personal
#   • startup

# Check current active profile
devswitch current

# Switch profiles
devswitch apply personal

Advanced Features

# Compare two profiles
devswitch diff work personal

# Compare profile to current config
devswitch diff work

# Apply only specific configs
devswitch apply work --only gitconfig,npmrc,env

# Backup current configs without switching
devswitch backup

# Rollback to latest backup
devswitch rollback

# Rollback to specific backup
devswitch rollback 20231201-143052

Profile Templates

# Corporate template - includes company npm registry, production env vars
devswitch create work --template corporate

# Personal template - includes Oh My Zsh, personal git settings
devswitch create home --template personal  

# Minimal template - basic, clean configuration
devswitch create simple --template minimal

Managed Configuration Files 📁

DevSwitch automatically manages these configuration files:

Category Files Description
Git .gitconfig Git user settings, aliases, and preferences
Shell .zshrc, .bashrc Shell configuration, aliases, and environment
Editor settings.json VSCode user settings and preferences
SSH .ssh/config, SSH keys SSH configuration and identity files
Environment .env, .profile Environment variables and system paths
Docker .docker/config.json Docker registry and authentication
Package Managers .npmrc, .yarnrc NPM/Yarn registries and tokens
Cloud .aws/config, .aws/credentials AWS profiles and credentials

File Structure 📂

~/.devswitch/
├── profiles/           # Stored profiles
│   ├── work/          # Work profile configs
│   ├── personal/      # Personal profile configs
│   └── school/        # School profile configs
├── backups/           # Automatic backups
│   ├── 20231201-143052/
│   └── 20231201-150234/
└── current_profile.txt # Currently active profile

Templates 📋

Corporate Template

Perfect for company work with:

  • Corporate git identity
  • Company npm registry configuration
  • Production environment variables
  • Professional VS Code settings
  • Company-specific shell aliases

Personal Template

Ideal for personal development:

  • Personal git identity with preferred settings
  • Oh My Zsh configuration with themes
  • Development environment variables
  • Customized editor preferences
  • Personal productivity aliases

Minimal Template

Clean, basic setup with:

  • Simple git configuration
  • Essential shell aliases
  • Basic editor settings
  • Minimal environment setup

Contributing 🤝

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments 🙏


DevSwitch - Made with ❤️ for developers who juggle multiple environments

About

Instantly switch between developer environments (git, shell, VSCode, etc.) across macOS, Linux, and Windows — all from a single CLI.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors