PitchHut logo
Effortlessly manage remote servers over SSH with Python.
Pitch

Remote CMD is a lightweight Python CLI and API designed for seamless SSH server management. With features like SSH connection management, batch command execution, and file transfer, it simplifies server operations. Ideal for quick, ad-hoc tasks without the complexity of traditional tools, it’s efficient and easy to set up.

Description

Remote CMD is an efficient Python command-line interface (CLI) and API designed for seamless management of SSH servers. It simplifies server administration by enabling users to add hosts, execute commands, and transfer files with ease, all while supporting group targeting through tagging systems without the complexity of traditional tools like Ansible or shell loops.

Key Features

  • Host Management: Easily add, remove, and organize hosts using built-in tag groups for quick access.
  • Batch Operations: Run commands simultaneously across multiple servers with the batch-run feature, helping streamline operations and save time.
  • File Transfer: Built-in capabilities for uploading and downloading files via SFTP, simplifying file management tasks.
  • Python API Integration: A fully functional Python API allows for programmatic access and automation, making it easy to integrate Remote CMD into existing workflows.
  • Zero Setup Required: Quick installation via pip install remote_cmd_manager provides a hassle-free experience to start managing servers immediately.
  • Low Learning Curve: Designed to be intuitive, making server management accessible for users at all technical levels.

Use Cases

  • System Administration: Quickly check disk space across multiple servers:
    remote-cmd batch-run -t production "df -h / | tail -1"
    
  • Deployment Tasks: Update application code and restart services on staging servers using a simple Python script:
    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: Efficiently check logs across all servers to diagnose issues:
    remote-cmd batch-run -t web "journalctl -xe -n 50 | grep -i error"
    
  • Configuration Updates: Upload new configuration files and reload services seamlessly:
    scp nginx.conf user@server:/tmp/nginx.conf
    remote-cmd run web-01 "sudo cp /tmp/nginx.conf /etc/nginx/nginx.conf && sudo nginx -t && sudo systemctl reload nginx"
    

Usage Examples

Using Remote CMD for direct command execution or file management can enhance operational efficiency and accuracy, especially in multi-server environments. With robust features and simplicity at its core, Remote CMD is an indispensable tool for anyone needing a reliable solution for SSH server management.

For more detailed instructions and advanced usage patterns, explore the comprehensive documentation available in the repository.

0 comments

No comments yet.

Sign in to be the first to comment.