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 ~/.bashrcThe 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 ~/.bashrcQuick Start
Add a server and connect. That's it.
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 --longadd
Save a new server configuration. Run with no arguments for interactive mode — it prompts for each field.
sshm0 add <name> <ip> <user> [options]| Flag | Description |
|---|---|
-p, --password | Password for the server |
-i, --key | Path to SSH private key |
-a, --auth | Auth type: key or password |
-P, --port | SSH port (default: 22) |
-t, --tag | Comma-separated tags |
-f, --force | Overwrite if server exists |
-c, --connect | Connect immediately after adding |
connect
Open an SSH session to a saved server.
sshm0 connect <name> [--cd <dir>] [--exec-before <cmd>] [command...]| Flag | Description |
|---|---|
--cd | Remote directory to cd into |
--exec-before | Command(s) to run before shell (repeatable) |
Trailing arguments are passed as the remote command.
cp
Copy files between local and remote. Uses scp under the hood. Prefix server paths with <name>:.
sshm0 cp <source> <destination>list
Show saved servers. Filter by tag or name.
sshm0 list [options]| Flag | Description |
|---|---|
-t, --tag | Filter by tag |
-f, --filter | Filter by name (case-insensitive substring) |
-l, --long | Show IP, user, and tags |
-r, --recent | Sort by last connected |
edit
Change fields on a saved server.
sshm0 edit <name> [options]| Flag | Description |
|---|---|
--ip | New IP address |
--user | New username |
-p, --password | New password |
-i, --key | New key path |
--auth | New auth type |
--port | New port |
-t, --tag | New tags |
-c, --connect | Connect after editing |
sshm0 edit web1 --port 2222
sshm0 edit web1 --user deploy --tag prod,webremove
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]| Flag | Description |
|---|---|
-o, --output | Output file path (default: ~/.ssh/config.d/sshm0) |
--merge | Append instead of overwriting |
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 doctorplugin
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 timestampsServer 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 --allPlugin 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)