Originally Posted by Starson17
I was a bit confused by your comment that there was "no command line merge function" as I couldn't see many situations where you'd know the books to be merged outside of the GUI (i.e. how you would know the ID, other than by writing code to search for books to be merged.) I can see where you'd like the autosort/automerge of new formats into existing records, however.
Two methods: calibre_report_duplicates by mekk, and calibredb list --sort-by (series|author|title|author_sort|size)
both return the ID, which then gets piped into the merge. You can also parse it so that you select your base ID as the top result from hits that contains ISBN, then publisher, and then book type in order of preference.