Agent skill

Zlib

by heartleo in heartleo/zlib

Search and download books from Z-Library. An agent skill from heartleo/zlib.

MITAuto-check: notes

Install Zlib

skills CLI
$ npx skills add heartleo/zlib --skill zlib -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install heartleo/zlib zlib --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/heartleo/zlib.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/zlib/skills/zlib .claude/skills/zlib && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
zlib
GitHub stars
661
Token cost
~3.3k tokens
SKILL.md length
1,579 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Search and download books from Z-Library. An agent skill from heartleo/zlib.

  • Works in 2 steps: Binary present? If you see BIN_MISSING,… → Logged in? zlib profile prints the…
  • The user wants to find
  • SKILL.md covers Before anything: two preflight…, Golden rule: never run a bare…, Commands and Typical flow, plus 1 more section
  • Calls go, brew and gh

What it does

Zlib is an agent skill from heartleo/zlib. Search and download books from Z-Library. Wraps the zlib CLI to search by title or author, download by book ID, browse download history, and check daily download limits. Use when the user wants to find, download, or browse books from Z-Library. For Kindle delivery, use the bundled kindle skill instead.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with OpenAI, Google Gemini and Go. The repository describes itself as: A command-line tool for Z-Library. Search, download, send to Kindle, and integrate with AI agents. The licence is MIT.

When your agent uses it

  • The user wants to find
  • Browse books from Z-Library

Example prompts

  • “/zlib”

Requirements

  • Python 3

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Binary present? If you see BIN_MISSING, stop and tell the user to install it, then wait
  2. Logged in? zlib profile prints the user's download limits when authenticated. If instead you see Not logged in. Run: zlib login or session…

What it can do on your machine

Read from SKILL.md and the folder at commit 6a299fd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go
    • brew
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Zlib loads about 3.3k tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 1,579 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:71
    e exported or written in `~/.config/zlib/.env`, so check both; the shell alone will miss the `.env` case.
  • NoteMentions a .env fileSKILL.md:77
    cat .env ~/.config/zlib/.env 2>/dev/null |
  • NoteMentions a .env fileSKILL.md:78
    ce:]]\)\?ZLIB_DOWNLOAD_DIR=' || echo "no .env entry"
  • NoteMentions a .env fileSKILL.md:85
    $hit = Get-Content .env, "$env:USERPROFILE\.config\zlib\.env" -ErrorAction SilentlyContinue |
  • NoteMentions a .env fileSKILL.md:87
    if ($hit) { $hit.Line } else { "no .env entry" }
  • NoteMentions a .env fileSKILL.md:108
    _DOWNLOAD_DIR=<path>` to `~/.config/zlib/.env` (create the file as shown under **Output & errors**, and don't overwrite
  • NoteMentions a .env fileSKILL.md:165
    -p ~/.config/zlib; touch ~/.config/zlib/.env; chmod 600 ~/.config/zlib/.env
  • NoteMentions a .env fileSKILL.md:166
    echo "Edit: $(cd ~/.config/zlib && pwd)/.env  (add ZLIB_DOMAIN=… or ZLIB_PROXY=…, one per line)"
  • NoteMentions a .env fileSKILL.md:172
    $envFile = Join-Path $configDir '.env'
  • NoteMentions a .env fileSKILL.md:177
    b\.env"` · macOS `open -t ~/.config/zlib/.env` · Linux `${EDITOR:-nano} ~/.config/zlib/.env`. Then retry.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from heartleo/zlib at commit 6a299fd, republished under its MIT licence (© heartleo). 1,579 words, ~3,257 tokens.

Download SKILL.mdSave it as .claude/skills/zlib/SKILL.md (or your agent's skills folder).
name
zlib
description
Search and download books from Z-Library. Wraps the zlib CLI to search by title or author, download by book ID, browse download history, and check daily download limits. Use when the user wants to find, download, or browse books from Z-Library. For Kindle delivery, use the bundled kindle skill instead.
license
MIT

zlib

Drive Z-Library through the zlib CLI. zlib is a compiled binary the user already has on PATH; run it with the available shell tool and read its plain-text output. Several zlib subcommands open an interactive prompt that waits for keyboard input when run bare, so use only the non-interactive command forms documented below.

Before anything: two preflight checks

Run both once at the start of a session. Use the commands for the current shell.

POSIX shell:

bash
command -v zlib >/dev/null 2>&1 && echo "BIN_OK" || echo "BIN_MISSING"
zlib profile

PowerShell:

powershell
if (Get-Command zlib -ErrorAction SilentlyContinue) { "BIN_OK" } else { "BIN_MISSING" }
zlib profile
  1. Binary present? If you see BIN_MISSING, stop and tell the user to install it, then wait:

    zlib is not on your PATH. Install it with go install github.com/heartleo/zlib/cmd/zlib@latest (or brew install heartleo/tap/zlib), then ask me again.

  2. Logged in? zlib profile prints the user's download limits when authenticated. If instead you see Not logged in. Run: zlib login or session expired, run \zlib login``, stop and give the user this friendly handoff, then wait:

    🔐 Looks like you're not signed in to Z-Library yet. Open a separate terminal window (any shell — not this chat), run zlib login, and complete the prompts it shows. Once it says login succeeded, come back here and ask me again — I'll pick up where we left off.

    Never run zlib login yourself. Its interactive prompts need a real terminal — inside this chat there is no TTY, so it cannot work here (same pattern as gh auth login: authentication happens in the user's own terminal, and the CLI persists the session to ~/.config/zlib/session.json for later commands). Do not pass credentials as flags either — that leaks them into shell history. Your job is only the friendly nudge above. Reuse this same handoff whenever any command (search, history, profile, download) reports not-logged-in / session-expired mid-session — don't invent a new message each time. (An email/SMTP password exists too, but that belongs solely to the zlib:kindle skill — never bring it up around login.)

Golden rule: never run a bare interactive command

These forms open an interactive prompt and will hang waiting for input. Do not run them:

  • zlib search (no query)
  • zlib history (no --page, --format, or --download)
  • zlib kindle / zlib kindle send (no file)

Always pass the arguments below that force plain-text / non-interactive output.

Commands

Search — zlib search "<query>" --json

Prefer --json: one JSON document on stdout ({"books":[…],"page":n,"total_pages":n}), each book with id (the value zlib download accepts), name, authors, year, extension, size, rating. No table to parse, no truncated titles.

Always pass --count 10. Each result carries long URL/cover fields (~1 KB per book), so the default 50 bloats the JSON to ~50 KB. Ten at a time keeps it small; use --page 2 etc. when the user wants more.

bash
zlib search "the pragmatic programmer" --json --count 10
zlib search "dune" --json --count 10 --page 2
zlib search "python crash course" --json --count 10 --ext epub --ext pdf   # --ext repeatable; --format is an alias

Parse, never truncate. Read the complete JSON and project only the fields you need. Do not pipe it through byte- or line-limiting commands: truncated JSON loses data and cannot be parsed. At --count 10 the raw document is small enough to read directly. When a parser is useful, use a tool already available in the current environment, such as ConvertFrom-Json in PowerShell or jq on POSIX. The same parse-first rule applies to history --json and profile --json.

Flags: --json, -p/--page (default 1), -n/--count (default 50 — always override to 10), --ext/--format (repeatable extension filter), --full-title (table only).

Always relay results to the user as a markdown table built from the JSON (columns: #, ID, Title, Authors, Year, Format, Size, Rating) — never dump raw JSON at the user. Include every row; if an entry looks suspect (spam collection, placeholder metadata), keep it and add a note rather than dropping it. If --json is not recognized (older binary), fall back to the plain table form — a query argument alone already forces static output — and read IDs from the table's ID column.

To go from a search result straight to a file, take the ID from the table and call download below. (zlib search also accepts --dir/--send-to-kindle, but prefer the explicit download command so the ID is unambiguous.)

Download — zlib download <book-id>

Check for a configured default before asking. If the user has set ZLIB_DOWNLOAD_DIR, that is their standing answer to "where should this go" — use it, say where the file will land, and skip the question. It can be exported or written in ~/.config/zlib/.env, so check both; the shell alone will miss the .env case.

POSIX shell:

bash
printf 'exported=%s\n' "${ZLIB_DOWNLOAD_DIR:-<unset>}"
cat .env ~/.config/zlib/.env 2>/dev/null |
    grep '^[[:space:]]*\(export[[:space:]]\)\?ZLIB_DOWNLOAD_DIR=' || echo "no .env entry"

PowerShell:

powershell
"exported=" + $(if ($env:ZLIB_DOWNLOAD_DIR) { $env:ZLIB_DOWNLOAD_DIR } else { "<unset>" })
$hit = Get-Content .env, "$env:USERPROFILE\.config\zlib\.env" -ErrorAction SilentlyContinue |
    Select-String '^\s*(export\s)?ZLIB_DOWNLOAD_DIR='
if ($hit) { $hit.Line } else { "no .env entry" }

When either source has a value, omit --dir and let zlib resolve it — that keeps one behaviour across every command and avoids re-deriving the path yourself. Pass --dir only when the user asks for a different folder for that one download; it overrides the variable for that run.

Older zlib builds ignore ZLIB_DOWNLOAD_DIR and always default to the current directory. The Saved to: line tells you which happened: if the file landed in the working directory despite the variable being set, the binary predates it — pass --dir explicitly for the rest of the session and suggest go install github.com/heartleo/zlib/cmd/zlib@latest.

Otherwise, ask where to save first. Unless the user already named a folder, ask them before downloading. Offer the common landing spots and allow a custom path. Resolve each option to a platform-correct absolute path and show it so the user sees exactly where the file will land:

OptionWindowsmacOSLinux
Downloads (recommended)%USERPROFILE%\Downloads~/Downloads~/Downloads (or xdg-user-dir DOWNLOAD if available)
./books in current dirsame everywhere — resolve to absolute
Desktop%USERPROFILE%\Desktop~/Desktop~/Desktop — may not exist on server/minimal installs; offer only if the directory exists
Otheruser types any path

Notes:

  • Detect the platform from the current shell ($IsWindows/$IsMacOS/$IsLinux in PowerShell, or uname -s on POSIX).
  • --dir expands a leading ~ itself, so --dir "~/Downloads" is safe; expand %USERPROFILE% yourself. --dir does not create the folder, so create it first with the current shell.
  • On headless Linux (no Desktop dir, SSH session), drop the Desktop option rather than offering a path that doesn't exist.
  • Remember the chosen folder for the rest of the session — don't re-ask on every download; re-confirm only if the user switches context.
  • If the user says they always want the same folder, offer to make it permanent so no future session has to ask: append ZLIB_DOWNLOAD_DIR=<path> to ~/.config/zlib/.env (create the file as shown under Output & errors, and don't overwrite what's already in it).

Saves to --dir, else ZLIB_DOWNLOAD_DIR, else the current directory. When it detects no terminal (i.e. you running it), it prints a plain Downloading… / Saved to: <path> (<n> bytes) and exits cleanly with code 0. Just run it and read the printed path — that line is the authority on where the file went, so report it rather than the folder you expected:

bash
zlib download Gz31nyAV5E --dir ./books
ls -la ./books/                       # POSIX: optional verification
powershell
zlib download Gz31nyAV5E --dir ./books
Get-ChildItem ./books                 # PowerShell: optional verification

Flags: -d/--dir (falls back to ZLIB_DOWNLOAD_DIR, then .), --send-to-kindle.

Compatibility: older zlib builds (before the no-TTY plain path) render an interactive progress display and can hang without a terminal. If a download fails to return, stop it with the shell tool's execution timeout and verify the target directory instead of trusting the exit code. A complete file of the size shown in the search table is a success. Suggest upgrading with go install github.com/heartleo/zlib/cmd/zlib@latest.

Show full SKILL.md (462 more words)Show less
History — zlib history --json

Prefer --json: it always forces the static path (never the interactive browser, even bare) and prints {"items":[…],"page":n,"total_pages":n} with each item's id, name, extension, size, date. Relay it as a markdown table (same rule as search — complete rows, never raw JSON).

bash
zlib history --json                          # list past downloads as JSON
zlib history --json --page 2 --format epub   # paginate / filter
zlib history --download Gz31nyAV5E --dir ./books   # re-download a book from history

--download uses the same download path as zlib download — it exits cleanly with no TTY, same as above.

Flags: --json, -p/--page, -f/--format, -D/--download <book-id>, -d/--dir (same ZLIB_DOWNLOAD_DIR fallback), --send-to-kindle.

Older binary without --json: bare zlib history opens an interactive browser — always pass --page/--format to force the static table.

Profile — zlib profile --json

Shows the daily download quota. --json prints {"daily_amount":n,"daily_allowed":n,"daily_remaining":n,"daily_reset":"…"}; without it, a styled card. Also doubles as the login check in preflight.

Kindle delivery → the /zlib:kindle skill

Sending a downloaded file to Kindle (and the SMTP/Amazon setup it needs) lives in a separate skill, zlib:kindle. When the user wants a book on their Kindle, hand off to it rather than documenting SMTP here. zlib download --send-to-kindle also delivers in one step once Kindle is configured.

Typical flow

  1. Preflight (binary + login).
  2. zlib search "<what the user wants>" → show the table.
  3. If several matches are plausible, ask the user to pick; otherwise infer the best ID from title, author, format, and size.
  4. zlib download <id> --dir <dir> → read the printed Saved to: path and report it.
  5. If the user wants it on their Kindle, use the bundled kindle skill.

Output & errors

  • zlib output is plain text / Unicode tables — just relay the relevant rows; don't dump raw ANSI.

  • On session expired / Not logged in mid-session, the session lapsed — reuse the same friendly separate-terminal zlib login handoff from preflight #2 (never pass credentials as flags), then wait for the user.

  • Network/domain errors: Z-Library mirrors change often. If requests fail with a domain/connection error, have the user set ZLIB_DOMAIN (a working mirror) or ZLIB_PROXY by editing their env file rather than putting secrets or reusable configuration in shell history. Create the directory and file without overwriting an existing file, then show its absolute path.

    bash
    mkdir -p ~/.config/zlib; touch ~/.config/zlib/.env; chmod 600 ~/.config/zlib/.env
    echo "Edit: $(cd ~/.config/zlib && pwd)/.env  (add ZLIB_DOMAIN=… or ZLIB_PROXY=…, one per line)"
    powershell
    $configDir = Join-Path $env:USERPROFILE '.config\zlib'
    New-Item -ItemType Directory -Force $configDir | Out-Null
    $envFile = Join-Path $configDir '.env'
    if (-not (Test-Path $envFile)) { New-Item -ItemType File $envFile | Out-Null }
    $envFile

    Open helpers: Windows notepad "$env:USERPROFILE\.config\zlib\.env" · macOS open -t ~/.config/zlib/.env · Linux ${EDITOR:-nano} ~/.config/zlib/.env. Then retry. Older zlib builds read ZLIB_DOMAIN only from a real exported environment variable, never from an env file, and let the domain saved in session.json override it — if a configured mirror appears to be ignored, have the user upgrade, or export ZLIB_DOMAIN=… for the current shell as a stopgap.

  • Respect the user's daily download limit shown by zlib profile; don't loop downloads past it.

© heartleo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/zlib/skills/zlib of heartleo/zlib.

Open the folder on GitHubat commit 6a299fd

Compare with similar skills

Zlib next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Zlib compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Zlib this skillheartleo/zlib661—~3.3kAutomated safety check: NotesMIT
Jtackanner/jta133—~2.4kAutomated safety check: NotesMIT
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
ModLens Image Vision Bridgeliustack/modlens4.2k1 repos~1.3kAutomated safety check: NotesMIT
Nano Banana Pro Prompts Recommend SkillYouMind-OpenLab/nano-banana-pro-prompts-recommend-skill1.9k1 repos~4.1kAutomated safety check: PassNone
Codebase Managementgiancarloerra/SocratiCode3.3k1 repos~1.8kAutomated safety check: PassAGPL-3.0

Similar skills

  • Jta

    ckanner/jta

    Translate JSON i18n files to multiple languages with AI-powered quality optimization.

    133 GitHub stars~2.4k tokensUpdated 11 mo ago
    Frontend & DesignAuto-check: notes
  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated today
    Media & CreativeAuto-check passed
  • Gives text-only models sight by running the modlens CLI on an image path or URL and returning structured JSON evidence with transcribed text, layout and semantics.

    4.2k GitHub starsUsed in 1 repo~1.3k tokens
    AI & LLM EngineeringAuto-check: notes
  • Nano Banana Pro Prompts Recommend Skill

    YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill

    Recommend suitable prompts from 10,000+ Nano Banana Pro image generation prompts based on user needs.

    1.9k GitHub starsUsed in 1 repo~4.1k tokens
    Media & CreativeAuto-check passed
  • Codebase Management

    giancarloerra/SocratiCode

    Set up, index, and manage SocratiCode codebase indexing. An agent skill from giancarloerra/SocratiCode.

    3.3k GitHub starsUsed in 1 repo~1.8k tokens
    AI & LLM EngineeringAuto-check passed
  • AI Provenance Mark Remover

    guillaumemeyer/watermarks-remover

    Strips AI provenance marks from text and files: invisible Unicode, statistical text watermarks via rewriting, and C2PA, EXIF or XMP metadata across common formats.

    24k GitHub stars~4.9k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed

More from heartleo/zlib

  • Kindle

    heartleo/zlib

    Send a downloaded book file to a Kindle via the zlib CLI, and walk the user through the one-time SMTP/Amazon setup it needs.

    661 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check: notes

Questions about Zlib

What does Zlib do?

Search and download books from Z-Library. An agent skill from heartleo/zlib. Zlib is an agent skill from heartleo/zlib. Search and download books from Z-Library.

When should I use Zlib?

Zlib fits situations like: the user wants to find; browse books from Z-Library.

How do I install Zlib in Claude Code?

Run `npx skills add heartleo/zlib --skill zlib -a claude-code`. Or copy the skill folder (plugins/zlib/skills/zlib in heartleo/zlib) into .claude/skills/zlib in your project. Claude Code loads it when a task matches its description.

How do I install Zlib in Codex?

Run `npx skills add heartleo/zlib --skill zlib -a codex`. Or copy the skill folder (plugins/zlib/skills/zlib in heartleo/zlib) into .agents/skills/zlib in your project. Codex loads it when a task matches its description.

Can I use Zlib in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add heartleo/zlib --skill zlib -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/zlib, .gemini/skills/zlib, .github/skills/zlib and .opencode/skills/zlib in your project.

What does Zlib need to run?

Going by SKILL.md and its folder, Zlib needs the command-line tools its instructions call (go, brew and gh). Our summary lists: Python 3.

Does Zlib access the network?

SKILL.md contains no URLs. Its commands use gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Zlib safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Zlib use?

Zlib is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Zlib use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Zlib?

Skills that share tags, products or a category with Zlib: Jta (ckanner/jta, 133 stars), AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), ModLens Image Vision Bridge (liustack/modlens, 4.2k stars) and Nano Banana Pro Prompts Recommend Skill (YouMind-OpenLab/nano-banana-pro-prompts-recommend-skill, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Zlib?

heartleo (a GitHub user) maintains it in heartleo/zlib, which has 661 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 7, 2026.

Source: heartleo/zlib on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.