Originally Posted by Matsendrasana
Maybe I have not made clear what I try to accomplish: I do not want to add another format, and did not asked for detailed command-lines. I just want to replace a present book in the same format because its source (LibreOffice, Asciidoc etc.) has changed.
As far as I can tell you really do want to replace the format, not add a book. The add_format command does that. Why do you want add a new book if the source file has changed instead of replacing the file in the existing book?
As for the ID, I assume that the book has some known attribute that you can use to match the book. If that attribute is title, then the following command provides trivially parsable output
calibredb list -f uuid -s "title:\"=the first lensman\""