{"id":31978732,"url":"https://github.com/9beach/epub-merge","last_synced_at":"2025-10-14T22:26:45.112Z","repository":{"id":315063988,"uuid":"1057920805","full_name":"9beach/epub-merge","owner":"9beach","description":"Merge multiple ePUBs into one volume, or split volumes produced by epub-merge","archived":false,"fork":false,"pushed_at":"2025-10-06T05:01:29.000Z","size":15756,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T06:31:15.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/9beach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-16T11:39:14.000Z","updated_at":"2025-10-06T05:01:33.000Z","dependencies_parsed_at":"2025-09-16T14:40:11.302Z","dependency_job_id":"8358d4a6-ff41-4754-94b9-83ec6876fe96","html_url":"https://github.com/9beach/epub-merge","commit_stats":null,"previous_names":["9beach/epub-merge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/9beach/epub-merge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fepub-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fepub-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fepub-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fepub-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9beach","download_url":"https://codeload.github.com/9beach/epub-merge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9beach%2Fepub-merge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021779,"owners_count":26087056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T22:26:40.030Z","updated_at":"2025-10-14T22:26:45.107Z","avatar_url":"https://github.com/9beach.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EPUB Tools: epub-merge \u0026 epub-meta\n\nThis repository provides two **super fast**, lightweight command-line tools written in `bash` for working with EPUB files:\n\n- **[epub-merge](#epub-merge)** — Merge multiple EPUB files into a single volume or extract a merged EPUB back into its original components.\n- **[epub-meta](#epub-meta)** — Read, edit, and repair metadata in an EPUB or standalone OPF file.\n\nBoth tools support **EPUB 3** and **EPUB 2**, run on **macOS** and **Linux**, and require only standard POSIX utilities with minimal external libraries (`zip`, `unzip`).\n\n## Installation\n\n```bash\nsudo curl -L https://raw.githubusercontent.com/9beach/epub-merge/refs/heads/main/epub-merge -o /usr/local/bin/epub-merge\nsudo curl -L https://raw.githubusercontent.com/9beach/epub-merge/refs/heads/main/epub-meta -o /usr/local/bin/epub-meta\nsudo chmod a+rx /usr/local/bin/epub-merge /usr/local/bin/epub-meta\n````\n\n## Features\n\n### epub-merge\n\n- Merge multiple EPUB files into one volume with a unified table of contents (TOC).\n- Extract merged EPUBs back into their original component files.\n- Remove duplicate fonts to reduce file size.\n- Automatically detect language and apply localized volume labels (e.g., Korean: `제 1권`, `제 2권`).\n- Customize titles, labels, and output filenames.\n- Minimal dependencies: `zip`, `unzip`, and standard POSIX tools.\n\n### epub-meta\n\n- Read, modify, or remove metadata in EPUB or OPF files.\n- Edit basic fields such as **title**, **author**, **language**, **publisher**, **publication date**, and **ISBN**.\n- Support **multiple authors** or **subjects** separated by `//`.\n- Handle **complex metadata** such as descriptions wrapped in CDATA blocks.\n- Manage cover images:\n\n  - `-c FILE` — Add or set a new cover image.\n  - `-C FILE` — Replace an existing cover image.\n  - `-S PATH` — Extract the current cover image (extension auto-added).\n  - `-f` — Automatically fix invalid cover configurations.\n- Minimal dependencies: `zip`, `unzip`, and standard POSIX tools.\n\n## How it works\n\n### epub-merge\n\n#### Merging EPUB Files\n\n- Combines multiple EPUBs into one with a unified TOC organized by volume.\n- Automatically generates a title based on input filenames unless overridden with `-t`.\n- Applies language-specific or custom volume labels with `-l`, `-p`, `-s`, or `-v`.\n- Removes duplicate fonts to minimize file size.\n- Supports natural sorting of filenames (e.g., `love-8.epub`, `love-9.epub`, `love-10.epub`).\n- Outputs the result to the current or specified directory (`-d`).\n\n#### Extracting EPUB Files\n\n- Splits a previously merged EPUB into its original components using `-x`.\n- Restores metadata, TOC, and structure for each extracted EPUB.\n\n#### Examples\n\n```bash\nepub-merge love-10.epub love-8.epub love-9.epub\nepub-merge -t \"Arabian Nights: Tales of 1,001 Nights\" a1.epub a2.epub\nepub-merge -l ko novel-1.epub novel-2.epub\nepub-merge -v \"Love//Peace//Hate\" story-1.epub story-2.epub story-3.epub\nepub-merge -p \"Book \" -s \" Edition\" part1.epub part2.epub\nepub-merge -x love.epub\n```\n\n### epub-meta\n\n#### Reading Metadata\n\nRun without options to display current metadata:\n\n```bash\nepub-meta book.epub\n```\n\nOutput example:\n\n```\nTitle: Brave New World\nAuthor: Aldous Huxley\nLanguage: en\nISBN: 978-3-16-148410-0\nPublisher: Chatto \u0026 Windus\nPublication Date: 1932-01-01\n```\n\n#### Editing Basic Metadata\n\nSet or update common metadata fields:\n\n```bash\n# Set title and author\nepub-meta -t \"Brave New World Revised\" -a \"Aldous Huxley\" book.epub\n\n# Multiple authors or translators\nepub-meta -a \"Tom Waits--Waits, Tom//Lily Allen--Allen, Lily\" book.epub\nepub-meta -r \"Deborah Smith//John Doe\" book.epub\n\n# Language, publisher, and dates\nepub-meta -l ko -p \"문학동네\" -u \"2024-08-15\" book.epub\n\n# ISBN and subject\nepub-meta -i \"978-89-546-1234-5\" -s \"Fiction//Classic\" book.epub\n```\n\n#### Adding Complex Descriptions\n\nUse CDATA for formatted or multi-line descriptions:\n\n```bash\nepub-meta -d '\u003c![CDATA[\n\u003cp\u003eA dystopian novel about totalitarianism.\u003c/p\u003e\n\u003cp\u003ePublished in 1949.\u003c/p\u003e]]\u003e' book.epub\n```\n\n#### Managing Cover Images\n\n```bash\n# Add a new cover image\nepub-meta -c cover.jpg book.epub\n\n# Replace an existing cover\nepub-meta -C new-cover.png book.epub\n\n# Extract current cover to a file (extension auto-added)\nepub-meta -S ./cover-out book.epub\n\n# Automatically fix invalid cover configurations\nepub-meta -f book.epub\n```\n\n#### Removing Metadata\n\nRemove any field by passing an empty string:\n\n```bash\nepub-meta -t \"\" -a \"\" -i \"\" book.epub\n```\n\n## Manuals\n\n### epub-merge\n\n```txt\nNAME\n     epub-merge -- merge multiple ePUB files into one or extract merged ePUB\n\nSYNOPSIS\n     epub-merge [-fOq] [-d directory] [-l lang] [-p prefix] [-s suffix]\n                [-t title] [-v labels] file ...\n     epub-merge -x file\n\nDESCRIPTION\n     The epub-merge utility combines multiple ePUB files into a single volume\n     or extracts a previously merged ePUB back into its original components.\n\n     The options are as follows:\n\n     -d directory\n             Specify the output directory for generated ePUB files. The\n             default is the current directory.\n\n     -f      Force overwrite of existing files with the same name.\n\n     -l lang\n             Specify the language code for the merged ePUB (e.g., ko, en, ja,\n             zh, ru).\n\n     -O      Disable natural sorting of input files.\n\n     -p prefix\n             Add a prefix to table of contents volume labels.\n\n     -q      Quiet mode. Suppress progress messages.\n\n     -s suffix\n             Add a suffix to table of contents volume labels.\n             Set a custom title for the merged ePUB. This title is also used\n             as the output filename.\n\n     -v labels\n             Set custom table of contents volume labels for each volume.\n             Labels must be separated by semicolons, for example:\n             \"Love//Peace//Hate\".\n\n     -x      Extraction mode. Split a merged ePUB back into its original\n             component files.\n\nEXAMPLES\n     Merge three ePUB files with natural sorting (default):\n\n           $ epub-merge love-10.epub love-8.epub love-9.epub\n           extracting love-8.epub\n           extracting love-9.epub\n           extracting love-10.epub\n           love.epub: successfully created\n\n     Extract a merged ePUB back into original files:\n\n           $ epub-merge -x love.epub\n           love-8.epub: successfully created\n           love-9.epub: successfully created\n           love-10.epub: successfully created\n\n     Merge files in the order specified (disable natural sorting):\n\n           $ epub-merge -O love-10.epub love-8.epub love-9.epub\n           extracting love-10.epub\n           extracting love-8.epub\n           extracting love-9.epub\n\n     Merge with custom title and filename:\n\n           $ epub-merge -t \"Arabian Nights: Tales of 1,001 Nights\" a?.epub\n           Extracting a1.epub\n           Extracting a2.epub\n           Extracting a3.epub\n           Arabian Nights_ Tales of 1,001 Nights.epub: successfully created\n```\n\n---\n\n### epub-meta\n\n```txt\nNAME\n     epub-merge -- merge multiple ePUB files into one or extract merged ePUB\n\nSYNOPSIS\n     epub-merge [-fOq] [-d directory] [-l lang] [-p prefix] [-s suffix]\n                [-t title] [-v labels] file ...\n     epub-merge -x file\n\nDESCRIPTION\n     The epub-merge utility combines multiple ePUB files into a single volume\n     or extracts a previously merged ePUB back into its original components.\n\n     The options are as follows:\n\n     -d directory\n             Specify the output directory for generated ePUB files. The\n             default is the current directory.\n\n     -f      Force overwrite of existing files with the same name.\n\n     -l lang\n             Specify the language code for the merged ePUB (e.g., ko, en, ja,\n             zh, ru).\n\n     -O      Disable natural sorting of input files.\n\n     -p prefix\n             Add a prefix to table of contents volume labels.\n\n     -q      Quiet mode. Suppress progress messages.\n\n     -s suffix\n             Add a suffix to table of contents volume labels.\n             Set a custom title for the merged ePUB. This title is also used\n             as the output filename.\n\n     -v labels\n             Set custom table of contents volume labels for each volume.\n             Labels must be separated by semicolons, for example:\n             \"Love//Peace//Hate\".\n\n     -x      Extraction mode. Split a merged ePUB back into its original\n             component files.\n\nEXAMPLES\n     Merge three ePUB files with natural sorting (default):\n\n           $ epub-merge love-10.epub love-8.epub love-9.epub\n           extracting love-8.epub\n           extracting love-9.epub\n           extracting love-10.epub\n           love.epub: successfully created\n\n     Extract a merged ePUB back into original files:\n\n           $ epub-merge -x love.epub\n           love-8.epub: successfully created\n           love-9.epub: successfully created\n           love-10.epub: successfully created\n\n     Merge files in the order specified (disable natural sorting):\n\n           $ epub-merge -O love-10.epub love-8.epub love-9.epub\n           extracting love-10.epub\n           extracting love-8.epub\n           extracting love-9.epub\n\n     Merge with custom title and filename:\n\n           $ epub-merge -t \"Arabian Nights: Tales of 1,001 Nights\" a?.epub\n           Extracting a1.epub\n           Extracting a2.epub\n           Extracting a3.epub\n           Arabian Nights_ Tales of 1,001 Nights.epub: successfully created\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9beach%2Fepub-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9beach%2Fepub-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9beach%2Fepub-merge/lists"}