Repository navigation
v1.0.0
The first stable release. dokuha-cli is the browserless batch downloader of the dokuha project: five stores through their own viewer protocols, series downloads that find the free volumes themselves, a live progress block, and an optional hand-off to mokuro-bridge for OCR and delivery. This release collects everything since 0.1.1 and settles the interfaces that scripts can rely on: the --json summary, the CLI options, the exit codes and the bridge client contract.
Added
- The live block can be paused so its text can be selected and copied. The block repaints every 120 ms, moving the cursor and rewriting the same rows, which is why a drag-selection jumps while a download is running. Pressing
pfreezes every paint; the run keeps going, progress updates keep accumulating, and notes that arrive meanwhile are held. Pressingpagain paints the current state, prints the held notes, and resumes. A run that ends while frozen prints the held notes and its final frame rather than leaving the terminal frozen. The footer advertisesp: pauseandp: resumebesidec: compact, and--no-progressremains the fully static alternative when stdin is not a terminal. - The live block shows cumulative sizes. A done row already keeps the manga's downloaded size; the footer now totals it across every volume (
149.4 MiB manga), and a bridge run adds the size of webp, cbz, mokuro and series.json as the upload stream reports them, on a third line that appears only when a bridge produces output. Sizes are file totals, not deltas, and the per-seriesseries.jsonis counted once rather than once per volume. The third line is reserved in the row budget so a full-height volume list does not push the block off the screen.
Fixed
- Remote destinations lost the artifact sizes. The terminal
done.uploads[]the bridge builds for a remote destination carriesbytesandtotal_bytes, while the local one carriessize; reading onlysizemade every remote entry non-finite, so the footer's third line (webp, cbz, mokuro and series.json) disappeared on exactly the runs that upload, andseries.jsonhad no other event to recover it from. Both spellings are accepted now, a local frame keeps itssize, andmokuro.outputFilesexposes one normalizedsizeper file in--json. --forcesent a collision policy the bridge does not understand. Finalize takesfail(the default),skiporoverwrite; the CLI sent the booleantrue, which providers treat asfail, so a forced re-run uploaded the artifacts and then died with "destination already exists" after the OCR work had already been spent.--forcenow sendsoverwrite=overwrite, and it also bypasses the local completion receipt, which previously made a forced run skip the hand-off it was asked to repeat.- A terminal
partial_uploadwas reported as a success. That frame means the destination received the volume files but notseries.json, so the reader cannot build the series; the bridge's own client treats it as a failure, and the CLI now does too: the volume is counted as failed, the run exits 1, the bridge's reason is printed with a--forceretry hint, andmokuro.status,mokuro.messageandmokuro.partialare in--json. - A finished bridge session could fail a volume needlessly. A persisted session record that reached its terminal state answers
GET /session/{id}/statuswith 400 "Session already finalized" (a 404 is the normal "finished and cleaned up"), and only the 404 was handled, so a re-run could fail on work that was already done. Both are a skip now, and so is a finalize that answers 400 because another client finalized first;status()errors carry the bridge's response body so the two cases can be told apart. --destrejected historical spellings after an account was renamed. Resolution matched the exact id or the derivedprovider-name, but the bridge derives that alias from the storage name only until an account is renamed, and it turns underscores into hyphens. Resolution now also matches theproviderandaccountpair/upload-methodsreports, somega:workstill finds a renamed account andmega:my_workfindsmega-my-work. A bare provider id is resolved as an alias first, which is what the bridge does.--dest-folderwas still resolved by the bridge on the resume-only path. The--mokuropath resolved a relative folder on this machine, but the--no-mokurosession-resume path sent it raw, so the bridge resolved it against its own working directory.resolveDestinationnow resolves it once for both callers.- A finished early cover push painted the footer as uploading. The bridge keeps an
uploadobject on the session after the early cover upload withactive: falseuntil the real transfer starts; the status monitor counted the object instead ofactive, so the footer's "1 uploading" and the per-volume "bridge uploading" outlived the cover for the whole OCR phase. - A failed volume could still make the run read 100 percent. A volume that failed after 20 of 200 pages was weighted as a whole finished volume, so the footer could show 100 percent and a full bar beside a red
failedrow and0/1 done. A failure now carries only the fraction it actually reached, matching the meter the row already drew. - The footer percentage and its bar could disagree for a whole run. A plain download was still weighted with the mokuro stages (download 30, OCR 45, upload 25), so a run that fetched all 297 pages read 56 percent with a full blue bar, and a resumed 5-volume run showed 40 percent after six seconds.
pipelineExpectednow tells the block whether a bridge follows; without one, the pages are the whole measure and the bar fill and the percentage share one basis. A bridge handoff that starts on a resumed session turns the staged weights on at the moment it happens. - ebookjapan and BookWalker's local finalize looked like a bridge phase. Their local
finalizingstep (zipping pages after the download) switched the block to the mokuro weights, which made an ebookjapan download-only run report 88 percent beside a 98 percent bar, and stall at 51 percent while the bar ran to 89. Onlyuploadingandocrcount as bridge phases now. - The footer percentage could step backwards. A queued volume's page total grows the denominator before its numerator, so the number dipped by up to 2.4 points. The display keeps a running high-water mark, and never shows 100 percent until every row has settled (a fully fetched run reads 99 percent until the last volume reports done).
- A local destination never showed the assemble band, and a done volume without upload bytes stayed cyan. The cyan band required a remote destination, so a local bridge run showed a full blue bar beside rows assembling the archive, and a skipped or already-present volume left the whole bar cyan at 100 percent. Assembling is a pipeline stage for every bridge run, and a done volume is green.
- A finalizing row could show a full bar while the destination was still confirming the transfer. The bridge's upload percentage can reach 100 while MEGA is still closing the file, and the row then drew a full meter. It now stops one cell short until the volume is actually done, which is what the 0.1.1 changelog already promised.
- A finished mokuro volume left the footer short of OCR'd pages. The last wait_ocr frame can still carry one page pending, so a five-volume run finished with
275 OCR'dfor 297 pages.finish()now normalizes the OCR counters. - BookWalker rows said
waitinguntil the first page landed. Every other store claims the download phase when the page total is known; BookWalker was the only one waiting for the first completed page, so its download bar appeared a second late on a sampler and longer on a small volume. - A BookWalker page failure threw instead of counting. The adapter incremented
progress.get(key).failed, butLiveProgresshad noget, so the error path raised a TypeError instead of reporting the bad page. - Series rows showed store IDs instead of titles during the handshake. A series walk already knows each volume title, but the row label preferred the id, so BookWalker series rows were UUIDs for the first eight seconds of the audit run.
rowLabelnow preferstask.title. - Rows wrapped on terminals narrower than about 48 columns. The fixed columns plus the minimum label width overflowed, and a wrapped row makes the redraw clear one line too few. A row is now clamped to the terminal width.
- The bridge connect failure path called a
progress.stopthat does not exist. It was a guarded no-op, so a failed bridge left the ticker running until the process exited; it now callsstopTicker(). - The duplicate-session recovery threw a
ReferenceError. When a bridge answered a start with "already finalizing" and the follow-up session check also failed, the skip path callednoteResume(ctx, ...)wherectxwas never a parameter, so the volume failed with a nonsense error instead of being skipped as a duplicate. The caller's context is now passed in. - The same volume could be downloaded twice into one folder. A repeated URL, or a series URL plus one of its own volume URLs, created two tasks with the same key; both writers raced on the same page files and completion marker, and the summary counted the volume twice. Tasks are deduplicated by key before dispatch.
- A normal run did not say why an input was skipped. The rejection list was printed after the build promise was awaited, but with the default streaming mode that promise settles after the scheduler starts, so the list was still empty. A typo in a batch was silent and the exit code was 0; the reason now prints when discovery rejects the input.
- The grouped Kindle "loan could not be returned" line could be missing.
kindleReturnWorkwas created on the per-volume child context, so the run's teardown never saw the background returns. The run now owns the set, likekindleUnreturned. - The grouped "already had a bridge session" line never printed for the same scope reason:
bridgeResumewas created lazily on the per-volume context. It is now a shared map owned by the run.
Changed
--destaccepts bridge account aliases as well as the historical colon spellings. The bridge renamed multi-account ids frommega:workto aliases such asmega-workand accepts both as input, but dokuha validated the raw string against the ids the bridge reported, so--dest mega:workwould have been rejected as unconfigured the moment a bridge reported aliases, and--dest mega-workis rejected by an older bridge the same way. The client now resolves the exact id, the derived alias, the reportedprovider/accountpair andprovider:defaultbefore validating, and passes the id the bridge reported. An unknown account is still an error at startup, and a colon typo never falls back to the provider's first account.- The documentation is architecture-first, and the project reads as standalone. The README is a product page for dokuha-cli rather than an entry point to a three-tool suite: dokuha-userscript is named as the sister tool and mokuro-bridge as an independent service in the mokuro ecosystem that this CLI can optionally act as a client of. Audit narratives, benchmark dumps and decision records (
docs/audits/,docs/bench-*.md,docs/parallelism.md,docs/phase-timing.mdand the bench audit notes) were removed; their still-current content moved intodocs/architecture.mdand the newdocs/performance.md, and the README documentation map now matches the files that exist. - The bridge documentation names the destinations the bridge actually ships. mokuro-bridge has six targets (local, MEGA, Google Drive, OneDrive, WebDAV and rclone), and its accounts are aliases that may be rclone-backed, so the README, the troubleshooting section and the
--desthelp no longer present a fixed five-provider list. A bare provider id is documented as an alias lookup, and the bunko-ownedseries.jsonexception is named. - The BookWalker page total claims the download phase, matching CMOA, ebookjapan, Kindle and k-manga.
- The bridge's OCR batching is described in
docs/performance.md. 8 is the chunk/flush trigger, not the batch; the bridge takes up to 32 pages per batch across sessions, and a capture of the five-volume run confirmed 32 in every multi-session batch. That batching belongs to the bridge, and the CLI only waits and streams. - The publish workflow no longer publishes on a push to
main. The publish step was guarded withinputs.dry_run == false, and on a push theinputscontext is empty, which GitHub's loose equality coerces to the same value asfalse. A merge would have attempted an npm publish before any tag existed; the guard now also requiresgithub.event_name == 'workflow_dispatch'. - The shipped documentation now matches the 0.1.1 code. The Kindle series walk is documented as the one-request
seriesAsinListdiscovery with concurrent access probes, the test counts say 31 files (30 offline, one live), the CPU budget is described as a per-volume share rather than a run-wide cap, and the README and--desthelp name WebDAV and account aliases. - Help text for
--out,--json,--dry-run,--quietand--jobsstates their real behaviour, including the default./libraryoutput, the dry-run table despite--json, quiet's missing summary, and the per-volume meaning of an explicit--jobs.