A CLI for Z-Library.
English | 中文
- 🔍 Interactive search — browse results with
↑/↓, switch pages with←/→ - 📥 Book download — by book ID, from search results, with live progress
- 📚 Download history — paginated history browser with download support
- 📖 Send to Kindle — deliver files to your Kindle address
- 🕒 Usage profile — view daily download quota
- 🎨 Themes — auto, mocha, latte, dracula, tokyo, nord, gruvbox
- 🌐 Proxy & custom domain support for restricted networks
Homebrew (macOS / Linux):
brew install heartleo/tap/zlibwinget (Windows):
winget install heartleo.zlibcurl (macOS / Linux):
curl -fsSL https://raw.githubusercontent.com/heartleo/zlib/main/install.sh | shPrebuilt binaries — download from GitHub Releases
Go install (requires Go 1.25+):
go install github.com/heartleo/zlib/cmd/zlib@latestBuild from source:
git clone https://github.com/heartleo/zlib
cd zlib
go build -o zlib ./cmd/zlibzlib ships a Claude Code plugin, so Claude can search and download books for you.
/plugin marketplace add heartleo/zlib
/plugin install zlib@zlib-plugin-cc
/zlib "the pragmatic programmer" to search and download.
/zlib:kindle sends a book to your Kindle.
zlib login
zlib search # interactive mode
zlib search "dune" # static tablezlib login
zlib login --email you@example.com --password secretSaves session to ~/.config/zlib/session.json.
zlib logoutWithout arguments, opens an interactive picker:
- type a query and confirm
- browse results with
↑/↓ - switch pages with
←/→ - press
Enterto download
zlib search # interactive mode
zlib search "dune" --page 2 # static table
zlib search "dune" --json # machine-readable output for scripts and pluginsFilter by file format with --ext (or its alias --format), repeatable.
zlib search "python crash course" --ext epub --ext pdfUse --full-title to disable title truncation
zlib search "civilized to death" --full-titlezlib download Gz31nyAV5E
zlib download Gz31nyAV5E --dir ./books --send-to-kindlePress Ctrl+C to cancel.
Incomplete files are removed automatically.
Without flags, opens an interactive history browser:
- browse with
↑/↓, switch pages with←/→ - press
Enterto re-download
zlib history
zlib history --download Gz31nyAV5E --dir ./books
zlib history --format epub
zlib history --json # machine-readable, always non-interactivezlib profile
zlib profile --jsonConfigure Kindle delivery settings:
- recipient Kindle address
- sender address
- SMTP host and port
SMTP password is never stored on disk — set ZLIB_SMTP_PWD instead.
zlib kindle # configure
zlib kindle send # pick a file interactively
zlib kindle send ./dune.epub # send a local fileSupported formats: EPUB PDF MOBI TXT DOC DOCX RTF HTML
zlib theme # show current
zlib theme auto # follow terminal background
zlib theme nord # set globallyAvailable: auto · mocha · latte · dracula · tokyo · nord · gruvbox
Keep secrets like ZLIB_SMTP_PWD out of your shell history — put them in an .env file instead of exporting them inline. zlib reads env vars with this precedence: real environment > working-directory .env > ~/.config/zlib/.env. The global file is the recommended home for machine-wide values.
| Variable | Description |
|---|---|
ZLIB_DOMAIN |
Override the default Z-Library domain |
ZLIB_PROXY |
Proxy URL, e.g. http://127.0.0.1:7890 |
ZLIB_SMTP_PWD |
SMTP password for Kindle delivery |
ZLIB_THEME |
Override theme without changing config |
Edit the global env file (~/.config/zlib/.env, one KEY=value per line):
mkdir -p ~/.config/zlib && touch ~/.config/zlib/.env && chmod 600 ~/.config/zlib/.env
# open it in your editor:
notepad "$env:USERPROFILE\.config\zlib\.env" # Windows (PowerShell)
open -t ~/.config/zlib/.env # macOS
${EDITOR:-nano} ~/.config/zlib/.env # Linux