Skip to content

Guide · Agent skill

How to use the Calibre E-book Library CLI agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

This guide explains what the cli-anything-calibre agent skill does, how to install it, and how to ask an AI agent to work with your Calibre e-book library. It is written for readers who have not used agent skills before. By the end you will know the prerequisites, how to trigger the skill with plain requests, and which safety steps to take before letting an agent change your files.

Calibre E-book Library CLIHKUDS/CLI-Anything · Apache-2.0

Quick start

  1. 1Install Calibre. Install the Calibre desktop application and confirm that calibredb, ebook-convert and ebook-meta are on your PATH.
  2. 2Check Python. Make sure Python 3.10 or newer is installed on your computer.
  3. 3Install the CLI package. Run the pip install command from the HKUDS/CLI-Anything repository, using the calibre/agent-harness subdirectory.
  4. 4Add the skill files. Download the skill ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings, Capabilities, Skills in the Claude apps.
  5. 5Connect your library. Run library connect with the path to your Calibre library folder, then confirm with a simple list command.
  6. 6Back up your library. Copy the whole library folder before allowing any bulk edits, conversions or removals.
  7. 7Ask in plain language. Describe the books and changes you want, and ask the agent to preview the commands before running them.

What the Calibre skill lets the agent do

The skill teaches an AI agent to operate Calibre, a desktop e-book manager, through a command-line tool called cli-anything-calibre. It wraps the real Calibre tools already on your computer: calibredb, ebook-convert and ebook-meta.

The agent can list and search books in your library, edit titles, authors, tags, series and ratings, convert a book between formats such as EPUB, MOBI and PDF, export chapters as separate PDFs, and generate catalogs. Results come back as structured JSON that the agent can read.

  • Library: connect to a library, show statistics, and check its integrity
  • Books: list, search, add, remove, show, and export books
  • Metadata: get, set and embed metadata fields
  • Formats: list, add, remove and convert formats
  • Custom columns: list, add, remove and set values
  • Catalog: generate a catalog as EPUB, CSV or OPDS

Check the requirements before you install

You need Python 3.10 or newer and the Calibre desktop application. Calibre is a hard requirement: the skill calls its tools, so it will not work without them. The source lists sudo apt-get install calibre for Debian and Ubuntu and brew install --cask calibre for macOS.

After installing Calibre, confirm that the three tools are on your PATH. If a command prints nothing or an error, the skill will not be able to find them.

  • Python 3.10+
  • Calibre desktop application (provides calibredb, ebook-convert and ebook-meta)
  • Network access to GitHub for the pip install step
sudo apt-get install calibre brew install --cask calibre which calibredb which ebook-convert which ebook-meta

Install the cli-anything-calibre package

The CLI is installed as part of a Python package from the HKUDS/CLI-Anything GitHub repository, in the calibre/agent-harness folder. This step runs pip, which downloads code from GitHub, so only do it if you trust the source.

You can also install the skill files themselves. Download the skill ZIP from this page and unzip it into ~/.claude/skills/ for your user account, or into a project's .claude/skills/ folder to limit it to that project. In the Claude apps, you can instead upload the ZIP under Settings, then Capabilities, then Skills.

pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=calibre/agent-harness

Connect the skill to your library

Point the CLI at your Calibre library folder. The active library path is saved between sessions, so you normally only need to do this once. You can also set the CALIBRE_LIBRARY environment variable or pass a --library flag.

To check the CLI is working, ask for help or run a simple list command. Use the --json flag when an agent is reading the output.

  • Session file: ~/.cli-anything-calibre/session.json
  • Environment override: CALIBRE_LIBRARY
cli-anything-calibre --help cli-anything-calibre library connect ~/Calibre\ Library cli-anything-calibre --json books list

Trigger the skill with natural requests

You do not need to type commands yourself. Once the skill is installed, ask the agent in plain language about your library, and it can choose the matching commands. Name the book, author, format or outcome you want, and say whether you want changes made.

For bulk work, describe the rule and the scope. For example, ask the agent to list every book by one author, show the current tags, and then propose changes before applying them. Asking for a preview first is a good habit for any edit.

  • Find every Asimov book tagged scifi in my Calibre library.
  • Set the rating to 5 on book 42 and tell me what changed.
  • Convert book 42 from EPUB to PDF and save it to my downloads folder.
  • Export each chapter of book 42 as a PDF, first five chapters only.
  • Generate an EPUB catalog of my library.

Search, edit and convert: examples

Searches use the Calibre query language, which supports fields such as author, title, tags, series and rating. Edits use meta set with a book ID, a field name and a value. Format conversion takes a book ID, an input format and an output format.

Chapter export only works on EPUB files, so the agent must convert a book to EPUB first if it is in another format. Remember that removing books and editing metadata or formats change files directly.

  • Search examples: title:Foundation, rating:>3, has:cover, not:tags:fiction
  • Editable fields include title, authors, tags, series, series_index, rating, publisher, pubdate, comments, languages and identifiers
cli-anything-calibre books search "author:asimov and tags:scifi" cli-anything-calibre meta set 42 rating 5 cli-anything-calibre formats convert 42 EPUB PDF --output /tmp/book.pdf cli-anything-calibre books export-chapters 42 --to-dir ./pdfs --chapters 1-5

Safety: back up, and know what the skill touches

The skill runs scripts and uses the network during installation. It modifies your library: removing books, editing metadata and changing formats alter files directly, and mistakes can be hard to undo. Make a complete backup of your Calibre library folder before you let an agent make bulk changes.

Test on a copy of a few books first. When you ask for edits, ask the agent to show the commands and the expected result before it runs them. Check the return code and confirm output files exist after exports or conversions, as the skill's own agent guidance recommends.

  • Back up the whole library folder before bulk edits or removals
  • Try the workflow on a small test library or a few books first
  • Ask for a preview of changes before they are applied
  • Check return codes and confirm exported or converted files exist

What people use it for

  • Clean up tags, series and ratings across a large library in one session.
  • Convert a manuscript between EPUB, PDF and MOBI for different reviewers or devices.
  • Export selected chapters of an EPUB as separate PDFs.
  • Generate an OPDS, CSV or EPUB catalog of your library.
  • Let a script read structured JSON output from Calibre for reporting.

Frequently asked questions

Is the Calibre agent skill free to use?

The skill is published under the Apache-2.0 licence in the HKUDS/CLI-Anything repository. Calibre is a separate application that must be installed on your computer, and the skill needs it to work.

What do I need to install the Calibre CLI skill?

You need Python 3.10 or newer, the Calibre desktop application that provides calibredb, ebook-convert and ebook-meta, and network access to GitHub for the pip install step.

Can I use the skill without Calibre installed?

No. The source describes Calibre as a hard dependency because the CLI wraps the real Calibre tools. Install Calibre first and confirm the three tools are on your PATH.

How do I install the skill for Claude?

Download the skill ZIP from this page and unzip it into ~/.claude/skills/, or into a project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings, then Capabilities, then Skills.

Why does the agent say a chapter export failed?

Chapter export requires the book to be in EPUB format. Convert the book to EPUB first with the formats convert command, then run export-chapters again.

Is there an alternative if I do not want an agent involved?

You can run calibredb, ebook-convert and ebook-meta directly from a terminal, since the skill wraps those same tools. The CLI itself adds structured JSON output and a single interface for agents and scripts.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

This skill suits owners of large Calibre libraries, authors converting files between formats, and developers who want JSON output from Calibre. Skip it if you do not have Calibre installed, if you are uncomfortable installing Python packages from GitHub, or if you cannot back up your library before letting an agent edit or remove books.

Download the skill