Last active
June 15, 2026 00:51
-
-
Save josh-padnick/c90183be3d0e1feb89afd7573505cab3 to your computer and use it in GitHub Desktop.
Run ssh-agent via fish shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Convert ssh-agent output to fish shell | |
| # | |
| eval "$(ssh-agent)" >/dev/null | |
| echo "set SSH_AUTH_SOCK \"$SSH_AUTH_SOCK\"; export SSH_AUTH_SOCK" | |
| echo "set SSH_AGENT_PID \"$SSH_AGENT_PID\"; export SSH_AGENT_PID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're using macOS, you don't need to manage
ssh-agent(whether it be your Fish config or any other shell).Instead, run this for each key you use to store the passphrase in the Keychain:
Then add this to
~/.ssh/config:With the above settings:
sshwill look up the passphrase from your Keychain,You get to avoid the complexities of starting and stopping ssh-agent correctly. No startup code, no stale sockets, no orphaned agent processes.
P.S. This answer matches my experience, and Claude Sonnet 4.6 agrees.