Skip to content

feat(ssh): support BREV_SSH_CONFIG_FILE env var override#288

Open
ishandhanani wants to merge 3 commits intomainfrom
idhanani/feat-brev-ssh-config-env-var
Open

feat(ssh): support BREV_SSH_CONFIG_FILE env var override#288
ishandhanani wants to merge 3 commits intomainfrom
idhanani/feat-brev-ssh-config-env-var

Conversation

@ishandhanani
Copy link
Contributor

Summary

  • Add BREV_SSH_CONFIG_FILE environment variable support to override the default ~/.ssh/config path
  • When set, all brev SSH operations (refresh, etc.) edit the specified file instead
  • Useful for nix-managed systems where the main SSH config is read-only

Test plan

  • unset BREV_SSH_CONFIG_FILE && brev refresh -- should still edit ~/.ssh/config (default behavior)
  • export BREV_SSH_CONFIG_FILE=~/.ssh/config.local && brev refresh -- should edit ~/.ssh/config.local instead

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.
@ishandhanani ishandhanani requested a review from a team as a code owner February 23, 2026 19:12
Copilot AI review requested due to automatic review settings February 23, 2026 19:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for overriding the SSH config file path via the BREV_SSH_CONFIG_FILE environment variable. This is useful for systems with read-only main SSH config files (like nix-managed systems), allowing users to specify an alternative location for brev's SSH configuration changes.

Changes:

  • Added environment variable check in GetUserSSHConfigPath() to allow overriding the default ~/.ssh/config path
  • The override is checked first before falling back to the default behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ishandhanani and others added 2 commits February 23, 2026 16:54
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.63%. Comparing base (272bf99) to head (1444d00).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/files/files.go 0.00% 15 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #288      +/-   ##
==========================================
- Coverage   13.10%   12.63%   -0.47%     
==========================================
  Files         112      115       +3     
  Lines       14480    15018     +538     
==========================================
  Hits         1898     1898              
- Misses      12349    12886     +537     
- Partials      233      234       +1     
Flag Coverage Δ
Linux 12.63% <0.00%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants