Install https://www.gpg4win.org/
Add to %appdata%\gnupg\gpg.conf
to disable GUI asking password
code %appdata%\gnupg\gpg.conf
pinentry-mode loopback
default-cache-ttl 2592000
max-cache-ttl 2592000
Add password caching
code %USERPROFILE%\.gnupg\gpg-agent.conf
default-cache-ttl 31536000
max-cache-ttl 31536000
Reload agent
gpgconf.exe --reload gpg-agent