This is for those situations where someone delivers you a database dump from a WordPress site, but you don't have access to the images and other user uploaded files.
This plugin adds a WP CLI command to download any files which are missing for attachments.
wp remote-attachments get --remote-url-base=http://www.example.com/wp-content/uploads/ --generate-thumbs
wp remote-attachments get --remote-url-base=http://www.example.com/files/