ssm

module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2025 License: MIT

README

ssm (ssh-menu)

A simple terminal-based SSH host selector written in Go. It parses your ~/.ssh/config file and presents a interactive menu to choose which host to connect to.

Features

  • Parses SSH config files automatically
  • Interactive TUI menu using Bubbletea
  • Tmux integration: creates new windows for SSH sessions when running inside tmux
  • Fast and lightweight

Installation

Using Go
go install github.com/antonjah/ssm/cmd/ssm@latest
Using Nix Flakes

Add ssm as an input to your flake:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    ssm.url = "github:antonjah/ssm";
    ssm.inputs.nixpkgs.follows = "nixpkgs";
  };
}

Then use it in one of two ways:

As a package
{
  home.packages = [
    inputs.ssm.packages.${system}.default
  ];
}

Or with an overlay:

{
  nixpkgs.overlays = [ inputs.ssm.overlays.default ];
  
  home.packages = with pkgs; [
    ssm
  ];
}
As a home-manager module
{
  imports = [ inputs.ssm.homeModules.default ];

  programs.ssm.enable = true;
}

Usage

  1. Ensure your SSH config is set up at ~/.ssh/config with host entries:
Host server1
    HostName 192.168.1.100
    User myuser

Host server2
    HostName example.com
    User anotheruser
    IdentityFile /home/foo/.ssh/id_rsa
  1. Run the program:
ssm
  1. Use arrow keys to navigate, Enter to select, or type to filter hosts.

  2. The program will connect to the selected host using SSH.

Tmux Integration

When running inside a tmux session, the program will:

  • Create a new tmux window for the SSH session
  • Switch to existing window if one already exists for that host
  • Name windows as ssh:hostname

Directories

Path Synopsis
cmd
ssm command
Package main provides the command-line interface for the SSH Session Manager.
Package main provides the command-line interface for the SSH Session Manager.
internal
config
Package config provides functionality for parsing SSH configuration files.
Package config provides functionality for parsing SSH configuration files.
menu
Package menu provides an interactive terminal UI for selecting SSH hosts.
Package menu provides an interactive terminal UI for selecting SSH hosts.
tmux
Package tmux provides functionality for managing tmux windows during SSH sessions.
Package tmux provides functionality for managing tmux windows during SSH sessions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL