@hi There is a docker packaged iCloud backup app that does that the other way around. I use it to sync all my iPhone photos on my NAS. Useful? https://github.com/steilerDev/icloud-photos-sync worked great to grab 13k pics from my Apple account.
Btw the commandline mostly-cabled programs that are perhaps mostly for linux are libmobiledevice/idevice and there’s libimobiledevice/ifuse, although you probably know these