A lightweight terminal UI (TUI) application for quickly launching SSH connections (or any other bash command) from a simple list, without having to remember hostnames/IPs, or set up SSH config aliases, DNS entries, or other workarounds.
You define your devices/servers once in a YAML config file, and s5h gives you an interactive ncurses menu to pick one and run its associated command.
- Simple arrow-key navigation menu
- Each entry has a name, a comment/description, and a bash command to execute
- Config file driven — no need to hardcode hosts in the code
- Optional custom config path via command line argument
- Resizable terminal support
.
├── main.cpp
├── lib/
│ ├── config_reader.cpp
│ ├── config_reader.h
│ ├── structures.cpp
│ ├── structures.h
│ ├── error.cpp
│ ├── error.h
│ ├── tui.cpp
│ └── tui.h
├── config/
│ └── config.yml
└── Makefile
All source files except main.cpp live in ./lib/. The default configuration file is expected at ./config/config.yml.
g++with C++17 supportncursesdevelopment library (libncurses-dev/ncurses-devel, depending on your distro)make
Clone the repository and build with make:
git clone https://github.com/xorgzz/s5h.git
cd s5h
makeThis produces a s5h binary in the project root.
Other useful targets:
make debug # build with debug info (-DDEBUG) and extra on-screen diagnostics
make run # build and immediately run the app
make run-debug # build (debug) and immediately run the app
make clean # remove build artifacts and the binaryRun the app normally, and it will load the default config from ./config/config.yml:
./s5hAlternatively, you can pass a path to a different config file as the first argument:
./s5h /path/to/your/config.ymlOnce launched, use the arrow keys to navigate the device list, Enter to run the selected device's command, and Q / Esc to quit.
Devices are defined as a YAML list. Each entry supports three keys:
name- the label shown in the menucomment- a short description shown below the menu when the entry is selectedbash- the shell command executed when the entry is chosen (typically ansshcommand)
Example config.yml:
- name: Raw ssh keyless
comment: Raw ssh pass args on your own without key
bash: clear && bash -c 'read -p "Username: " USER; read -p "IP: " IP; ssh $USER@$IP; read -p "Press enter to exit..." __'
- name: Home server
comment: My home NAS, reachable over LAN
bash: ssh [email protected]
- name: Prod web01
comment: Production web server
bash: ssh [email protected] -p 2222Lines starting with - begin a new device entry; # starts a comment within a line and is ignored by the parser.