You SSH into 10 servers to check disk space. You write a quick for loop. A typo crashes one session. You're not sure which ones you've already checked. By the time you're done, 20 minutes are gone and you have a terminal full of scrollback you need to piece together.
There's a better way.
Most developers SSH into servers one at a time. When you need to run the same command across multiple machines, your options are:
for host in web-01 web-02 ...; do ssh $host "df -h"; done — works until a host is down and your loop breaksNone of these give you a simple CLI that just works out of the box.
remote-cmd is a Python CLI + API for SSH server management. It gives you:
production, staging, web, db)pip install and go$ pip install remote_cmd_manager
$ remote-cmd host add web-01 192.168.1.10 ubuntu --key ~/.ssh/id_rsa
$ remote-cmd run web-01 "uptime"
→ 14:32:10 up 45 days, 2:15, 1 user, load average: 0.08, 0.03, 0.05
$ remote-cmd host add web-02 192.168.1.11 ubuntu --key ~/.ssh/id_rsa --tag production
$ remote-cmd host add db-01 192.168.1.20 ubuntu --key ~/.ssh/id_rsa --tag production --tag database
$ remote-cmd batch-run -t production "df -h /"
✓ web-01 → Disk: 32G/100G (32%)
✓ web-02 → Disk: 45G/100G (45%)
✓ db-01 → Disk: 12G/50G (24%)
$ remote-cmd batch-run -t web "journalctl -xe -n 50 | grep -i error"
$ cat deploy.py
from remote_cmd.core.host_manager import HostManager
manager = HostManager("hosts.json")
for host in manager.list_hosts(tag="staging"):
with manager.connect_to_host(host.name) as client:
client.execute("cd /app && git pull")
client.execute("pip install -r requirements.txt")
client.execute_sudo("systemctl restart app", password="sudopass")
$ remote-cmd upload web-01 ./nginx.conf /tmp/nginx.conf
$ remote-cmd run web-01 "sudo cp /tmp/nginx.conf /etc/nginx/nginx.conf && sudo nginx -t && sudo systemctl reload nginx"
| remote-cmd | ssh + shell | Ansible | Fabric | |
|---|---|---|---|---|
| Setup time | 10 seconds | None (you know ssh) | 30 min+ | 5 min |
| Host management | Built-in | Manual | Inventory YAML | Manual |
| CLI | Yes | Yes | ansible cmd | fab cmd |
| Python API | Yes | No | No (YAML) | Yes |
| Ideal for | Ad-hoc + scripts | One-off | Config mgmt | Python scripts |
$ pip install remote_cmd_manager
$ remote-cmd --help
$ remote-cmd host add my-server 192.168.1.100 ubuntu --key ~/.ssh/id_rsa
$ remote-cmd run my-server "uptime"
The project is in beta, the core API is stable, and contributions are welcome.
If you SSH into more than a couple servers regularly, give it a try. It'll save you the "which servers did I check again?" moment.