Hey, this is cool! I’m working on an open source, self-hostable ebook library, made to solve the 80%-usecase of Calibre. I also built a command line interface to interact with its database, but this is stock-Full of nice ideas. I might steal some! :)
If you’re curious: https://github.com/colibri-hq/colibri
(I have been working on this for years on and off, but now it’s finally going somewhere. Still not usable, though.)