# dial — v2 Plan Written against the v1 REPORT.md handoff. v1 is complete, tested, and out of scope to modify except where noted. This plan is scoped to be handed to Claude Code as-is; every judgment call is flagged so it can be overridden. --- ## 1. Alphabetical sort (small, do first) - Add a third sort mode to the existing `s` toggle: **recently used → most used → alphabetical → (back to recently used)**. - Alphabetical sorts by `Host` alias (the thing the user actually types/sees first in the list), case-insensitive. - Favourites still pin to the top regardless of sort mode (unchanged v1 behaviour). - Persist the selected mode the same way recents/frequency already persist (`~/.ssh/.dial/data.json`). No open questions here — this is a straightforward extension of existing code. --- ## 2. SSH key generation tool (`dial keygen`) Rebuilt from the logic in `create_ssh_keypair.sh`, fixing the cross-platform and UX issues found in it, and wired into `dial` as a new subcommand rather than folded into the interactive picker. **Why a separate subcommand, not part of the picker:** the picker's core read-only-config guarantee is a deliberate v1 property. Keygen necessarily *writes* to `~/.ssh/config` and creates key files, so it should be a distinct, explicitly-invoked action (`dial keygen`) — not something that can happen by accidentally pressing a key while browsing hosts. ### Fixes over the original script - Replace the macOS-only `sed -i ''` public-key-comment logic with something that works identically on macOS/Linux/Windows (Go string handling, no shell `sed` dependency at all). - Default algorithm: **ed25519**. Offer `--rsa` (4096-bit) as an explicit opt-out for hosts that don't support ed25519 (some older network gear, e.g. legacy broadcast equipment, may not). - **Keep the `.pub` file.** Don't delete it after displaying it once — that behaviour in the original script means a lost copy-paste = a wasted key. Still print it to the terminal for convenience, but leave the file in place. - Proper quoting/escaping when appending to `~/.ssh/config` (avoid the blind `read` + string-concat approach in the original). ### Proposed flow ``` dial keygen → prompt: key name / label → prompt: algorithm (default ed25519, flag for rsa) → generate into ~/.ssh/