calibre-debug -c "from calibre.library import db; db = db(); Do whatever with the db object"
For device access, you can directly instaantiate the device plugin, like this
calibre-debug -c "from calibre.customize.builtins import PRS505; device = PRS505(None)"
|