You probably already know this, but as a reminder:
sedis for inserting, replacing and deleting.
-icauses sed to edit in place.
pandocis for converting between text formats like HTML, Markdown, RST, TeX, various wikis…
calibrehas command-line subtools like
ebook-convertwhich can produce good EPUB from lots of other formats.
libreofficehandles typical office document tasks. Graphical.
sigilis specialized as an EPUB authoring tool. Graphical.
scribuscan do page-layout tasks up to full daily newspapers. Graphical.
With those and a good text editor, you can produce good-looking documents ranging from a business letter through a book.