I have set up Produce and Publish to export ebooks with Calibre.
After the e-pub is made, I need to open the Ebook in Calibre Ebook edit and add the front cover and generate the TOC (Clicking on generate TOC from major headings work perfect).
I am pretty sure that this can be done from the command line, but I can not figure out from where the conversion is run).
.... any help is welcome... even if you have to bill me... or need help with something in return.
Produce & Publish - likely you are talking about the Produce & Publish Plone Client Connector - does nothing ebook related. The conversion is carried out on the Produce & Publish Server which wraps the ebook-convert binary. If you can accomplish your goal yourself with ebook-convert then it should be possible to do the same through the PP server and its API. Most supported converters support arbitrary command line options to be passed through the Python API to the REST endpoint of the PP server.