ssh-add --apple-use-keychain ~/.ssh/id_ed25519To test that it worked, run ssh-add -L and you should see your key listed.
Also to test your connection to GitHub, run ssh -T [email protected] and you should see a message like this:
Hi <user> You've successfully authenticated, but GitHub does not provide shell access.I kept getting prompted for my password every time I pushed to a remote repository, or used GitHub CLI tools like gh clone <repo>.
You can cache your ssh key in the macOS keychain to avoid having to enter your password every time.