I recommend the simple syntax of
scp instead of sftp, and using
keychain.
Keychain (installed from my distro's repository) saves my passphrase in memory. I'm promoted for the passphrase the first time I login after a boot and it remembers it (even across logout/login) until I reboot or kill the process.
That let's me do things like this, on the command line, in a script or even in a crontab script, without being prompted for anything. Assuming I have an account on example.com and have appended my public key to the ~/.ssh/autorized_keys file on it.
Code:
ssh example.com mkdir examples
scp ~/text/onefile.txt ~/text/other.txt example.com:examples