A lightweight Go CLI for EPUB maintenance: merge volumes, edit metadata and navigation, search/replace text.
go build ./cmd/novfmt- merge — combine multiple EPUB volumes into one omnibus file
- edit-meta — view or modify metadata and navigation
- rewrite — search/replace text (and optionally metadata)
Run novfmt -h or novfmt <command> -h for the full flag reference.
Note:
edit-metaandrewritemodify the input file in place by default. Use-outto write to a new file instead.
Download all volumes into a folder, making sure filenames contain volume numbers so they sort correctly (e.g. vol01.epub, vol02.epub, …). Then:
novfmt merge \
-dir ./my-series \
-title "My Favorite Saga" \
-o saga.epubFiles in -dir are sorted numerically by the first number in each filename.
Dump the current metadata and nav to temporary files:
novfmt edit-meta \
-dump-meta meta.json \
-dump-nav nav.xhtml \
saga.epubOpen meta.json in a text editor — fix the language, add a description, correct the title (useful for translated books where the title may be in the wrong language):
{
"title": "Corrected Title",
"language": "en",
"description": "A short summary of the book.",
"creators": ["Author Name"]
}Edit nav.xhtml to fix the hierarchy — nest chapters under their volumes, group subchapters (2.1, 2.2, 2.3) under their parent chapter, etc.
Apply both changes and write to a new file:
novfmt edit-meta \
-meta meta.json \
-nav nav.xhtml \
-out saga-fixed.epub \
saga.epubRename a character across the entire book:
novfmt rewrite \
-find "Old Name" \
-replace "New Name" \
-out fixed.epub \
book.epubPreview changes without writing anything:
novfmt rewrite \
-find "typo" \
-replace "correction" \
-dry-run \
book.epubApply multiple rules from a JSON file:
novfmt rewrite -rules fixes.json book.epub- FB2 conversion, asset cleanup
- Smarter nav merging that preserves per-chapter structure from each source
- Parallel extraction and asset deduplication