Skip to main content

A feature-rich SSH server management CLI tool

Project description

๐Ÿš€ OmniHost

High-Performance SSH Management CLI for DevOps Engineers

Python License: MIT Code style: black PRs Welcome

Manage hundreds of servers with lightning-fast parallel execution, beautiful CLI output, and DevOps-focused shortcuts.

Features โ€ข Installation โ€ข Quick Start โ€ข Documentation โ€ข Contributing


โšก Highlights

# Quick start
omnihost --version              # Check version
omnihost examples               # See usage examples

# Server Groups - organize your infrastructure
omnihost group add web web01 web02 web03
omnihost exec-group web "systemctl restart nginx"
omnihost exec-group web "uptime" --dry-run  # Preview first!

# Command Aliases - reduce repetitive typing
omnihost alias add restart-nginx "sudo systemctl restart nginx"
omnihost exec-group web restart-nginx

# File Transfer - push/pull files easily
omnihost push web01 ./app.tar /opt/app/
omnihost pull db01 /var/log/mysql.log ./logs/
omnihost push web01 ./dist /var/www/ --recursive

# Execute on all servers in parallel - 10x faster, with retry & dry-run
omnihost exec-all "systemctl status nginx" --parallel 10 --retries 2 --dry-run
omnihost exec-all "uptime" --json | jq '.succeeded'  # CI/CD integration

# Quick DevOps shortcuts - no need to type full exec commands
omnihost uptime  # Uses default server
omnihost disk web01
omnihost memory db01

# Beautiful, formatted output with Rich library
omnihost list  # Stunning table view of all servers

# Enhanced logging for troubleshooting
omnihost --verbose exec web01 "ls -la"
omnihost --debug exec-all "uptime"

# Audit logging - all commands tracked automatically
cat ~/.omnihost/audit.log  # JSON audit trail

๐ŸŽฏ Why OmniHost?

Problem Traditional Approach OmniHost
Check 20 servers 20 ร— 3s = 60 seconds 12 seconds (parallel)
Type repetitive commands ssh user@host 'uptime' omnihost uptime
Manage server configs Edit ~/.ssh/config manually Interactive omnihost add
View command output Plain text Beautiful formatted panels
Execute on multiple servers Write bash loops omnihost exec-all

โœจ Features

๐Ÿ–ฅ๏ธ Server Management

  • Add/Edit/Remove servers with interactive prompts
  • List all configured servers with beautiful table view
  • Info command with connection testing
  • Integrates with SSH config (~/.ssh/config)

โšก Performance Features

  • Parallel execution on multiple servers (5-20x faster)
  • Bulk operations (exec-all, exec-multi)
  • Quick commands for common DevOps tasks
  • Default server configuration (no need to specify every time)
  • Connection pooling and caching

๐ŸŽจ Beautiful CLI

  • Rich formatted output with colors and panels
  • Progress bars for bulk operations
  • Interactive prompts with validation
  • Clean, organized command structure

๐Ÿ” Security

  • SSH key authentication support
  • No password storage
  • Respects SSH config security settings
  • Connection timeout management

๐Ÿ“ฆ Installation

From Source

# Clone the repository
git clone https://github.com/sagar.memane/omnihost.git
cd omnihost

# Create virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install
pip install -e .

Requirements

  • Python 3.8 or higher
  • SSH access to remote servers
  • SSH keys configured (recommended)

๐Ÿš€ Quick Start

1. Add Your First Server

omnihost add
# Follow interactive prompts

Or use command-line options:

omnihost add -a web01 -h 192.168.1.100 -u ubuntu --key ~/.ssh/id_rsa

2. List Servers

omnihost list           # Basic view
omnihost list -v        # Verbose with SSH keys

3. Set Default Server (Optional)

omnihost config set-default web01
# Now you can use: omnihost uptime (without specifying server)

4. Execute Commands

# Single server
omnihost exec web01 "df -h"

# All servers (parallel)
omnihost exec-all "uptime"

# Specific servers
omnihost exec-multi "web01,web02,db01" "systemctl status nginx"

5. Quick DevOps Commands

omnihost uptime web01          # Quick uptime
omnihost disk web01            # Disk usage
omnihost memory web01          # Memory usage
omnihost processes web01       # Top processes
omnihost status web01 nginx    # Service status
omnihost logs web01 nginx      # View logs

6. Interactive Shell

omnihost connect web01
# Full PTY support - run vim, htop, top, etc.

๐Ÿ“– Documentation

๐ŸŽฏ Common Use Cases

Daily Operations

# Morning health check
omnihost exec-all "uptime && free -h" --parallel 10

# Check disk space across infrastructure
omnihost exec-all "df -h /" --no-output | grep "9[0-9]%"

Deployments

# Deploy to web servers
omnihost exec-multi "web01,web02,web03" \
  "cd /app && git pull && systemctl restart app" --parallel 3

# Verify deployment
omnihost exec-multi "web01,web02,web03" "curl -s localhost/health"

Troubleshooting

# Quick diagnostics
omnihost memory prod01
omnihost processes prod01
omnihost logs prod01 nginx -n 100

# Check all servers for issues
omnihost exec-all "systemctl is-failed --quiet || echo 'Services OK'"

๐Ÿ—๏ธ Project Structure

omnihost/
โ”œโ”€โ”€ __init__.py              # Package metadata  
โ”œโ”€โ”€ cli.py                   # CLI entry point
โ”œโ”€โ”€ config.py                # Configuration management
โ”œโ”€โ”€ ssh_config.py            # SSH config operations
โ”œโ”€โ”€ ssh_client.py            # Connection management
โ”œโ”€โ”€ performance.py           # Caching & optimization
โ””โ”€โ”€ commands/                # Command modules
    โ”œโ”€โ”€ server_management.py # list, add, edit, remove, info
    โ”œโ”€โ”€ exec_command.py      # Remote execution
    โ”œโ”€โ”€ connect_command.py   # Interactive shell
    โ”œโ”€โ”€ bulk_operations.py   # exec-all, exec-multi
    โ”œโ”€โ”€ quick_commands.py    # Quick DevOps shortcuts
    โ””โ”€โ”€ config_command.py    # Configuration management

๐Ÿค Contributing

  • ๐Ÿ“‹ Beautiful table formatting for server lists
  • โ„น๏ธ Server information - View details and test connections
  • ๐Ÿ”ง SSH config integration - Works with ~/.ssh/config
  • ๐ŸŽจ Rich formatting - Color-coded output and panels
  • ๐Ÿ’พ Persistent storage - All config saved to SSH config file
  • ๐Ÿ” SSH key support - Use identity files for authentication

๐Ÿ“š Commands Reference

Command Description Example
list Show all configured servers omnihost list -v
add Add a new server omnihost add -a web01 -h 1.2.3.4 -u ubuntu
info Show server details omnihost info myserver
edit Edit server configuration omnihost edit myserver
remove Remove a server omnihost remove myserver
exec Execute command on server omnihost exec myserver "ls -la"
connect Open interactive shell omnihost connect myserver

๐Ÿ“‚ Project Structure

ServerManager/
โ”œโ”€โ”€ omnihost/                      # Main package
โ”‚   โ”œโ”€โ”€ __init__.py               # Package metadata
โ”‚   โ”œโ”€โ”€ cli.py                     # CLI entry point
โ”‚   โ”œโ”€โ”€ ssh_config.py              # SSH config operations
โ”‚   โ”œโ”€โ”€ ssh_client.py              # Connection management
โ”‚   โ”œโ”€โ”€ utils.py                   # Shared utilities
โ”‚   โ””โ”€โ”€ commands/                  # Command modules
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ server_management.py   # list, add, edit, remove, info
โ”‚       โ”œโ”€โ”€ exec_command.py        # Remote command execution
โ”‚       โ””โ”€โ”€ connect_command.py     # Interactive shell
โ”œโ”€โ”€ pyproject.toml                 # Package configuration
โ”œโ”€โ”€ requirements.txt               # Dependencies
โ”œโ”€โ”€ main.py                        # Legacy wrapper
โ”œโ”€โ”€ README.md                      # This file
โ”œโ”€โ”€ ARCHITECTURE.md                # Developer guide
โ””โ”€โ”€ QUICK_REFERENCE.md             # Quick reference

๐Ÿ”ง Development

Install in Development Mode

pip install -e .

Changes to the code are immediately reflected without reinstalling.

Run Tests

# Syntax check
python -m py_compile omnihost/*.py omnihost/commands/*.py

# Test commands
omnihost --help
omnihost list

Add New Commands

  1. Create omnihost/commands/my_command.py
  2. Import in omnihost/cli.py
  3. Register with register_my_command(app)

See ARCHITECTURE.md for details.

๐Ÿ› ๏ธ Requirements

  • Python 3.8 or higher
  • Unix-like system (Linux, macOS, WSL on Windows)
  • SSH config file at ~/.ssh/config

๐Ÿ“ SSH Config

OmniHost works with standard SSH config format:

Host myserver
    HostName 192.168.1.100
    User ubuntu
    Port 22
    IdentityFile ~/.ssh/id_rsa

Host production
    HostName prod.example.com
    User admin
    IdentityFile ~/.ssh/prod_key

OmniHost can create and manage this file for you!

๐ŸŽจ Example Sessions

Adding a Server

$ omnihost add
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Add New Server  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Server alias: web01
Hostname or IP address: 192.168.1.100
SSH username: ubuntu
SSH port [22]: 
Use SSH key file? [Y/n]: y
Path to private key [~/.ssh/id_rsa]: 

Configuration Summary:
  Alias: web01
  Hostname: 192.168.1.100
  User: ubuntu
  Port: 22
  Identity File: ~/.ssh/id_rsa

Add this server? [Y/n]: y
โœ“ Successfully added server 'web01'

Listing Servers

$ omnihost list

            Configured Servers             
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Alias  โ”‚ Hostname    โ”‚ User      โ”‚ Port โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ web01  โ”‚ 192.168.1.100โ”‚ ubuntu   โ”‚  22  โ”‚
โ”‚ db01   โ”‚ 10.0.0.5    โ”‚ postgres  โ”‚  22  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Total servers: 2

Executing Commands

$ omnihost exec web01 "df -h | head -5"

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ๐Ÿ”Œ Connecting โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Host: web01                                                 โ”‚
โ”‚ Server: ubuntu@192.168.1.100:22                            โ”‚
โ”‚ Command: df -h | head -5                                    โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โœ“ Output โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Filesystem      Size  Used Avail Use% Mounted on       โ”‚
โ”‚ /dev/sda1        50G   20G   28G  42% /                โ”‚
โ”‚ tmpfs            16G     0   16G   0% /dev/shm          โ”‚
โ”‚ /dev/sdb1       100G   45G   51G  47% /data            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

๐Ÿค Contributing

We love contributions! Here's how you can help:

  1. Star this repo โญ
  2. Report bugs via GitHub Issues
  3. Suggest features or improvements
  4. Submit Pull Requests - see CONTRIBUTING.md

Development Setup

git clone https://github.com/sagar.memane/omnihost.git
cd omnihost
python3 -m venv venv
source venv/bin/activate
pip install -e .

See CONTRIBUTING.md for detailed guidelines.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with Typer - Modern CLI framework
  • Styled with Rich - Beautiful terminal formatting
  • SSH via Paramiko - Pure Python SSH implementation

๐Ÿ“ฎ Support

๐Ÿ—บ๏ธ Roadmap

  • Server management (add, edit, remove, list)
  • Remote command execution
  • Interactive shell sessions
  • Bulk parallel operations
  • Quick DevOps shortcuts
  • Server grouping and tagging
  • Command history and replay
  • Custom command templates
  • SSH tunnel management
  • File transfer operations (SCP/SFTP)
  • Integration with cloud providers (AWS, Azure, GCP)
  • Web UI for server management
  • Ansible integration

๐Ÿ“ˆ Performance Benchmarks

Operation Sequential Parallel (--parallel 5) Speedup
10 servers uptime 30s 6s 5x
20 servers status 60s 12s 5x
50 servers check 150s 30s 5x

Tests conducted on servers with ~300ms average latency

๐Ÿ†˜ Troubleshooting

Command not found after installation

source venv/bin/activate  # Activate virtual environment
pip install -e .  # Reinstall if needed
which omnihost  # Should show path in venv

Connection issues

# Test SSH manually first
ssh -F ~/.ssh/config myserver

# Check server configuration
omnihost info myserver

Permission errors with SSH keys

chmod 600 ~/.ssh/id_rsa
chmod 700 ~/.ssh

Slow bulk operations

# Increase parallelism (default is 5)
omnihost exec-all "uptime" --parallel 10

# Reduce timeout for faster failure detection
omnihost exec-all "ping -c 1 google.com" --timeout 5

โฌ† back to top

Made with โค๏ธ for DevOps Engineers

If you find OmniHost useful, please โญ star this repository!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omnihost688-1.0.0.tar.gz (64.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnihost688-1.0.0-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file omnihost688-1.0.0.tar.gz.

File metadata

  • Download URL: omnihost688-1.0.0.tar.gz
  • Upload date:
  • Size: 64.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for omnihost688-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8408c284e664bbcc0facc8f209bcafbfeadd87f59d9ed2253db633a6602fdf14
MD5 e4b7ccd5b59355262e5bff3155e3b524
BLAKE2b-256 d848eaf5245427145e393b7323ce5b494fd40e5512d49a38521ad35fc9d9eb93

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnihost688-1.0.0.tar.gz:

Publisher: publish-to-pypi.yml on sagarmemane135/omnihost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file omnihost688-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: omnihost688-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for omnihost688-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9328b81622fa80647fde610c154173391144abe04da92e11f3fe09e5a54721c5
MD5 573411cede94b8b2838eeaa5fb513c05
BLAKE2b-256 0305c6cc4309beee2a8eaf9def2f0857dd4a5961664cc629fb536009e20f2059

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnihost688-1.0.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on sagarmemane135/omnihost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page