A desktop environment variable management tool built with Wails (Go + React/TypeScript). SwitchEnvs allows you to manage, save, and switch between multiple environment variable configurations with ease.
- Multiple Environment Schemes: Create, edit, duplicate, and delete environment variable schemes
- One-Click Switch: Quickly switch between different environment configurations
- Persistent Storage: Schemes are saved locally and persist across sessions
- Shell Integration: Automatically updates your shell environment (
~/.switch_env) - Import/Export: Share your environment schemes with others
- Custom Window: macOS-style frameless window with transparent background and rounded corners
- Auto-Reload: Changes to the currently applied scheme are immediately reflected
- Backend: Go with Wails v2
- Frontend: React 18 + TypeScript + Tailwind CSS
- Runtime: Native desktop application
- Go 1.23+
- Node.js & npm
- Wails CLI
# Install Wails CLI if not already installed
go install github.com/wailsapp/wails/v2/cmd/wails@latest
# Clone and setup
git clone https://github.com/dean2021/SwitchEnvs.git
cd SwitchEnvs
# Install frontend dependencies
cd frontend && npm install
# Return to project root
cd ..Run the application in development mode with hot reload:
wails devThis will start both the Go backend and the React frontend with automatic rebuilding.
Build the production version:
wails buildBuild for specific platforms:
# macOS ARM64
wails build -platform darwin/arm64
# Windows AMD64
wails build -platform windows/amd64
# Linux
wails build -platform linux/amd64- Click "Add Scheme" to create a new environment scheme
- Add key-value pairs for your environment variables
- Click "Apply" to activate the scheme
- Select a scheme from the sidebar
- Click "Apply" to switch to that environment configuration
- Use the export button to save your schemes as JSON
- Use the import button to load schemes from a JSON file
SwitchEnvs/
├── app.go # Main application logic (Go)
├── main.go # Application entry point
├── wails.json # Wails configuration
├── frontend/ # React frontend
│ ├── src/
│ │ ├── App.tsx # Main React component
│ │ ├── main.tsx # React entry point
│ │ ├── style.css # Global styles
│ │ └── types/ # TypeScript type definitions
│ ├── package.json
│ └── vite.config.ts
└── build/ # Build configurations
| Path | Purpose |
|---|---|
~/.switchenvs/schemes.json |
All saved schemes in JSON format |
~/.switchenvs/applied_scheme.json |
Persisted applied scheme name |
~/.switch_env |
Shell script with export KEY="value" entries |
The Go backend handles:
- Scheme CRUD operations (Save, Get, Delete, Duplicate)
- Applying schemes to the system
- Writing environment variables to shell config
- Import/Export functionality
The frontend provides:
- Interactive UI for managing environment schemes
- Real-time updates when switching schemes
- Import/Export dialogs
- Custom window controls (minimize, close)
SwitchEnvs writes environment variables to ~/.switch_env and automatically adds a source command to ~/.zshrc. To use the environment variables in your terminal:
source ~/.switch_envOr restart your terminal session.
MIT License
