- 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 ships with a standalone CLI that manages the same profiles as the desktop app. It runs on Windows, macOS, and Linux (anything with Node.js β₯ 18) and works with or without the desktop app installed β both read and write the same database, so there are no conflicts and install order doesn't matter.
# A) npm β the simplest cross-platform way (Windows/macOS/Linux)
# npm puts `devswitch` on your PATH automatically; no manual PATH editing.
npm install -g devswitch-cli
# B) Bundled with the desktop app β the Linux .deb auto-installs `devswitch`
devswitch help
# C) Standalone, one-line install (served by the distribution site)
curl -sSL https://<your-app-host>/init/cli.sh | bashFor local development from this repo:
npm run cli:link # builds + `npm link` so the `devswitch` command points at your buildPATH is handled for you. With
npm install -g/npm link, npm creates the right entry on every OS (a symlink on macOS/Linux, a.cmd/.ps1shim on Windows) inside npm's global bin directory, which is already on your PATH. No manual environment-variable or symlink setup required.If a standalone CLI is already installed, the app installer won't overwrite it.
devswitch help # full command reference
devswitch list # list all profiles (alias: ls)
devswitch use <profile> # switch profile (alias: switch)
devswitch current # show the active profile (alias: whoami)
devswitch add # create a profile (alias: create)
devswitch remove <profile> # delete a profile (alias: rm)
devswitch show <profile> # full details (alias: view)
devswitch sync # import unmanaged SSH keys
devswitch test <profile> # test SSH authentication
devswitch pubkey <profile> # print public key (pipe-friendly)
devswitch clone <url> [dir] --profile <name> # clone with a profile's identity
devswitch logs # recent activity (app + CLI)
devswitch doctor # diagnose environment & data store
devswitch path # show the shared data directory<profile> matches a name, username, email, or id (partial, case-insensitive).
Add --json to most commands for scriptable output.
See cli/README.md for the complete reference.
| Platform | Location |
|---|---|
| Linux | ~/.config/devswitch/ |
| macOS | ~/Library/Application Support/devswitch/ |
| Windows | %APPDATA%\devswitch\ |
Override with DEVSWITCH_DATA_DIR. On first run, profiles from older
electron-store locations are migrated automatically (once, non-destructively).
devswitch/
βββ core/ # π Shared library (no Electron) β used by BOTH app & CLI
β βββ index.ts # Public barrel export
β βββ types.ts # Shared domain types (Profile, inputs, β¦)
β βββ paths.ts # Cross-platform shared data dir resolution
β βββ jsonStore.ts # Atomic JSON store (replaces electron-store)
β βββ type/log.ts # Activity log types
β βββ services/ # Shared business logic
β β βββ profileManager.ts # create/update/delete/switch/sync orchestration
β β βββ storageService.ts # Profile persistence (+ legacy migration)
β β βββ logService.ts # Activity log (+ legacy migration)
β β βββ sshKeyService.ts # SSH key operations
β β βββ sshAgentService.ts # ssh-agent integration
β β βββ sshConfigService.ts # ~/.ssh/config management
β β βββ sshTestService.ts # SSH connection test
β β βββ gitService.ts # git clone / remote / config
β βββ utils/ # encryption, environment, providerUtils
βββ cli/ # π₯οΈ Standalone `devswitch` command-line tool
β βββ src/ # CLI source (commands, args, prompts, ui)
β β βββ index.ts # Entry + command router
β β βββ commands/ # One file per command (list, use, add, β¦)
β βββ build.mjs # esbuild bundler β bin/devswitch.cjs
β βββ bin/devswitch.cjs # Built self-contained bundle (generated)
β βββ package.json # Publishable as `devswitch-cli`
β βββ README.md # CLI documentation
βββ electron/ # Electron main process
β βββ main.ts # App entry β IPC handlers delegate to core
β βββ preload.ts # Preload script for IPC
β βββ services/ # Thin re-exports of core services
β βββ type/ # Re-exports of core types + ElectronAPI
β βββ utils/ # Re-exports of core utils
βββ src/ # React frontend (renderer)
β βββ components/ # React components
β β βββ animate-ui/ # Animated UI components
β β βββ layout/ # AppShell, TitleBar
β β βββ profiles/ # Profile-related components
β β βββ ui/ # Base UI components
β βββ hooks/ lib/ pages/ # Hooks, utils, page components
β βββ services/ # electronService.ts (IPC wrapper)
β βββ stores/ # Zustand stores
β βββ App.tsx # Root component
βββ build/linux/ # deb afterInstall/afterRemove hooks (auto-install CLI)
βββ public/ # Static assets
βββ package.json # Dependencies and scripts
βββ vite.config.ts # Vite configuration
βββ README.md # This file
Shared database: the desktop app and the CLI both read/write the same JSON store (
~/.config/devswitch/on Linux,~/Library/Application Support/devswitch/on macOS,%APPDATA%\devswitch\on Windows). All profile logic lives incore/services/profileManager.ts, so both entry points behave identically and never conflict. See cli/README.md for the full CLI reference.
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 / Shared core:
- π₯οΈ Electron 40.2.1 - Desktop app framework
- π§©
core/shared library - Electron-independent business logic (app + CLI) - π¦ Plain JSON store - atomic, dependency-free shared persistence
- π Node.js crypto - Passphrase & token encryption (machine-bound AES-256-GCM)
- π OpenSSH - SSH key generation and management
CLI:
- π₯οΈ
devswitchcommand - standalone, shares the app's database - β‘ esbuild - bundles the CLI into a single Node β₯18 file
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
# Build the standalone CLI bundle (cli/bin/devswitch.cjs)
npm run cli:build
# Install the CLI on your PATH for local development (npm link)
npm run cli:link
# 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
- Install DevSwitch: Download from Releases
- Add Your First Profile:
- Click "Add Profile"
- Enter profile name (e.g., "Work", "Personal")
- Select or generate SSH key
- Configure Git user.name and user.email
- Switch Profiles: Click on any profile card to switch instantly
- Switch to Work: Click "Work" profile β auto-switches SSH keys and Git config
- Switch to Personal: Click "Personal" profile β updates all credentials
- Check Active Profile: Current profile is highlighted in the UI
Ctrl/Cmd + K: Quick profile switcherCtrl/Cmd + ,: Open settings
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!
Morning: Switch to "Client A" profile
- SSH key:
~/.ssh/client_a - Git: John Doe john@client-a.com
Afternoon: Switch to "Client B" profile
- SSH key:
~/.ssh/client_b - Git: John Doe john@client-b.com
Work hours: "Work" profile active
- Corporate SSH key
- Work email configured
Evening: Switch to "Personal"
- Personal GitHub key
- Personal email for commits
Open source contributions: "Open Source" profile
- Public SSH key
- Public email
Private projects: "Private" profile
- Private SSH key
- Private email



