Skip to content

pozgo/OhMySSH

Repository files navigation

🚀 OhMySSH

A modern, interactive SSH connection manager with a beautiful terminal UI

Version Go Version License Build Status

Built with Go • Inspired by lazygit • Powered by Bubble Tea


✨ Features

🎯 Core Features

  • 🚀 Interactive SSH Manager - Beautiful TUI interface
  • 📝 Vim-style Editor - Modal editing with syntax highlighting
  • 🖱️ Mouse Support - Click to select and interact
  • 🔧 Smart Parser - Automatic SSH config detection
  • 🛡️ Safe Editing - Automatic backups & validation

Performance

  • 🌐 Cross-platform - Linux, macOS, Windows
  • Lightning Fast - Built with Go
  • 🪶 Lightweight - Single binary, no dependencies
  • 🔄 Real-time - Live config preview
  • 🎨 Beautiful - Stunning terminal UI

🎬 Demo

🖥️ Beautiful Terminal Interface

🌐 SSH SERVERS 🚀          📄 SSH CONFIG PREVIEW ⚙️
┌─────────────────────┬─────────────────────────────────┐
│ 💻 web-server       │                                 │
│ 🌐 database-srv     │  Host web-server                │
│ 🌐 dev-server       │      HostName example.com       │
│ 🌐 production       │      User admin                 │
│                     │      Port 22                    │
├─────────────────────┤      IdentityFile ~/.ssh/key    │
│ 📋 SERVER DETAILS 🔍│                                 │
│ Host: web-server    │  Host database-srv              │
│ Hostname: example.com│     HostName db.example.com    │
│ User: admin         │     User dbadmin                │
│ Port: 22            │     Port 5432                   │
└─────────────────────┴─────────────────────────────────┘
  q: quit | ↑↓: navigate | ⏎: connect | e: edit | ESC/q: exit editor | 🖱️: click

Three-panel layout with server list, details, and live config preview


🚀 Quick Start

🛠️ Build from Source

Prerequisites:

  • Go 1.23 or higher
  • Git

Step-by-step build instructions:

# 1. Clone the repository
git clone https://github.com/pozgo/OhMySSH.git
cd OhMySSH

# 2. Download and resolve Go module dependencies
go mod tidy

# 3. Build for current platform
make build

# 4. Run the application
./OhMySSH

Alternative build commands:

# Build for all platforms (Linux, macOS, Windows)
make build-all

# Run tests
make test

# Clean build artifacts
make clean

# Install to system (requires sudo)
make install

If you encounter dependency issues:

# Force download specific modules
go mod download github.com/charmbracelet/bubbles
go mod download github.com/charmbracelet/bubbletea  
go mod download github.com/charmbracelet/lipgloss

# Then retry the build
make build

🎯 Launch & Connect

# 1. Launch OhMySSH
./OhMySSH

# 2. Navigate with ↑↓ or mouse
# 3. Press Enter to connect
# 4. Press 'e' to edit configs

🎮 Controls & Navigation

⌨️ Keyboard Shortcuts

🧭 Navigation

Key Action
Navigate servers
k j Vim-style navigation
Space Connect to server
Tab Switch panels

⚙️ Actions

Key Action
e Edit SSH config
r Refresh server list
f Search/filter
? Show help

🚪 Exit

Key Action
q Quit application
Ctrl+C Force quit
Esc Cancel/back

🖱️ Mouse Controls

Click anywhere to interact!

🖱️ Click Server
Select from list

🖱️ Click Config
Open editor

🖱️ Right Click
Context menu


📝 Vim-Style Editor

🎯 Modal Editing Experience

🎯 Normal Mode

┌─────────────────┐
│ Press 'i' to    │
│ enter Insert    │
│ mode            │
│                 │
│ dd - Delete line│
│ ZZ - Save & exit│
│ :  - Command    │
└─────────────────┘

✏️ Insert Mode

┌─────────────────┐
│ Type to edit    │
│ your SSH config │
│                 │
│ ESC - Return to │
│ Normal mode     │
│                 │
│ Auto-complete   │
└─────────────────┘

💻 Command Mode

┌─────────────────┐
│ :w   - Save     │
│ :q   - Quit     │
│ :wq  - Save+Quit│
│ :q!  - Force    │
│                 │
│ Full vim power! │
└─────────────────┘

🔧 SSH Configuration

📋 Example Configuration

# 🌐 Production Web Server
Host web-server
    HostName production.example.com
    User admin
    Port 22
    IdentityFile ~/.ssh/production_key
    ServerAliveInterval 60
    ForwardAgent yes

# 🗄️ Database Server with Jump Host  
Host db-server
    HostName 10.0.1.100
    User dbadmin
    Port 5432
    ProxyJump bastion.example.com
    LocalForward 5432 localhost:5432

# 🔧 Development Environment
Host dev-server
    HostName dev.example.com
    User developer
    Port 2222
    IdentityFile ~/.ssh/dev_key
    ForwardX11 yes
    StrictHostKeyChecking no

# 🚀 Kubernetes Cluster
Host k8s-master
    HostName k8s.example.com
    User k8s-admin
    IdentityFile ~/.ssh/k8s_key
    DynamicForward 8080
🔍 Supported SSH Options
Option Description Example
HostName Server address example.com
User Username admin
Port SSH port 22
IdentityFile Private key ~/.ssh/id_rsa
ProxyJump Jump host bastion.com
LocalForward Port forwarding 8080:localhost:80
DynamicForward SOCKS proxy 1080
ForwardAgent SSH agent yes
ForwardX11 X11 forwarding yes
ServerAliveInterval Keep alive 60

🔗 Connection Flow

🎯 Beautiful Connection Experience

🚀 Connecting to server via OhMySSH...
┌─────────────────────────────────────────┐
│ 💻 Server: web-server                   │
│ 🌐 Host:   production.example.com       │
│ 👤 User:   admin                        │
│ 🔌 Port:   22                           │
└─────────────────────────────────────────┘
Command: ssh web-server

🔍 Retrieving authentication details...
🔐 Available methods: SSH key, password
🔑 Attempting SSH key authentication...
🚀 Connecting with SSH key authentication...
✅ Connected successfully!

Clean connection output with server details and authentication status


🛡️ Security & Safety

🔒 Enterprise-Grade Security

🛡️ Safety Features

  • Automatic Backups before editing
  • Permission Preservation (600/644)
  • Config Validation prevents corruption
  • Test Isolation protects real configs
  • Safe Mode for critical operations

🔐 Security

  • No Key Storage - uses system SSH agent
  • Environment Preservation - respects SSH wrappers
  • Audit Trail - logs all config changes
  • Read-only Mode for sensitive environments
  • Encrypted Backups optional

🏗️ Build & Development

🛠️ Build System

🚀 Quick Commands

make build      # Current platform
make build-all  # All platforms  
make test       # Run tests
make install    # System install
make clean      # Clean artifacts

🌍 Cross-Platform

  • 🐧 Linux (amd64, arm64)
  • 🍎 macOS (Intel, Apple Silicon)
  • 🪟 Windows (amd64, arm64)
  • 🐳 Docker support included
📁 Project Structure
🏗️ ohmyssh/
├── 📁 cmd/ohmyssh/         # 🚀 Main application
│   └── 📄 main.go
├── 📁 pkg/parser/          # 🔧 SSH config parser
│   ├── 📄 ssh_config.go
│   └── 📄 ssh_config_test.go
├── 📁 test/               # 🧪 Test fixtures
│   ├── 📁 fixtures/
│   └── 📄 README.md
├── 📁 build/              # 📦 Build outputs
├── 📁 assets/             # 🎨 Images & docs
├── 📄 Makefile           # 🛠️ Build automation
├── 📄 build.sh           # 📦 Cross-platform builds
├── 📄 go.mod             # 📋 Go dependencies
└── 📄 README.md          # 📖 This file

🐛 Troubleshooting

🔧 Common Issues & Solutions

SSH Config Not Found
# Check if config exists
ls -la ~/.ssh/config

# Create if missing
touch ~/.ssh/config
chmod 600 ~/.ssh/config

# Verify permissions
stat -c %a ~/.ssh/config  # Should be 600
⌨️ Editor Not Working
# Reset to normal mode
Press: ESC ESC ESC or q

# Force quit editor
Type: :q! or press q in normal mode

# Check terminal compatibility
echo $TERM
🔗 Connection Fails
# Test SSH config manually
ssh -F ~/.ssh/config -T your-server

# Debug mode
ssh -vvv your-server

# Check OhMySSH debug mode
DEBUG=1 ./ohmyssh
🖱️ Mouse Not Working
# Check terminal mouse support
echo $TERM

# Try different terminal
# - iTerm2 (macOS)
# - Windows Terminal
# - GNOME Terminal
# - Alacritty

# Fallback to keyboard navigation
🔨 Build Issues
# Missing go.sum entries error
go mod tidy

# Module download failures
go clean -modcache
go mod download

# Build fails with missing dependencies
go mod tidy
go mod download
make build

# Permission denied on executable
chmod +x ./OhMySSH

# Go version compatibility
go version  # Should be 1.19+

🌟 Contributing

🤝 Join the Community!

Contributors Issues Pull Requests

# 1. 🍴 Fork the repository
# 2. 🌿 Create feature branch
git checkout -b feature/amazing-feature

# 3. ✍️ Make your changes
# 4. ✅ Run tests
make test

# 5. 📤 Push and create PR
git push origin feature/amazing-feature

💝 Ways to Contribute

🐛 Bug Reports
Help us improve

New Features
Add awesome functionality

📚 Documentation
Make it even clearer

🎨 UI/UX
Make it more beautiful


📄 License

This project is licensed under the MIT License

License: MIT

See LICENSE file for details


🙏 Acknowledgments

💎 Built with Amazing Tools

Bubble Tea
TUI Framework

Lip Gloss
Styling Engine

Go
Programming Language

🌟 Special Thanks

Inspired by lazygit • Built for the SSH community


Made with ❤️ and lots of ☕ for developers everywhere

GitHub Stars GitHub Forks GitHub Watchers

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published