Remote CMD — SSH Server Management
Without the Overhead
pip install remote_cmd_manager ·
Quick Start ·
Use Cases ·
Python API ·
Docs ·
Contributing
Remote CMD is a lightweight Python CLI + API for managing servers over SSH. Add hosts, run commands, transfer files, and target groups by tags — no Ansible DSL or shell loops required.
# One command to get started
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"
Why Remote CMD?
| Feature | remote-cmd |
ssh + shell |
Ansible | Fabric |
|---|---|---|---|---|
| Host CRUD + tag groups | ✅ Built-in | ❌ Manual | ✅ Inventory | ❌ |
| Batch commands across hosts | ✅ batch-run |
❌ Write a loop | ✅ Playbook | ✅ |
| File transfer (upload/download) | ✅ Built-in | ✅ scp | ✅ copy module | ✅ |
| Python API | ✅ from remote_cmd import ... |
❌ | ❌ YAML-only | ✅ |
| Zero setup | ✅ pip install → go |
❌ Config SSH | ❌ ansible.cfg |
❌ |
| Learning curve | Low | Low | High | Medium |
Use remote-cmd when you need a CLI that works immediately for ad-hoc SSH tasks. Use Ansible when you need full configuration management and idempotent playbooks.
Quick Start
# 1. Install
pip install remote_cmd_manager
# 2. Add a server
remote-cmd host add web-01 192.168.1.10 ubuntu --key ~/.ssh/id_rsa
# 3. Run a command
remote-cmd run web-01 "uptime"
# 4. Run across all production servers
remote-cmd batch-run -t production "df -h /"
Use Cases
🖥️ System Admin — Check disk across 20 servers in one command
remote-cmd batch-run -t production "df -h / | tail -1"
# Output:
# ✓ web-01 → /dev/sda1 32G 12G 19G 40% /
# ✓ web-02 → /dev/sda1 32G 28G 3G 90% / ⚠️
# ✗ db-01 → Connection refused
🚀 Deploy — Pull code and restart service
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")
🔥 Incident Response — Check logs across all servers
remote-cmd batch-run -t web "journalctl -xe -n 50 | grep -i error"
🔧 Config Update — Upload and reload nginx across tagged hosts
# Upload new config
scp nginx.conf user@server:/tmp/nginx.conf # or use the upload command
remote-cmd run web-01 "sudo cp /tmp/nginx.conf /etc/nginx/nginx.conf && sudo nginx -t && sudo systemctl reload nginx"
Python API
Use Remote CMD inside your own scripts and automation:
from remote_cmd.core.ssh_client import SSHClient, ConnectionConfig
config = ConnectionConfig(
hostname="192.168.1.100",
username="ubuntu",
key_filename="~/.ssh/id_rsa",
)
with SSHClient(config) as client:
# Execute commands
result = client.execute("uptime")
print(result.stdout)
# Transfer files
client.upload_file("./local.txt", "/remote/path/file.txt")
client.download_file("/remote/path/file.txt", "./local.txt")
# List remote directory
for entry in client.list_remote_directory("/var/log"):
print(f"{entry['name']}: {entry['size']} bytes")
Features
| Category | Details |
|---|---|
| SSH Auth | Password + key file + ssh-agent |
| Commands | Single, multi-line, sudo with password |
| File Transfer | Upload/download via SFTP |
| Host Management | CRUD with JSON/YAML persistence |
| Tag System | Filter hosts by tag (e.g., production, web, db) |
| Batch Ops | Run commands across any host group |
| Connection Test | Ping all hosts and report status |
| Type Safety | Full type annotations + mypy strict |
Installation
# From PyPI (recommended)
pip install remote_cmd_manager
# From source
git clone git@github.com:Vae-Scrooge/remote-cmd.git
cd remote-cmd
pip install -e ".[dev]"
Documentation
| Document | Contents |
|---|---|
| API Reference | Full API docs for SSHClient, HostManager, and more |
| Quickstart Tutorial | Step-by-step walkthrough |
| Advanced Tutorial | Batch ops, error handling, production patterns |
| Development Guide | Setup dev environment, contributing |
| Troubleshooting | Common issues and solutions |
| Changelog | Release history |
| Mobile Remote Guide | Manage servers from your phone |
Project Status
Beta. The core API is stable. Breaking changes will be communicated via semantic versioning.
Roadmap:
- Async SSH operations (parallel execution)
- Configuration profiles (AWS, GCP, custom)
- Output formatting (JSON, table)
Contributing
We welcome contributions! See CONTRIBUTING.md to get started.
Before contributing, please read our Code of Conduct.
License
MIT © Vae-Scrooge
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file remote_cmd_manager-1.1.0.tar.gz.
File metadata
- Download URL: remote_cmd_manager-1.1.0.tar.gz
- Upload date:
- Size: 95.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f4dceb6fd3953e94e2d98589c544e01383a964c34c20a65d311b90523dc371e
|
|
| MD5 |
230f81415765bfea3dcb8fd6964227e8
|
|
| BLAKE2b-256 |
0a58cd9818c9959d123fa823c67833a002ebc52cc722b12612ae06d59f602f31
|
Provenance
The following attestation bundles were made for remote_cmd_manager-1.1.0.tar.gz:
Publisher:
publish.yml on Vae-Scrooge/remote-cmd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
remote_cmd_manager-1.1.0.tar.gz -
Subject digest:
9f4dceb6fd3953e94e2d98589c544e01383a964c34c20a65d311b90523dc371e - Sigstore transparency entry: 2309801273
- Sigstore integration time:
-
Permalink:
Vae-Scrooge/remote-cmd@da55dc2647c691a90f41022769c880094becb666 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Vae-Scrooge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da55dc2647c691a90f41022769c880094becb666 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file remote_cmd_manager-1.1.0-py3-none-any.whl.
File metadata
- Download URL: remote_cmd_manager-1.1.0-py3-none-any.whl
- Upload date:
- Size: 61.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1cb74acc35263cc8882a78c807124c9e00862669ba67d0c0196ee17c10cf455
|
|
| MD5 |
0c896a2b1321fe49c26a764c354f386e
|
|
| BLAKE2b-256 |
c00a43f1008bfddbaf4ca5e46a98a36c2171ef3d79e1360c52a55a02f55abc65
|
Provenance
The following attestation bundles were made for remote_cmd_manager-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on Vae-Scrooge/remote-cmd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
remote_cmd_manager-1.1.0-py3-none-any.whl -
Subject digest:
a1cb74acc35263cc8882a78c807124c9e00862669ba67d0c0196ee17c10cf455 - Sigstore transparency entry: 2309801278
- Sigstore integration time:
-
Permalink:
Vae-Scrooge/remote-cmd@da55dc2647c691a90f41022769c880094becb666 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Vae-Scrooge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da55dc2647c691a90f41022769c880094becb666 -
Trigger Event:
workflow_dispatch
-
Statement type: