A Rust command-line utility that automates SSH key management and Google Cloud VM access with a rich, interactive terminal interface.
- 🔑 Automatic SSH Key Management: Checks for an existing SSH key pair and generates one if needed.
- 📋 Interactive VM Selection: Displays a list of your Google Cloud VMs with their details for easy selection.
- 🔒 Secure Key Deployment: Automatically copies your public SSH key to the selected VM.
- 🖥️ Ready-to-Use SSH Command: Generates the exact SSH command you need to connect to your VM.
- 🎨 Rich Terminal Interface: Beautiful ASCII art, animations, and color-coded information.
Before using this tool, ensure you have:
- Rust and Cargo installed
- Google Cloud SDK (gcloud CLI) installed and configured
- Active Google Cloud project with compute instances
Run the setup script to build, install, and configure your PATH in one step:
./setup.shFor more control, use the Makefile:
# Build in debug mode
make
# Build optimized release
make release
# Install to ~/.local/bin
make installType make help to see all available commands.
If you prefer to install manually:
# Build the release version
cargo build --release
# Copy to a directory in your PATH
mkdir -p ~/.local/bin
cp target/release/hcloud ~/.local/bin/gcloud-ssh
chmod +x ~/.local/bin/gcloud-ssh
# Add to PATH if needed
echo 'export PATH=$PATH:~/.local/bin' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc # or ~/.bashrcRun the application:
gcloud-sshCommand-line options:
# Show help
gcloud-ssh --help
# Show version
gcloud-ssh --version
# Check for updates
gcloud-ssh --updateThe application will guide you through:
- 🔍 Checking/generating SSH keys
- 📊 Listing available VM instances
- 🔖 Selecting a VM to connect to
- 📤 Copying your SSH key to the VM
- 📝 Showing the exact SSH command to connect
- The tool checks if you have an SSH key pair in
~/.ssh/id_rsaand~/.ssh/id_rsa.pub. - If no key exists, it generates a new key pair using
gcloud compute ssh-keys create. - It retrieves your VM instances using
gcloud compute instances list. - It displays an interactive selection menu with your VMs.
- Once you select a VM, it copies your public key to the VM's
~/.ssh/authorized_keysfile. - Finally, it shows you the exact SSH command to connect.
The application includes:
- 📊 ASCII Art Banner: Beautiful welcome banner
- 🎬 Animations: Typing effects, spinners, and progress bars
- 🎨 Color-Coded Information: Different colors for different types of information
- 📦 Boxed Messages: Important information displayed in stylish boxes
Modify the config.rs file to customize:
- Animation Settings: Enable/disable animations and timing
- Color Schemes: Change the color theme
- Emojis: Customize emojis used for different messages
If you encounter issues:
- Ensure you're authenticated with gcloud:
gcloud auth login - Verify your active project:
gcloud config get-value project - Check VM access permissions in Google Cloud Console
- Run with verbose output:
RUST_LOG=debug gcloud-ssh
I'm Hamze Ghalebi, CTO at Remolab, passionate about building tools that improve developer workflows. This Google Cloud SSH Manager is part of a collection of tools I originally built for my own use, and I've decided to open source it in case others find it helpful.
Many of the tools I create solve specific pain points in my daily workflow with cloud infrastructure and development environments. If you have any feedback or suggestions for improvements, please feel free to contribute!
If you find this tool useful, please consider sponsoring me on GitHub to support continued development and maintenance.
This project is licensed under the MIT License - see the LICENSE file for details.