Skip to content
/ sshm Public

shm is a command-line tool written in Rust that makes it easy to manage a list of SSH hosts. It allows you to list, create, edit, delete, and connect to SSH hosts through an interactive terminal interface.

License

Notifications You must be signed in to change notification settings

Sn0wAlice/sshm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sshm – SSH Host Manager

sshm is a command-line tool written in Rust that makes it easy to manage a list of SSH hosts stored in a local JSON file. It allows you to list, create, edit, delete, and connect to SSH hosts through an interactive terminal interface using the inquire library.

Installation

Prerequisites

  • Rust installed (via rustup)
  • ssh available in your terminal

Build

git clone https://github.com/tonrepo/sshm.git
cd sshm
cargo build --release

The binary will be available at ./target/release/sshm.

To use it globally:

cp ./target/release/sshm /usr/local/bin/

Configuration File

The file is automatically created at the following location if it doesn't exist:

$HOME/.config/sshm/host.json

It contains a JSON dictionary of SSH hosts with the following structure:

{
  "my-server": {
    "name": "my-server",
    "ip": "192.168.1.10",
    "port": 22,
    "username": "alice"
  }
}

🧰 Available Commands

sshm list

Displays all saved hosts.

sshm create

Adds a new host interactively.

sshm edit

Edits an existing host via an interactive selection.

sshm delete

Deletes a host from the configuration.

sshm connect [name]
sshm c [name]

Connects to a host. If multiple hosts match the name, an interactive selection is shown. If no name is provided, all hosts are listed for selection.

Example

$ sshm create
Name: dev-server
IP: 10.0.0.5
Port: 22
Username: ubuntu

$ sshm list
dev-server => [email protected]:22

$ sshm c dev
# ssh to [email protected] -p 22

🛠️ Main Dependencies

  • inquire – Interactive CLI interface
  • serde + serde_json – JSON reading/writing
  • dirs – User configuration path handling

About

shm is a command-line tool written in Rust that makes it easy to manage a list of SSH hosts. It allows you to list, create, edit, delete, and connect to SSH hosts through an interactive terminal interface.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages