Is it possible to retrieve my Apple ID two-factor authentication code via the terminal instead of the GUI prompt, i.e. via ssh or a bash script?
I don't own any Apple devices other than a headless Mac mini for iOS development (I am loaning some iOS devices for development, but don't want to mark those as trusted, for obvious reasons).
Right now, I have to remote desktop into the Mac mini to get the 2FA code whenever I need it. I'd like to be able to at least just ssh, if not set up a bash script to text me when prompted.