Is there a command line utility to allow browsing and editing photos in the Apple's Photos.app database like you would browse a file system? The Photos app is really terrible when trying to perform operations on large data sets (in my case, delete all of the thumbnails that I accidentally imported) as it foolishly tries to load all of the photo metadata into memory when making selections of matching files to perform any select and this brings my computer to a halt as it allocates 101 GB of virtual memory and it just sits there paging for hours.
I have tried to use third party de-duplication tools, but they are all terrible. I really just want to perform some basic operations on them using tools like exiv2 and GraphicsMagick to write some shell scripts to do get what I need done so I don't have to put up with Apple's nonsense with Photos.
Any ideas? I have not found anything yet. Honestly, a Fuse plugin would be ideal, but alas such a thing does not seem to exist.