ssh-add alone is not working:
Error connecting to agent: No such file or directory
How should I use that tool?
You need to initialize the agent first.
The SSH agent is not running, or the environment variables that it sets are not available in the current environment (most importantly
SSH_AUTH_SOCK), or they are set incorrectly (pointing to a dead agent).
You could start the agent in the current shell session using
or start a new shell session through the agent using
fish with whatever shell you are using). But since you say that you used to be able to use
ssh-add without this, it leads me to believe that you've accidentally killed the agent (or it has terminated due to some other reason). The error message makes me think that the
SSH_AUTH_SOCK environment variable is actually set, but that
ssh-add can't find a valid communication socket at that path.
It would not surprise me if your usual way of doing things would work again if you completely logged out and logged in again, or rebooted the machine.
In windows power shell: