- Overview
- Features
- Screenshots
- Installation
- Usage
- Architecture
- Tech Stack
- Development
- Building
- Contributing
- License
DevSwitch is a cross-platform desktop application built with Electron and React that simplifies the management of multiple Git profiles and SSH keys. Whether you're a developer juggling personal and work accounts, or managing multiple client projects, DevSwitch streamlines SSH key generation, configuration, and profile switching.
- π Secure SSH Key Management - Generate, import, and manage SSH keys with passphrase encryption
- π Multiple Profiles - Switch between different Git accounts effortlessly
- βοΈ Auto-Configuration - Automatically updates SSH config files with proper host aliases
- π Smart Sync - Scan and sync existing SSH keys into profiles automatically
- π¨ Beautiful UI - Modern, responsive interface with dark/light theme support
- π₯οΈ Cross-Platform - Works on Windows, macOS, and Linux
Generate New SSH Keys
- Multiple Algorithms: Support for ED25519 and RSA key generation
- Passphrase Protection: Optional passphrase encryption for enhanced security
- Custom Naming: Name your keys for easy identification
- Automatic Registration: Keys are automatically added to ssh-agent
- Public Key Export: Easy access to public keys for platform registration
Import Existing Keys
- File Browser: User-friendly file picker to select existing SSH keys
- Default Key Detection: Automatically detects common SSH key locations (~/.ssh/id_ed25519, id_rsa)
- Validation: Ensures selected keys are valid SSH private keys
- Preserve Configuration: Maintains existing SSH config entries
Auto-Sync Feature
- Scan SSH Directory: Automatically scans ~/.ssh for all SSH keys
- Parse SSH Config: Reads existing SSH config file to find configured keys
- Email Extraction: Extracts email addresses from public key comments
- One-Click Sync: Creates profiles for all unmanaged SSH keys automatically
- Conflict Prevention: Skips keys that are already managed to avoid duplicates
Create Profiles
- Profile Information: Name, username, and email for each Git account
- SSH Key Options:
- Use default SSH key (id_ed25519 or id_rsa)
- Generate a new SSH key
- Import an existing SSH key
- Visual Feedback: Real-time validation and error handling
- Quick Actions: Create from default Git configuration
Edit & Update Profiles
- Modify Details: Update profile name, username, and email
- Change SSH Keys: Switch between different SSH keys
- Regenerate Keys: Generate new keys for existing profiles
- View SSH Config: See the generated SSH host configuration
- Copy Public Keys: One-click copy to clipboard for platform registration
Delete Profiles
- Safe Deletion: Confirmation dialog prevents accidental deletions
- SSH Config Cleanup: Automatically removes SSH config entries
- Key Preservation: Option to keep or delete generated SSH key files
- Profile Isolation: Deletion doesn't affect other profiles
Automatic SSH Config Management
- Host Alias Generation: Creates unique host aliases (e.g., github.com-username)
- IdentityFile Mapping: Links SSH keys to specific Git platform hosts
- Config File Updates: Safely modifies ~/.ssh/config without breaking existing entries
- Backup & Recovery: Preserves existing configuration
- Format Preservation: Maintains proper SSH config formatting
Global Git Config Detection
- Auto-Detection: Reads global Git username and email configuration
- Quick Profile Creation: Pre-fills profile forms with Git config data
- Default Profile Card: Suggests creating a profile from current Git setup
- Sync Validation: Shows Git config before syncing for verification
Connect GitHub Accounts
- OAuth Flow: Secure GitHub OAuth 2.0 authentication
- Account Linking: Connect GitHub accounts to profiles
- Auto SSH Upload: Automatically upload SSH public keys to GitHub
- Key Verification: Check if SSH key is already registered on GitHub
- One-Click Setup: No manual key copying required
- Multiple Accounts: Each profile can be linked to a different GitHub account
SSH Key Auto-Upload
- Automatic Registration: Upload SSH keys directly to GitHub account
- Duplicate Detection: Checks if key already exists before uploading
- Custom Titles: Keys uploaded with descriptive titles (e.g., "DevSwitch - Profile Name")
- Status Tracking: Visual indicators show connection and upload status
- Error Handling: Clear error messages for troubleshooting
- Secure Tokens: Access tokens encrypted and stored securely
Modern Design
- Custom Title Bar: Frameless window with custom minimize, maximize, and close controls
- Dark/Light Theme: System-aware theme with manual toggle
- Responsive Layout: Adapts to different window sizes and screen resolutions
- Card-Based UI: Clean, organized profile cards with quick actions
- Animations: Smooth transitions and hover effects using Motion One
- Component Library: Built with Radix UI primitives for accessibility
Quick Actions
- Sync All Keys: One-click button to scan and sync all SSH keys
- Create from Default: Quick profile creation from Git config
- Theme Toggle: Easy switching between light and dark modes
- Window Controls: Custom minimize, maximize, and close buttons
Passphrase Encryption
- Secure Storage: Passphrases are encrypted using Node.js crypto module
- Electron-Store: Encrypted data stored securely using electron-store
- No Plain Text: Passphrases never stored in plain text
- Memory Safety: Sensitive data cleared from memory after use
SSH Agent Integration
- Automatic Registration: Generated keys automatically added to ssh-agent
- Passphrase Handling: Supports passphrase-protected keys
- Platform Support: Works with ssh-agent on macOS/Linux and Pageant on Windows
- Session Persistence: Keys remain loaded for the session duration
Profile Cards
- Visual Indicators: Color-coded borders for different key types
- Quick Info: Username, email, and key type at a glance
- Action Buttons: Edit, view, and delete directly from cards
- SSH Config Status: Shows whether SSH config is properly configured
- Key Algorithm Badge: Displays the SSH key algorithm (ED25519/RSA)
- Node.js v18 or higher
- npm or yarn package manager
- Git installed and configured
- OpenSSH client (usually pre-installed on macOS/Linux)
-
Clone the repository
git clone https://github.com/umesh-saini/devswitch.git cd devswitch -
Install dependencies
npm install
-
Run in development mode
# Terminal 1: Start Vite dev server npm run dev # Terminal 2: Start Electron npm run electron:dev
-
Build for production
npm run build npm run electron:build
- Launch DevSwitch
- Click the "Create Profile" button
- Fill in your profile details:
- Profile Name (e.g., "Work Account")
- GitHub Username
- Email address
- Choose an SSH key option:
- Default: Use existing id_ed25519 or id_rsa
- Generate: Create a new SSH key (recommended)
- Existing: Select a key from your system
- If generating a new key:
- Select algorithm (ED25519 recommended)
- Provide a unique key name
- Optionally add a passphrase
- Click "Create Profile"
GitHub OAuth allows automatic SSH key upload to your GitHub account.
-
Create a GitHub OAuth App
- Go to GitHub Settings β Developer settings β OAuth Apps
- Click "New OAuth App"
- Fill in the application details:
- Application name: DevSwitch (or your preferred name)
- Homepage URL:
http://localhost:5173 - Authorization callback URL:
http://localhost:<PORT>/oauth/callback
- Click "Register application"
-
Configure Environment Variables
- Copy
.env.exampleto.env:cp .env.example .env
- Open
.envand add your OAuth credentials:GITHUB_CLIENT_ID=your_client_id_here GITHUB_CLIENT_SECRET=your_client_secret_here
- Copy
-
Restart the Application
npm run dev npm run electron:dev
-
Connect Your Profile
- Open a profile view page
- Click "Connect GitHub" in the GitHub Integration section
- Your default browser will open with GitHub's authorization page
- Sign in to GitHub (if not already) and authorize DevSwitch
- You'll see a success message - you can close the browser tab
- Return to DevSwitch and click "Upload Key" to automatically add your SSH key to GitHub
Note: The OAuth flow uses your system's default browser (Chrome, Firefox, Safari, etc.) for better security and familiarity.
- Open your profile or view the profile details
- Click "Copy Public Key"
- Go to GitHub β Settings β SSH and GPG keys
- Click "New SSH key"
- Paste the public key and save
The generated SSH host alias will be in the format:
github.com-username
To clone a repository using your specific profile:
git clone git@github.com-username:repository/name.gitTo set the remote URL for an existing repository:
git remote set-url origin git@github.com-username:repository/name.git- Click the "Sync All Keys" button on the home page
- Review your Git configuration in the warning dialog
- Click "Continue Sync"
- DevSwitch will:
- Scan your ~/.ssh directory
- Read your SSH config file
- Create profiles for unmanaged keys
- Extract emails from public keys
- Update SSH config if needed
Each profile has its own SSH host alias. Simply use the appropriate host when cloning or setting remotes:
- Work account:
git@github.com-work:repo.git - Personal account:
git@github.com-personal:repo.git - Client account:
git@github.com-client:repo.git
devswitch/
βββ electron/ # Electron main process
β βββ main.ts # Application entry point
β βββ preload.ts # Preload script for IPC
β βββ services/ # Backend services
β β βββ sshAgentService.ts # SSH agent integration
β β βββ sshConfigService.ts # SSH config file management
β β βββ sshKeyService.ts # SSH key operations
β β βββ storageService.ts # Data persistence
β βββ type/ # TypeScript types
β β βββ profile.ts # Profile & API types
β βββ utils/
β βββ encryption.ts # Passphrase encryption
βββ src/ # React frontend
β βββ components/ # React components
β β βββ animate-ui/ # Animated UI components
β β βββ layout/ # Layout components
β β β βββ AppShell.tsx # Main layout wrapper
β β β βββ TitleBar.tsx # Custom title bar
β β βββ profiles/ # Profile-related components
β β βββ ui/ # Base UI components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility functions
β βββ pages/ # Page components
β β βββ HomePage.tsx # Main dashboard
β β βββ CreateProfilePage.tsx
β β βββ EditProfilePage.tsx
β β βββ ProfileViewPage.tsx
β βββ services/ # Frontend services
β β βββ electronService.ts # IPC communication wrapper
β βββ stores/ # State management
β β βββ profileStore.ts # Zustand store for profiles
β βββ types/ # Frontend types
β βββ App.tsx # Root component
βββ public/ # Static assets
βββ package.json # Dependencies and scripts
βββ vite.config.ts # Vite configuration
βββ tsconfig.json # TypeScript configuration
βββ README.md # This file
Frontend:
- βοΈ React 19.2.0 - UI framework
- π TypeScript 5.9.3 - Type safety
- π¨ Tailwind CSS 4.1.18 - Utility-first CSS
- π§© Radix UI - Accessible component primitives
- π next-themes - Theme management
- π Motion One - Animation library
- πΊοΈ React Router - Client-side routing
- π» Zustand - State management
Backend:
- π₯οΈ Electron 40.2.1 - Desktop app framework
- π¦ electron-store - Encrypted data persistence
- π Node.js crypto - Passphrase encryption
- π OpenSSH - SSH key generation and management
Development:
- β‘ Vite 7.2.4 - Build tool and dev server
- π§ ESLint - Code linting
- π Prettier - Code formatting (via ESLint)
# Start Vite development server
npm run dev
# Start Electron in development mode
npm run electron:dev
# Build for production
npm run build
# Build Electron app
npm run electron:build
# Run linter
npm run lint
# Preview production build
npm run preview-
Start the dev server in one terminal:
npm run dev
-
Start Electron in another terminal:
npm run electron:dev
-
The app will hot-reload on changes to React components
-
Electron process requires restart for backend changes
Vite Configuration (vite.config.ts):
- React plugin for JSX support
- SVGR plugin for SVG-as-component imports
- Tailwind CSS v4 via
@tailwindcss/vite - Path aliases for cleaner imports
TypeScript Configuration:
- Strict mode enabled
- ES2022 target
- Module resolution: bundler
- Path mappings for
@/imports
Tailwind Configuration:
- v4 using CSS imports
- Custom theme via
@layerdirectives - Dark mode using
classstrategy - Extended with tailwind-animate plugin
# Build the React app
npm run build
# Build Electron executable
npm run electron:buildThe built application will be in the dist/ directory.
Edit package.json to configure electron-builder:
{
"build": {
"appId": "com.devswitch.app",
"productName": "DevSwitch",
"mac": {
"category": "public.app-category.developer-tools"
},
"win": {
"target": "nsis"
},
"linux": {
"target": "AppImage"
}
}
}We welcome contributions! Please see our Contributing Guide for details on how to get started.
- Profile Templates - Save profile configurations as templates
- Batch Operations - Select multiple profiles for bulk actions
- Export/Import - Backup and restore profiles
- CLI Tool - Command-line interface for profile switching
- Git Hooks - Auto-switch profiles based on repository
- SSH Key Rotation - Schedule automatic key rotation
- Activity Logs - Track profile usage and SSH key operations
- Cloud Sync - Sync profiles across devices
- Two-Factor Auth - Additional security layer
- Profile Groups - Organize profiles into categories
- Windows: SSH agent integration may require additional setup
- macOS: First launch may require security approval
- Linux: Some distributions require manual ssh-agent configuration
This project is licensed under the MIT License - see the LICENSE file for details.
- Radix UI - For accessible component primitives
- Tailwind CSS - For the utility-first CSS framework
- Electron - For making cross-platform desktop apps possible
- Lucide Icons - For the beautiful icon set
- shadcn/ui - For UI component inspiration
For bugs, feature requests, or questions:
- Open an Issue
- Start a Discussion
Made with β€οΈ by developers, for developers
β Star this repo if you find it useful!



