A modern command-line tool to manage your SSH connections with style. Easily manage your SSH config file with a beautiful interface.
- 🚀 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
pip install git+https://github.com/palace22/sshm.git
# 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
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'
sshm add # Interactive mode
sshm add --name myserver --host example.com --user admin --port 22 # Direct mode
sshm update myserver # Interactive mode
sshm update myserver --host new-example.com # Update specific fields
sshm remove myserver # With confirmation
sshm remove myserver --force # Force remove without confirmation
sshm connect myserver # Connect to a server using its alias
sshm connect myserver --dry-run # Show the SSH command without executing
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...
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
# 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
poetry run pytest
This project uses:
- Black for code formatting
- isort for import sorting
- mypy for type checking
- pre-commit hooks to enforce quality
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.