Installation

Download and run the installer, then reload your shell:

curl -s https://raw.githubusercontent.com/DimitriGilbert/sshm0/main/utils/get_sshm0 -O
chmod +x get_sshm0
./get_sshm0 --install
source ~/.bashrc

The installer clones the repo and appends shell integration to your bashrc. Run ./get_sshm0 --help for other options (custom directory, SSH clone, specific branch).

Manual install:

git clone https://github.com/DimitriGilbert/sshm0.git
cd sshm0
echo 'export SSHM0_ROOT_DIR="$(pwd)"' >> ~/.bashrc
echo 'source "$(pwd)/sshm0.rc"' >> ~/.bashrc
source ~/.bashrc

Quick Start

Add a server and connect. That's it.

terminal

You can also tag servers and filter them later:

sshm0 add staging 10.0.0.5 root --auth password --password secret --port 2222
sshm0 connect staging

sshm0 add db1 db.example.com admin --tag production,database
sshm0 list --tag production --long

add

Save a new server configuration. Run with no arguments for interactive mode — it prompts for each field.

sshm0 add <name> <ip> <user> [options]
FlagDescription
-p, --passwordPassword for the server
-i, --keyPath to SSH private key
-a, --authAuth type: key or password
-P, --portSSH port (default: 22)
-t, --tagComma-separated tags
-f, --forceOverwrite if server exists
-c, --connectConnect immediately after adding
terminal

connect

Open an SSH session to a saved server.

sshm0 connect <name> [--cd <dir>] [--exec-before <cmd>] [command...]
FlagDescription
--cdRemote directory to cd into
--exec-beforeCommand(s) to run before shell (repeatable)

Trailing arguments are passed as the remote command.

terminal

cp

Copy files between local and remote. Uses scp under the hood. Prefix server paths with <name>:.

sshm0 cp <source> <destination>
terminal

list

Show saved servers. Filter by tag or name.

sshm0 list [options]
FlagDescription
-t, --tagFilter by tag
-f, --filterFilter by name (case-insensitive substring)
-l, --longShow IP, user, and tags
-r, --recentSort by last connected
terminal

edit

Change fields on a saved server.

sshm0 edit <name> [options]
FlagDescription
--ipNew IP address
--userNew username
-p, --passwordNew password
-i, --keyNew key path
--authNew auth type
--portNew port
-t, --tagNew tags
-c, --connectConnect after editing
sshm0 edit web1 --port 2222
sshm0 edit web1 --user deploy --tag prod,web

remove

Delete a saved server.

sshm0 remove <name>

rename

Rename a saved server.

sshm0 rename <old_name> <new_name>

show

Display the full stored configuration for a server.

sshm0 show <name>

export

Generate a standard SSH config file from all managed servers. Key-auth servers include IdentityFile; password-auth servers get a comment noting to use sshm0 connect.

sshm0 export [options]
FlagDescription
-o, --outputOutput file path (default: ~/.ssh/config.d/sshm0)
--mergeAppend instead of overwriting
terminal

Include it in your main SSH config:

Include config.d/*

ping

Test SSH connectivity to a managed server.

sshm0 ping <name>

doctor

Run self-test checks on the sshm0 environment — verifies config directory, server files, and required tools.

sshm0 doctor

plugin

Run a registered plugin. Plugins are external scripts declared in the config file.

sshm0 plugin <plugin_name> [arguments]

Configuration

All config lives in ~/.config/sshm0/ by default. Override with --config-dir on any command.

~/.config/sshm0/
  config          # Global config (plugin declarations, version)
  servers/        # One file per server
  history         # Connection timestamps

Server config format

Each server is a file in servers/ named after the server. Contents are shell variables:

sshm0_server_ip=192.168.1.25
sshm0_server_user=deploy
sshm0_server_port=22
sshm0_server_auth=key
sshm0_server_password=
sshm0_server_key=/home/you/.ssh/id_rsa
sshm0_server_cd=
sshm0_server_exec_before=()
sshm0_server_tags=(production web)

Global config

sshm0_config_version=2
declare -A sshm0_plugins
# sshm0_plugins["myplugin"]="/path/to/plugin/script"

Plugins

Plugins receive $SSHM0_CONFIG_DIR and $SSHM0_ROOT_DIR as environment variables. Register them in ~/.config/sshm0/config:

sshm0_plugins["backup"]="/usr/local/bin/sshm0-backup"

Then run:

sshm0 plugin backup --all

Plugin scripts can be written in any language. parseArger can generate the argument parsing for Bash plugins.

Shell Completion

sshm0 ships with completely-based Bash completion. The installer sources sshm0.rc, which loads completely.bash. This provides tab completion for:

  • All subcommands
  • Server names (from your config)
  • SSH key paths
  • Flags and options

No additional setup required after installation.

Requirements

  • Bash 4.0+ (uses associative arrays)
  • ssh / scp
  • Standard Unix tools (date, mktemp, setsid)