Skip to content

Lightweight SSH-based tool to run common network commands (ping, nslookup, etc.) remotely from any Windows or Linux client.

License

Notifications You must be signed in to change notification settings

michaelklose/remote-cli-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remote-cli-runner

remote-cli-runner (rcr) is a lightweight, cross-platform SSH-based tool that lets you run common network and diagnostic commands (e.g., ping, nslookup, or arbitrary shell commands) on a remote host, while using a simple local CLI.

It works on:

  • Linux
  • Windows (PowerShell / CMD)
  • macOS (optional)

rcr is a single CLI entrypoint:

rcr ping ...
rcr nslookup ...
rcr <any-command> ...

📁 Configuration (~/.remote-cli-runner.ini)

Before using rcr, create a configuration file in your home directory.

Linux / macOS

~/.remote-cli-runner.ini

Windows

C:\Users\<YourUser>\.remote-cli-runner.ini

Configuration example (Linux/macOS)

[remote]
host = your.server.com
user = yourusername
key  = /home/yourusername/.ssh/id_ed25519
port = 22

Configuration example (Windows)

[remote]
host = server.example.com
user = michael
key  = C:\Users\michael\.ssh\rcr
port = 22

key must point to a valid SSH private key.


🚀 Commands

🔹 Ping (executed on remote host)

Linux / macOS remote host

rcr ping 8.8.8.8 -c 4

Windows remote host

rcr ping 8.8.8.8 -n 4

🔹 nslookup (remote)

rcr nslookup example.com

🔹 Generic remote commands

Any command that is not ping or nslookup is treated as a generic remote command.

rcr uname -a
rcr whoami
rcr ls -la /var/log
rcr systemctl status ssh

This allows you to use rcr as a simple SSH-based remote command runner.


🧩 Installation / Usage

Clone the repository:

git clone https://github.com/<yourname>/remote-cli-runner
cd remote-cli-runner

Running directly with Python

Linux / macOS

python3 rcr.py ping 8.8.8.8 -c 4

Windows

python rcr.py ping 1.1.1.1 -n 4

You can also make the script executable and put it in your PATH as rcr.


📦 Building native binaries (Linux & Windows)

rcr can be compiled into standalone executables using PyInstaller, so Python is not required on the target machine.

Install PyInstaller:

pip install pyinstaller

Build a standalone binary on Linux

pyinstaller --onefile rcr.py

Output:

dist/rcr

Build a standalone binary on Windows

pyinstaller --onefile rcr.py

Output:

dist\rcr.exe

Copy the resulting binary to a directory in your PATH for global usage.


💡 Future improvements

  • Support for multiple remote profiles (--profile prod)
  • Automatic Windows remote host detection for ping options (-c vs -n)
  • Verbose / debug mode
  • Parallel execution on multiple hosts
  • Additional built-in helpers (traceroute, dig, netstat, etc.)

📝 Summary

remote-cli-runner provides:

  • A simple, unified CLI (rcr) for running commands on a remote machine
  • A clean .ini config file in the user home directory
  • Cross-platform support (Linux, Windows, macOS)
  • Optional standalone binaries via PyInstaller

A minimal tool with maximal usefulness — ideal for network diagnostics, server access, and automation.

About

Lightweight SSH-based tool to run common network commands (ping, nslookup, etc.) remotely from any Windows or Linux client.

Resources

License

Stars

Watchers

Forks

Languages