# ๐ช Portkey - Magical SSH Portal Manager
> *"I solemnly swear I am up to no good... with server management"*
Like the Marauder's Map from Harry Potter, **Portkey** is your magical gateway to instantly teleport between servers without memorizing passwords. One master spell (password) unlocks a hidden world of secure SSH connections, transforming the mundane task of server management into an enchanting experience.
## โจ What Makes Portkey Magical?
Imagine having a magical map that reveals all your servers at once, and with a simple incantation, **whoosh** โ you're instantly connected. Portkey is that map, but for SSH connections. Instead of fumbling with cryptic incantations (passwords), you speak one master spell and gain access to your entire server kingdom.
**๐งโโ๏ธ The Magic Behind the Spell:**
- **Alohomora for SSH**: One master password unlocks all your server credentials
- **Marauder's Map for DevOps**: Visualize all your servers in a TUI
- **Apparition for SSH**: Instantly teleport to any server with a single command
- **Fidelius Charm**: Strong encryption keeps your secrets safe
## ๐ช How the Magic Works
### 1. **Create Your Magical Vault** โจ
```bash
./portkey init # Cast the creation spell
# Enter your master password - this becomes your magical key
```
### 2. **Populate Your Magical Map** ๐บ๏ธ
```bash
./portkey add # Reveal new servers to your map
# Name: production-web
# Host: 192.168.1.100
# Password: โขโขโขโขโขโขโขโข
# Description: The castle's main gate
```
### 3. **Navigate Your Wizarding World** ๐งญ
```bash
./portkey quick # TUI (ratatui) with fuzzy search
# Type to filter, โ/โ to select, โต to connect, q to quit
# ๐ช *Poof* - You're connected!
```
### 4. **Search Like a True Wizard** ๐
```bash
./portkey search web # Fuzzy search across names/hosts/users/descriptions
./portkey search prod
```
### 5. **Export SSH Config** ๐งท
```bash
# Preview entries to add to ~/.ssh/config
./portkey ssh-config
# Append entries directly to ~/.ssh/config
./portkey ssh-config --write
```
## ๐ฎ Magical Features
| Spell | Effect |
|-------|--------|
| `init` | **Creation Charm** - Forge your magical vault |
| `add` | **Revelation Spell** - Add new servers to your map |
| `quick` | **Apparition** - Instant teleportation to any server |
| `list` | **Marauder's Map** - View all accessible servers |
| `search` | **Point Me** - Find servers by keyword |
| `remove` | **Obliviate** - Banish servers from your map |
## ๐ก๏ธ Protective Enchantments
- **๐ Sealed Vault**: XSalsa20-Poly1305 (libsodium SecretBox)
- **๐๏ธ Master Key**: Argon2id key derivation with per-vault salt
- **๐งน Memory Charms**: Zeroizes sensitive data from memory
- **๐ช Restricted Access**: File permissions locked to owner only (600)
- **โก Unbreakable Vow**: Rust's memory safety prevents dark magic
## ๐ Install
- Cargo (Rust):
- `cargo install ssh-portkey` # installs the `portkey` binary
- Homebrew (tap):
- `brew tap your-org/tap`
- `brew install portkey`
Note: On first use, you may want to install `sshpass` for password-based SSH, or preferably set up SSH keys.
## ๐ Quick Start - Become a Wizard in 60 Seconds
```bash
# โก Install (via cargo)
cargo install ssh-portkey
# ๐ช Create your vault (choose your master spell)
./portkey init
# ๐บ๏ธ Add your first server
./portkey add
# โจ Launch the TUI
./portkey
```
## ๐ Magical Use Cases
### ๐ฐ **The Digital Castle Manager**
You're the keeper of a vast digital castle with dozens of towers (servers). Instead of memorizing the secret password to each tower, you have one master key that opens them all. Walk through your kingdom with ease!
### ๐งโโ๏ธ **The DevOps Sorcerer**
Juggle multiple environments like a true wizard. Production, staging, development - all accessible with a flick of your terminal wand. No more "Accio production server!" followed by frantic password hunting.
### ๐ต๏ธ **The Infrastructure Detective**
Search your entire infrastructure like you're using the Marauder's Map. "I solemnly swear I need to find all web servers" - and there they are, revealed in all their glory.
## ๐ Spell Book (Command Reference)
```bash
# Basic Spells
./portkey init # Create your magical vault
./portkey add # Add a new server to your map
./portkey list # View all enchanted servers
./portkey quick # Interactive teleportation
./portkey connect web01 # Direct teleport to specific server
./portkey search web # Find servers by magic keyword
./portkey remove web01 # Remove server from your map
# Advanced Sorcery
./portkey debug # Reveal vault diagnostics
```
## ๐งช Magical Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Portkey Spell Book โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ Crypto: SecretBox + Argon2id โ
โ ๐๏ธ Storage: Encrypted JSON vault โ
โ ๐ Search: Fuzzy matching across all โ
โ ๐ SSH: Password-based authentication โ
โ ๐จ CLI: Enchanted interactive prompts โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
## ๐ช Behind the Magic
When you type a password, Portkey performs an ancient ritual:
1. **Derives a key** from your password using Argon2id
2. **Unseals the vault** using SecretBox (XSalsa20-Poly1305)
3. **Reveals your servers** in a fast TUI with fuzzy search
4. **Teleports you instantly** via SSH with stored credentials
## ๐ญ Role-Playing Guide
| **System Admin** | One ring to rule them all |
| **DevOps Wizard** | Teleportation mastery |
| **Security Mage** | Fort Knox for passwords |
| **Productivity Sorcerer** | Zero-friction connections |
## ๐ From Muggles to Wizards
**Before Portkey:**
```
โ "What's the password for prod-web-03 again?"
โ Searching through spreadsheets of credentials
โ Copy-pasting passwords like a Muggle
โ Managing 47 different SSH keys
```
**After Portkey:**
```
โ
One password, unlimited access
โ
Magical server discovery
โ
Instant teleportation
โ
Secure, encrypted storage
โ
"Accio server!" actually works
```
---
<p align="center">
<i>"Mischief managed." - Every DevOps wizard using Portkey</i>
</p>
## ๐ช Ready to Start Your Magical Journey?
```bash
git clone <repository>
cd portkey
./install.sh
./portkey init
```
*May your connections be swift and your servers ever responsive.*