$ show melbahja/goph
Goph is a lightweight Go SSH client library that simplifies SSH connections with a clean API. It supports password, private key, agent, and keyboard-interactive authentication; SOCKS5 proxy and jump host tunneling; file upload/download via SFTP; command execution with context cancellation; and script execution from readers or files. The library uses functional options for configuration, proper known hosts verification by default, and exposes a reusable dialer for multiple connections. It is well-structured, idiomatic Go with decent test coverage and modern dependency versions (Go 1.25, recent crypto/net packages). The commit timestamps appear anomalous (year 2026), but the repo shows active development.
The LLM identified 3 files worth highlighting for reuse:
Implements the functional options pattern for configuring SSH clients. Provides clean, composable option functions for passwords, keys, agents, keyboard-interactive, SOCKS5 proxy, jump hosts, timeouts, known hosts, and custom SSH config. Each option is self-contained and can be reused in any SSH-related Go project.
Handles SSH connection establishment with support for SOCKS5 proxy dialing and jump host tunneling. The Dial function sets up the SSH connection using net.Conn obtained via proxy or jump, and applies default known hosts if none specified. The Dialer struct provides a reusable factory for creating multiple clients with shared options. The proxy and jump logic are cleanly separated and could be extracted for general SSH tunneling use.
Provides utility functions for SSH key parsing (with or without passphrase), known hosts file management (DefaultKnownHosts, KnownHosts, EnsureKnownHosts), and host key verification/adding (CheckKnownHost, AddKnownHost). These are self-contained and can be reused in any Go project needing SSH known hosts interaction.