Skip to content
xorgzzPublic

About

A lightweight terminal UI (TUI) application for quickly launching SSH connections

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

s5h - SSH Menu

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.

Features

  • 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

Project structure

.
├── 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.

Requirements

  • g++ with C++17 support
  • ncurses development library (libncurses-dev / ncurses-devel, depending on your distro)
  • make

Setup / Build

Clone the repository and build with make:

git clone https://github.com/xorgzz/s5h.git
cd s5h
make

This 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 binary

Usage

Run the app normally, and it will load the default config from ./config/config.yml:

./s5h

Alternatively, you can pass a path to a different config file as the first argument:

./s5h /path/to/your/config.yml

Once launched, use the arrow keys to navigate the device list, Enter to run the selected device's command, and Q / Esc to quit.

Configuration

Devices are defined as a YAML list. Each entry supports three keys:

  • name - the label shown in the menu
  • comment - a short description shown below the menu when the entry is selected
  • bash - the shell command executed when the entry is chosen (typically an ssh command)

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 2222

Lines starting with - begin a new device entry; # starts a comment within a line and is ignored by the parser.

About

A lightweight terminal UI (TUI) application for quickly launching SSH connections

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages