Skip to content
/ sshm Public

A command-line tool to manage your SSH connections.

License

Notifications You must be signed in to change notification settings

palace22/sshm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSH Manager (sshm)

A modern command-line tool to manage your SSH connections with style. Easily manage your SSH config file with a beautiful interface. Local Image PyPI version Python versions License

Features

  • 🚀 Simple and intuitive CLI interface
  • 📝 List all SSH connections in a beautiful table format
  • ➕ Add new SSH connections interactively
  • 🔄 Update existing connections
  • 🗑️ Remove connections safely
  • 🔌 Connect to hosts using simple aliases
  • 🔐 Automatic backup of SSH config file
  • 📊 Beautiful terminal UI using Rich
  • 📖 Built-in man pages and suggestions

Installation

pip install git+https://github.com/palace22/sshm.git

Quick Start

# List all connections
sshm list

# Add a new connection
sshm add

# Connect to a host
sshm connect myserver

# Update a connection
sshm update myserver

# Remove a connection
sshm remove myserver

Usage

List Connections

sshm list  # List all connections in a table
sshm list --format json  # Output in JSON format
sshm list --search prod  # Search for connections containing 'prod'

Add Connection

sshm add  # Interactive mode
sshm add --name myserver --host example.com --user admin --port 22  # Direct mode

Update Connection

sshm update myserver  # Interactive mode
sshm update myserver --host new-example.com  # Update specific fields

Remove Connection

sshm remove myserver  # With confirmation
sshm remove myserver --force  # Force remove without confirmation

Connect

sshm connect myserver  # Connect to a server using its alias
sshm connect myserver --dry-run  # Show the SSH command without executing

SSH Config Format

The tool manages connections in your SSH config file (~/.ssh/config). Each entry follows this format:

Host myserver
    HostName example.com
    User admin
    Port 22
    IdentityFile ~/.ssh/id_rsa
    # Additional SSH options...

Configuration

SSH Manager respects your existing SSH config file and makes safe modifications. Configuration options:

# Set default SSH key
sshm config set default_key ~/.ssh/id_rsa

# Set backup directory
sshm config set backup_dir ~/.ssh/backups

# Enable/disable automatic backups
sshm config set auto_backup true

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/ssh-manager
cd ssh-manager

# Install poetry
curl -sSL https://install.python-poetry.org | python3 -

# Install dependencies
poetry install

# Setup pre-commit hooks
poetry run pre-commit install

Running Tests

poetry run pytest

Code Style

This project uses:

  • Black for code formatting
  • isort for import sorting
  • mypy for type checking
  • pre-commit hooks to enforce quality

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

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

Acknowledgments

  • Typer for the CLI interface
  • Rich for beautiful terminal formatting
  • paramiko for SSH functionality

About

A command-line tool to manage your SSH connections.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages