Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

A terminal client for Z-Library to search, download, and deliver ebooks to Kindle, WeRead, or AI agents.

1,968
138
Go
MIT
7 months old

What it does

zlib is a Go command-line client for Z-Library. It searches the library, browses favorites, recommendations, popular titles and download history, downloads books with cover previews, and delivers files to Kindle or WeRead. It also exposes an MCP server and plugins for Claude Code and Codex, so an AI agent can drive the same operations.

The tool targets readers who already use Z-Library and prefer a terminal over a browser, plus users who want to automate book lookups and delivery inside coding agents. A full-screen TUI is the main interface, with scriptable subcommands underneath.

Install

Homebrew on macOS or Linux:

brew install heartleo/tap/zlib-cli

Windows:

winget install --id heartleo.zlib --exact

Other routes are a shell install script that writes to /usr/local/bin and may request sudo, a release binary to place on PATH, or a source build. The installation guide covers Go builds and upgrades.

Quick start

A Z-Library account is required. First check which domains are reachable from your network:

zlib doctor

Pick a working domain from the output, then log in and open the TUI:

zlib login --domain https://z-lib.gd
zlib tui

In the TUI, press / to open the command list, choose /search, enter a title, author or ISBN and press Ctrl+S. You can also type /search dune and press Enter. Selecting a book and pressing Enter confirms a download; the default directory is the current one and can be changed before downloading. Credentials are stored locally, so later sessions only need zlib tui.

For scripts, pass a query for table output or add --json:

zlib search "dune" --ext epub --json --count 10

Commands beyond the TUI

Task Command
Favorites zlib favorites
Recommendations zlib recommended
Popular books zlib most-popular
Download history zlib history
Account and daily quota zlib profile
Download by id zlib download "id:hash"
Send to Kindle zlib kindle send ./book.epub
Import into WeRead zlib weread import ./book.epub

Kindle delivery needs SMTP configuration, and WeRead uses a QR login; both are documented separately (Kindle, WeRead).

Using it with AI agents

Register zlib mcp as a local stdio MCP server, or install the plugin for Claude Code or Codex. zlib must be on PATH and already signed in. For Claude Code:

claude mcp add -s user zlib -- zlib mcp

Adding --read-only after mcp hides downloads, history deletion, Kindle delivery and WeRead import. Other clients and flags are covered in the MCP server docs.

Constraints

  • Access depends on a reachable Z-Library mirror; if zlib doctor finds none or login fails, troubleshooting is needed before anything else works.
  • An existing Z-Library account and its download quota apply. zlib profile reports the daily allowance.
  • Login state and settings are stored locally, so treat configuration and session files as sensitive; the project asks users not to include passwords, cookies or session files in bug reports.
  • MCP exposes destructive actions by default; use --read-only when the agent should not download or delete.
  • Distributed under the MIT license.

HotRepo's take

The project appeared on HotRepo's Go daily list for 2026-11-15 at 10th place, with 40 stars gained that day and a running total of about 1,966 stars; it has no recorded all-language daily rank. That is a single snapshot rather than a trend, but it shows a Go CLI reaching visible traction. The design choice that stands out technically is the combination of a persistent TUI with JSON-capable subcommands and an MCP layer: one binary serves interactive browsing and agent automation, with a read-only mode as the safety boundary. Whether that boundary is enough depends on how agents are configured, so users wiring zlib into Claude Code or Codex should decide deliberately between the default and --read-only.

Written by AI from the project's README, updated . The project's own docs are the source of truth.

You might also like

  1. djyde/dalibreA desktop e-book library that reads and writes existing calibre libraries, for readers who want a lighter alternative.Go114
  2. freeok/so-novelTurns serialized web fiction into clean EPUB, TXT or PDF ebooks for offline reading on any device.Java8,752
  3. WANGXIN-567/weread-book-exporterExport WeRead books you can access into PDF, EPUB, and Markdown for offline reading and knowledge-base archiving.Python205