This is a terminal-based interactive tool built using Go, which allows users to select from a list of servers and establish an SSH connection either in a new alacritty terminal window or a new tmux tab.
- Text-based user interface (TUI) for easy SSH connection management.
- Stores server details (name, address, description) in a TOML configuration file.
- Opens SSH connections in a new terminal window (Alacritty).
- Lightweight and easy to configure.
- Go 1.16 or later installed on your system.
tmuxinstalled and configured.alacrittyinstalled and configured.
-
Clone the repository:
git clone https://github.com/yourusername/ssh-connection-tool.git cd ssh-connection-tool -
Build the tool:
go build -o ssh-tool main.go
-
Run the tool:
./ssh-tool
-
Run the tool from your terminal:
./ssh-tool
-
Use the arrow keys to navigate the list of servers.
-
Press
Enterto select a server. -
When prompted, choose:
ato open the SSH connection in a newalacrittyterminal window.tto open the SSH connection in a newtmuxtab.
-
The SSH session will start in the selected environment.
**will be adding a config file so you do not need to modify the `` **
To add or remove servers from the list:
- Open the
main.gofile in your preferred text editor. - Modify the
itemsslice in themainfunction with your desired server names and descriptions. - Update the
getServerAddressfunction to include the SSH connection details for each server.
items := []list.Item{
item{title: "Raspberry Pi’s", desc: "I have ’em all over my house"},
item{title: "Linux Server", desc: "My main development server"},
// Add more items as needed
}
func getServerAddress(serverName string) string {
switch serverName {
case "Raspberry Pi’s":
return "pi@192.168.1.10"
case "Linux Server":
return "user@linux-server.com"
// Add more cases for other items if needed
default:
return ""
}
}4 . Save your changes and rebuild the tool:
go build -o ssh-tool main.go