Documentation
¶
Index ¶
- Variables
- func DetectSSHBackupCandidates() []string
- func EnsureSSHConfig(sshKeyPath string) error
- func FindGitHubSSHKey(sshDir string) string
- func GenerateSSHKey(sshKeyPath string, verbose bool) (bool, error)
- func MigrateSSHFromBackup(sourceDir, destDir string, verbose bool) error
- func SetupSSH(verbose bool) error
- func SetupSSHForGitHub(verbose bool) error
- func SetupSSHFromBitwarden(sshKeyPath string, verbose bool) error
- func ValidateGitHubSSHAuth(sshKeyPath string, verbose bool) error
Constants ¶
This section is empty.
Variables ¶
var SetupCmd = &cobra.Command{ Use: "setup", Short: "Setup SSH keys for GitHub access", Long: `Setup SSH keys for GitHub access. This command will: - Check for existing SSH keys - Attempt to retrieve SSH keys from Bitwarden vault - Generate new SSH keys if none found - Configure SSH config for GitHub`, RunE: func(cmd *cobra.Command, _args []string) error { if err := SetupSSH(cmdutil.IsVerbose(cmd)); err != nil { return fmt.Errorf("ssh setup failed: %w", err) } return nil }, }
SetupCmd runs the SSH setup flow.
var SshCmd = &cobra.Command{ Use: "ssh", Short: "Manage SSH keys for GitHub access", Long: `Check for existing SSH keys, retrieve from Bitwarden, generate new ed25519 keys, and configure SSH for GitHub.`, RunE: func(cmd *cobra.Command, _args []string) error { return cmd.Help() }, }
SshCmd manages SSH keys for GitHub and general access.
Functions ¶
func DetectSSHBackupCandidates ¶
func DetectSSHBackupCandidates() []string
DetectSSHBackupCandidates scans common local locations for SSH backup folders containing key files.
func EnsureSSHConfig ¶
EnsureSSHConfig ensures ~/.ssh/config contains the Host github.com configuration block.
func FindGitHubSSHKey ¶
FindGitHubSSHKey locates the primary GitHub SSH private key within sshDir.
func GenerateSSHKey ¶
GenerateSSHKey generates a new ed25519 SSH key pair and attempts to register it in GitHub.
func MigrateSSHFromBackup ¶
MigrateSSHFromBackup copies all SSH keys, public keys, and config from sourceDir into destDir, enforcing secure permissions.
func SetupSSHForGitHub ¶
SetupSSHForGitHub exposes the SSH setup flow for other commands that need GitHub access.
func SetupSSHFromBitwarden ¶
SetupSSHFromBitwarden retrieves SSH keys from Bitwarden vault and configures them locally.
func ValidateGitHubSSHAuth ¶
ValidateGitHubSSHAuth verifies GitHub SSH connectivity using the specified key.
Types ¶
This section is empty.