I'm using
restic -r sftp:<backupserver>:<repo> --password-command="pass mybackup" backup <folders_to_backup>
https://restic.readthedocs.io/en/latest/