A CLI for interacting with Unsplash.com
npm install -g unspray
or
yarn global add unspray
Create a .unsprayrc file in your home directory with your Unsplash.com Application ID. If you don't have an Application ID, you will need to create an Unsplash.com developer account and register an application.
{
"applicationID": "<YOUR_APPLICATION_ID_HERE>"
}
There are 3 commands available in unspray
Search Unsplash.com for photos
unspray search -q "search query" -p 1 -r 5
-qor--query- Search query (required)-por--page- Page number to retrieve (optional; default: 1)-ror--results-per-page- Number of items per page (optional; default: 10)
Note: if you use iTerm2 v2.9+ you can see thumbnails of the results right in your terminal!

Save a photo to your computer
unspray save -i "photo-id" -d "directory" -Q "quality"
-ior--photo-id- Photo ID (optional; if not provided, a random photo is retrieved)-dor--directory- A directory relative to your home directory (optional; default: Desktop)-Qor--quality- Quality of photo to save (thumb,small,regular,full). (optional; default:regular)
Set a photo as your wallpaper
unspray set-wallpaper -i "photo-id" -d "directory" -Q "quality" -s "scale"
-ior--photo-id- Photo ID (optional; if not provided, a random photo is retrieved)-dor--directory- A directory relative to your home directory (optional; default: Desktop)-Qor--quality- Quality of photo to save (thumb,small,regular,full). (optional; default:regular)-sor--scale- Scaling method to use for the wallpaper (fill,fit,stretch,center). (optional; default:fill)