Sigil provides the make TOC tool that uses Headers as the key.
Calibre (the main GUI) and the Calibre editor, have a TOC tool that can use additional methods (or mixed criteria, just not in a single pass).
FWIW the Calibre editor is available from the commandline, so there is no need to put the book in the Library.
I use both Sigil and Calibre Editor. They do different things (and some of the same, just differently
) . Choose your tools, for the task at hand