How adembc/lazyssh works
Project type and purpose
• This is a single‐binary, terminal-based TUI (text UI) application called “lazyssh.”
It’s not a full-stack web app but a CLI/TUI tool for managing SSH servers.
• Purpose: read and write your ~/.ssh/config, present an interactive dashboard of servers, allow edits, pinning, searching, and invoke real SSH sessions via the native ssh binary.
File structure
• cmd/main.go: application entrypoint and dependency wiring.
• internal/adapters/ui: TUI layer using tview/tcell, rendering screens, capturing key events, mapping them to handlers.
• internal/adapters/data/ssh_config_file: reads/writes the SSH config file, manages backups, preserves formatting.
• internal/core: “Clean architecture” style
· domain: core data models (e.g., Server)
· ports: interfaces/abstractions for repos and services
· services: business logic (e.g., server CRUD, invocation of ssh binary)
• internal/logger: centralized logging.
• docs, CI/CD workflows, makefile, config files: ancillary.
README for additional insights
• Relies on tview/tcell for UI.
• Writes atomically to SSH config, keeps rolling backups.
• Invokes the system ssh binary for actual connections.
• No database; persistence is the flat ~/.ssh/config file.
Detail
• Every port interface (e.g., ServerRepository, ServerService).
• Two backup flows: initial original backup (one-time) and rolling timestamped backups.