ssh-portkey 0.1.1

Secure SSH credential manager with a fast ratatui-based TUI, fuzzy search, and encrypted vault
Documentation
# ๐Ÿช„ 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

| Your Role | Portkey's Magic |
|-----------|-----------------|
| **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.*