Skip to content

Commit 17fc1bb

Browse files
committed
feat(ssh): support BREV_SSH_CONFIG_FILE env var override
Allow users to specify a custom SSH config file path via the BREV_SSH_CONFIG_FILE environment variable. When set, brev commands (refresh, etc.) will edit the specified file instead of ~/.ssh/config. This is useful for nix-managed systems where the main SSH config is read-only.
1 parent 6aece4f commit 17fc1bb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/files/files.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ func GetSSHPrivateKeyPath(home string) string {
7474
}
7575

7676
func GetUserSSHConfigPath(home string) (string, error) {
77+
if override := os.Getenv("BREV_SSH_CONFIG_FILE"); override != "" {
78+
return override, nil
79+
}
7780
sshConfigPath := filepath.Join(home, ".ssh", "config")
7881
return sshConfigPath, nil
7982
}

0 commit comments

Comments
 (0)