ghux
v1.0.7
Published
Beautiful GitHub Account Switcher - Interactive CLI tool for managing multiple GitHub accounts per repository with health checks, activity logs, and multi-platform support
Maintainers
Readme
🎯 GhUx - Beautiful GitHub Account Switcher
🚀 Quick Start
After installation, usage is simple:
# Start interactive mode
ghux
# Clone repository with account selection
ghux https://github.com/user/repo.git
ghux [email protected]:user/repo.git
ghux https://github.com/user/repo.git myproject
# Check version
ghux --version
# Get help
ghux --helpThis will launch the interactive menu where you can:
- Add your GitHub accounts (SSH keys and/or tokens)
- Switch between accounts in any repository
- Test connections to verify everything works
- Manage account settings as needed
First Time Setup
- Run
ghuxin your terminal - Choose "➕ Add account"
- Enter your GitHub account details
- Choose authentication method (SSH or Token)
- Follow the prompts to configure
Switching Accounts
- Navigate to any Git repository
- Run
ghux - Choose "🔄 Switch account for current repo"
- Select your desired account
- Done! Your repository now uses the selected account">
✨ A beautiful, interactive CLI tool for seamlessly managing multiple GitHub accounts per repository
📦 Installation
🚀 One-line Install (Recommended)
curl -fsSL https://raw.githubusercontent.com/dwirx/ghux/main/install-curl.sh | bash📦 Package Managers
NPM/Yarn/PNPM
npm install -g ghux
yarn global add ghux
pnpm add -g ghuxBun (Recommended)
bun install -g ghux🐚 Shell Compatibility: Works with bash, zsh, fish, and other POSIX-compatible shells. Automatically detects and uses the best runtime (Bun → Node.js → fallback).
🪟 Windows Support: Fully compatible with PowerShell, CMD, Git Bash, and WSL. Automatic permission handling and path normalization. See WINDOWS_SUPPORT.md for details.
Windows (PowerShell)
npm install -g ghux
# Or with Bun
bun install -g ghux
# Run Windows compatibility test
powershell -File test-windows.ps1Homebrew (macOS/Linux)
brew tap dwirx/ghuxArch Linux (AUR)
yay -S ghux-bin
paru -S ghux-binScoop (Windows)
scoop bucket add dwirx https://github.com/dwirx/scoop-ghux
scoop install ghux📥 Manual Download
Download pre-built binaries from GitHub Releases:
- Linux x64:
ghux - Linux ARM64:
ghux-linux-arm64 - Windows x64:
ghux.exe - macOS Intel:
ghux-macos - macOS Apple Silicon:
ghux-macos-arm64
# Make executable and move to PATH
chmod +x ghux
sudo mv ghux /usr/local/bin/📋 See INSTALL.md for all installation methods and troubleshooting.
📥 Manual Download
Download pre-built binaries from GitHub Releases:
- Linux x64:
ghux - Linux ARM64:
ghux-linux-arm64 - Windows x64:
ghux.exe - macOS Intel:
ghux-macos - macOS Apple Silicon:
ghux-macos-arm64
# Make executable and move to PATH
chmod +x ghux
sudo mv ghux /usr/local/bin/📋 See INSTALL.md for all installation methods and troubleshooting.
🌟 Features
- 🎨 Beautiful Terminal UI - Inspired by Charm design principles
- 🔄 Multi-Account Support - Effortlessly switch between different GitHub accounts
- 🔐 Dual Authentication - Support for both SSH keys and Personal Access Tokens
- 📁 Per-Repository Configuration - Different accounts for different repositories
- 📦 Git Clone Integration - Clone repositories directly with account selection
- 🚀 Universal Download (dl) - Download ANY file from ANY URL - Git repos OR regular URLs (NEW in v1.0.6)
- 📥 Smart Auto-Detection - Automatically detects Git repositories or regular URLs (NEW in v1.0.6)
- ⚡ Zero Dependencies - Single executable file, no runtime required
- 🎯 Interactive Interface - Intuitive prompts and visual feedback
- 🔑 SSH Key Management - Generate, import, and manage SSH keys
- 🌈 Colorful Output - Rich colors and gradients for better UX
- 🎯 Active Account Detection - See which account is currently active
- 🖥️ Cross-Platform Support - Full Windows, Linux, macOS compatibility with proper path handling
- 🔔 Automatic Update Notifications - Get notified when new versions are available (checks once per day, non-blocking)
- Generate SSH key dan Import SSH private key (auto chmod, auto
.pub, auto alias/penamaan berdasarkan username). - Test koneksi: uji SSH alias dan/atau token.
🚀 Universal Download (dl) - NEW in v1.0.6
One command for everything! Download ANY file from ANY URL - like curl and wget, but better!
Auto-Detection Magic ✨
- Git Repositories - Automatically detects GitHub, GitLab, Bitbucket URLs
- Regular URLs - Handles PDFs, ISOs, installers, media files, archives, scripts
- Smart Parsing - No need to think, just paste the URL!
All Features in One Command
- Download Anything - PDFs, ISOs, installers, media, archives, Git files
- Progress Tracking - Real-time download progress with speed indicator
- Safe Downloads - Overwrite protection, file info preview
- Batch Downloads - Multiple URLs or from file lists
- Pattern Matching - Download files matching glob patterns (Git repos only)
- Branch/Tag/Commit - Download from specific versions (Git repos only)
- Custom Headers - Add authentication, API keys, custom user agents
- Directory Download - Download entire directories from Git repos
Quick Examples
Download from any URL:
# Download a PDF
ghux dl https://example.com/document.pdf
# Download Linux ISO
ghux dl https://releases.ubuntu.com/22.04/ubuntu.iso
# Download installer
ghux dl https://omarchy.org/install -o install.sh
# Download with custom name and directory
ghux dl https://example.com/file.pdf -o my-document.pdf -d ~/Downloads/Download from Git repositories:
# Download single file from GitHub
ghux dl https://github.com/user/repo/blob/main/README.md
# Download from different branch
ghux dl github.com/user/repo/file.md --branch develop
# Download all markdown files
ghux dl github.com/user/repo --pattern "*.md"
# Download entire directory
ghux dl-dir https://github.com/user/repo/tree/main/src
# Download latest release
ghux dl-release github.com/user/repoAdvanced usage:
# Download with authentication
ghux dl https://api.example.com/file.pdf -H "Authorization: Bearer TOKEN"
# Download multiple files
ghux dl url1 url2 url3
# Download from file list
ghux dl -f urls.txt -d ~/Downloads/
# Preview before download
ghux dl https://example.com/large-file.iso --infoAlternative Command
# ghux dlx is an alias for explicit universal download
ghux dlx <url> # Same as 'ghux dl', works identically📖 Documentation:
- DOWNLOAD_QUICK_START.md - Quick reference guide
- DLX_UNIVERSAL_DOWNLOAD.md - Complete universal download guide
- DOWNLOAD_FEATURE.md - Advanced Git repository features
📋 Update Notifications: GhUx automatically checks for updates once per day and shows a notification when a new version is available. You can also manually check for updates from the main menu. See UPDATE_CHECKER.md for details.
🛠️ Development Setup
Only needed if you want to build from source:
Prasyarat
- Bun v1.0+
- Git
- OpenSSH (
ssh,ssh-keygen) - opsional:
curl(untuk tes token)
Instalasi
# Clone repository
git clone https://github.com/dwirx/ghux.git
cd ghux
# Install dependencies
bun installDevelopment
# Run in development mode
bun run index.ts
# or
bun run startBuilding Standalone Executables
# Build for current platform
bun run build
# Build for all platforms
./build.sh
# Individual platform builds
bun run build:linux # Linux x64
bun run build:windows # Windows x64
bun run build:macos # macOS x64 & ARM64Anda akan melihat menu interaktif di terminal.
🚀 Clone Repository with Account Selection
GhUx dapat langsung clone repository dengan pemilihan account secara otomatis:
# Clone dengan HTTPS
ghux https://github.com/user/repo.git
# Clone dengan SSH
ghux [email protected]:user/repo.git
# Clone ke direktori tertentu
ghux https://github.com/user/repo.git myproject
# Mendukung berbagai format URL
ghux https://github.com/user/repo # Tanpa .git
ghux [email protected]:user/repo # SSH tanpa .git
ghux https://github.com/user/repo# # Dengan trailing #Cara Kerja Clone dengan Account
- Parse URL Repository - Mendukung format SSH dan HTTPS
- Pilih Account - Jika sudah ada account terkonfigurasi, pilih account yang akan digunakan
- Pilih Auth Method - Jika account punya SSH dan Token, pilih method yang diinginkan
- Setup Authentication - Otomatis setup SSH config atau token credentials
- Clone Repository - Clone dengan URL yang sesuai method dipilih
- Set Git Identity - Otomatis set
user.namedanuser.emaildi repo yang di-clone - Log Activity - Catat aktivitas clone untuk tracking
Keuntungan Clone dengan GhUx
- ✅ Tidak perlu setup manual - Auth sudah di-setup sebelum clone
- ✅ Git identity otomatis -
user.namedanuser.emaillangsung ter-set - ✅ Konsisten - Gunakan account yang sama seperti project lain
- ✅ Multi-platform - Mendukung GitHub, GitLab, Bitbucket, Gitea
- ✅ Fleksibel - Bisa pilih SSH atau HTTPS saat clone
Clone Tanpa Account
Jika belum ada account terkonfigurasi, GhUx tetap bisa clone repository seperti git clone biasa:
ghux https://github.com/user/repo.git
# > No accounts configured. Cloning without account setup...
# > Proceed with clone? (Y/n)Setelah clone, Anda bisa masuk ke direktori tersebut dan jalankan ghux untuk mengatur account.
Konsep Singkat
- Setiap “akun” menyimpan: label,
user.name/user.email(opsional), konfigurasi SSH (key path + host alias), dan/atau konfigurasi Token (username + PAT). - Konfigurasi disimpan di
~/.config/github-switch/config.json. - Untuk SSH, tool akan menulis blok
Hostpada~/.ssh/configseperti contoh:
Host github-<label>
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519_<label>
IdentitiesOnly yesAlur Utama
- Tambah Akun (Add account)
- Pilih metode: SSH, Token, atau keduanya.
- Isi
user.name/user.emailjika ingin di-set per repo saat switch. - SSH: pilih dari daftar key yang sudah ada di
~/.ssh(auto-suggestion) atau ketik path manual; bisa generate baru jika belum ada. - Token: isi username + Personal Access Token (PAT).
- Import SSH Private Key (opsional, lebih mudah)
- Pilih menu “Import SSH private key”.
- Masukkan GitHub username → tool otomatis menyarankan nama file tujuan langsung di
~/.ssh, contoh:~/.ssh/id_ed25519_<username>. - Masukkan path private key sumber (mis.
~/.ssh/id_ed25519). - Auto-suggestion: Anda akan mendapat daftar key yang sudah ada di
~/.sshuntuk dipilih, dan juga saran nama file tujuan yang umum dipakai. - Pilih apakah ingin menjadikannya default untuk Host
github.com(disarankan agar mudah ganti-ganti). - Opsional: tambahkan juga alias Host khusus (mis.
github-<username>), jika Anda tetap ingin alias. - Tool akan:
- Menyalin key ke
~/.ssh/<nama-file>dan set permission600. - Membuat public key
<nama-file>.pubbila belum ada (permission644). - Jika dipilih, menulis/menimpa blok
Host github.comagar memakai key ini. - Jika dipilih, menulis blok alias tambahan.
- Opsional langsung tes koneksi SSH (ke
github.comatau alias yang dipilih).
- Menyalin key ke
- Switch Akun untuk Repo Saat Ini
- Jalankan tool di dalam folder repo git.
- Pilih “Switch account for current repo”, pilih akun, lalu pilih metode (SSH/Token).
- Tool akan:
- SSH: set
origin→[email protected]:owner/repo.git, aturuser.name/user.emaillokal repo (Host tetapgithub.com). - Token: set
origin→https://github.com/owner/repo.git, aturcredential.helper storedan tulis~/.git-credentials. - Jika repo belum punya remote, tool akan minta input
owner/repo.
- SSH: set
- Tes Koneksi
- Pilih “Test connection”, pilih akun, lalu pilih metode:
- SSH: jalankan
ssh -T [email protected]dan laporkan hasil. - Token: cek
https://api.github.com/userdengan Basic Auth; sukses bila HTTP 200.
- SSH: jalankan
- Switch SSH Secara Global (tetap Host github.com)
- Pilih “Switch SSH globally (Host github.com)”.
- Pilih akun (harus punya SSH key).
- Tool akan menulis/menimpa blok berikut pada
~/.ssh/config:
Host github.com
HostName github.com
User git
IdentityFile /path/ke/private_key_akun
IdentitiesOnly yes- Dampak: semua akses
[email protected]:owner/repo.gitakan memakai key tersebut (tanpa ganti-ganti alias). Cocok jika ingin satu key aktif secara global dan mudah ditukar. - Anda bisa kapan saja menjalankan menu ini lagi untuk mengganti key global.
- Edit/Hapus/List Akun
- Edit: ubah label,
user.name/user.email, aktif/nonaktif metode, ganti key path/alias atau token. - Remove: hapus akun dari konfigurasi (tidak menghapus blok
Hostotomatis agar aman; bisa dihapus manual bila perlu). - List: tampilkan ringkasan akun yang tersimpan.
Mode SSH (Detail)
- Generate Key: menu “Generate SSH key for an account”. Key dibuat dengan tipe Ed25519, tanpa passphrase (bisa Anda tambah sendiri nanti).
- Import Key: menu “Import SSH private key”.
- Penamaan otomatis berdasarkan GitHub username untuk konsistensi.
- Izin file di-set: private
600, public644. - Alihkan host alias di
~/.ssh/configuntuk memaksa key tertentu saat akses GitHub.
Mode Token (HTTPS)
- Remote di-set ke
https://github.com/owner/repo.git. credential.helper storeakan menulis token ke~/.git-credentialsdalam plaintext.- Catatan keamanan: pertimbangkan pakai SSH bila memungkinkan guna menghindari penyimpanan token plaintext.
Tips & Praktik Terbaik
- Gunakan alias yang konsisten, mis.
github-work,github-personal. - Jika punya beberapa key, pastikan setiap repo diarahkan ke alias yang tepat.
- Untuk token, beri scope minimal yang diperlukan.
🎯 Use Cases
- Personal & Work Accounts: Keep your personal and work GitHub accounts separate
- Multiple Organizations: Switch between different organization accounts
- Client Projects: Use different accounts for different client repositories
- Open Source & Private: Different identities for public and private projects
- Quick Project Setup: Clone and setup new projects with correct account in one command
- Team Onboarding: Quickly clone multiple repos with proper authentication
🔧 Advanced Features
- SSH Key Generation: Generate Ed25519 keys directly from the CLI
- SSH Key Import: Import existing keys with automatic setup
- Global SSH Switching: Change SSH identity globally for all repositories
- Connection Testing: Verify SSH and token connectivity
- Automatic Permissions: Proper file permissions set automatically
- Cross-Platform Paths: Handles Windows, Linux, and macOS path differences
📚 Documentation
- Installation Guide - All installation methods
- Distribution Guide - For package maintainers
- Build Instructions - Building from source
- Release Process - For maintainers
🤝 Contributing
Contributions are welcome! Please check our Contributing Guidelines and feel free to:
- Report bugs by opening an issue
- Request features through discussions
- Submit pull requests with improvements
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with Bun for lightning-fast performance
- UI inspired by Charm design principles
- Thanks to all contributors who help make this tool better
Made with ❤️ by bangunx
⭐ If you find GhUx useful, please give it a star on GitHub!
