cli-anything-calibre
它能做什么
这个技能让智能体管理 Calibre 中的电子书库,包括书籍列表、元数据和文件格式转换。适合收藏了大量电子书的人。
适用场景
- ✓当你想列出或搜索 Calibre 书库中的书籍时。
- ✓当你想修正某本书的书名、作者或其他元数据的时候。
- ✓当你想把电子书转换为其他格式的时候。
技能链接
https://github.com/HKUDS/CLI-Anything/blob/main/calibre/agent-harness/cli_anything/calibre/skills/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在 Calibre 中找出我所有的厄苏拉·勒古恩作品,并把其中一本转换为 EPUB。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能在后台使用真正的 Calibre 工具,例如 calibredb 和 ebook-convert,来读取和修改你的书库。然后你的智能体以清晰的结构化形式报告结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
cli-anything-calibre
A stateful CLI harness for Calibre e-book management. Wraps the real Calibre tools (calibredb, ebook-convert, ebook-meta) to give AI agents and scripts a clean, structured interface for library operations, metadata editing, and format conversion.
Installation
This CLI is installed as part of the cli-anything-calibre package:
pip install git+https://github.com/HKUDS/CLI-Anything.git#subdirectory=calibre/agent-harness
Prerequisites:
- Python 3.10+
- Calibre must be installed on your system (hard dependency)
# Debian/Ubuntu
sudo apt-get install calibre
# macOS
brew install --cask calibre
# Verify tools are in PATH
which calibredb
which ebook-convert
which ebook-meta
Usage
Basic Commands
# Show help
cli-anything-calibre --help
# Start interactive REPL mode
cli-anything-calibre
# Connect to a Calibre library
cli-anything-calibre library connect ~/Calibre\ Library
# Run with JSON output (for agent consumption)
cli-anything-calibre --json books list
REPL Mode
When invoked without a subcommand, the CLI enters an interactive REPL session:
cli-anything-calibre
# Enter commands interactively with tab-completion and history
# Use 'help' to see available commands
# Use 'quit' or 'exit' to leave
Command Groups
Library
Library management commands.
| Command | Description |
|---|---|
connect <path> |
Set active library path |
info |
Show library statistics (book count, formats, db size) |
check |
Verify library integrity using calibredb check_library |
Books
Book operations (wrap calibredb).
| Command | Description |
|---|---|
list |
List books with filtering and sorting |
search <query> |
Search using Calibre query language |
add <files> |
Add book files to library |
remove <ids> |
Remove books (move to trash or permanent delete) |
show <id> |
Show full metadata for a book |
export <ids> |
Export books to directory |
export-chapters <id> |
Export each chapter as separate PDF (requires EPUB format) |
Meta
Metadata editing (wrap calibredb set_metadata).
| Command | Description |
|---|---|
get <id> [field] |
Get metadata (all or specific field) |
set <id> <field> <value> |
Set a metadata field |
embed <ids> |
Embed metadata into book files |
Formats
Format management (wrap calibredb + ebook-convert).
| Command | Description |
|---|---|
list <id> |
List available formats for a book |
add <id> <file> |
Add a format to a book |
remove <id> <fmt> |
Remove a format from a book |
convert <id> <input_fmt> <output_fmt> |
Convert book format |
Custom
Custom columns (wrap calibredb).
| Command | Description |
|---|---|
list |
List all custom columns |
add <label> <name> <type> |
Create custom column |
remove <label> |
Delete custom column |
set <id> <label> <value> |
Set custom field value |
Catalog
Catalog generation.
| Command | Description |
|---|---|
catalog <output> |
Generate a catalog of the library (EPUB, CSV, or OPDS) |
Examples
Connect and List Books
Connect to your Calibre library and list books.
cli-anything-calibre library connect ~/Calibre\ Library
cli-anything-calibre books list
# Or with JSON output
cli-anything-calibre --json books list --search "author:asimov"
Search and Filter
Search books using Calibre query language.
cli-anything-calibre books search "title:Foundation"
cli-anything-calibre books search "author:asimov and tags:scifi"
cli-anything-calibre books search "rating:>3"
Metadata Editing
Set metadata fields on books.
cli-anything-calibre meta set 42 title "New Title"
cli-anything-calibre meta set 42 series "Foundation"
cli-anything-calibre meta set 42 series_index 1
cli-anything-calibre meta set 42 tags "scifi,classic"
cli-anything-calibre meta set 42 rating 5
Format Conversion
Convert between e-book formats.
cli-anything-calibre formats convert 42 EPUB MOBI
cli-anything-calibre formats convert 42 EPUB PDF --output /tmp/book.pdf
Export Chapters as PDFs
Export each chapter of an EPUB as a separate PDF file.
cli-anything-calibre books export-chapters 42 --to-dir ./pdfs
cli-anything-calibre books export-chapters 42 --to-dir ./pdfs --chapters 1-5
Calibre Query
常见问题
我需要安装 Calibre 吗?
需要。该技能依赖 Calibre 的工具,因此必须安装 Calibre。
如何将它连接到我的书库?
你把该技能指向你的 Calibre 书库文件夹,之后的命令会保持连接。
我可以在脚本中使用它吗?
可以。它有 JSON 输出模式,便于脚本和 AI 智能体读取。
详情
作者的原始描述
Command-line interface for Calibre - A stateful CLI harness for e-book library management, metadata editing, and format conversion wrapping the real Calibre tools (calibredb, ebook-convert, ebook-meta)...
repo: HKUDS/CLI-Anything
热度
- GitHub 星标
- 58k
- 排名
- #3186
- 许可证
- Apache-2.0
- 更新时间
- 2026/9/21
评论
- …
同一仓库的更多技能
cli-anything-3mf
58k帮你的智能体检查和修复 3D 打印文件,包括查找圆孔、调整孔径、修复网格,以及比较两个文件。
cli-anything-qgis
58k帮你的智能体在终端中打开、编辑和导出 QGIS 地图项目,包括图层、要素、打印布局和处理工具。
cli-anything-adguardhome
58k帮你的智能体管理 AdGuard Home,这是一款全网络广告拦截器,可管理过滤规则、DNS 重写、客户端和查询日志。
cli-anything-anygen
58k帮你的智能体借助 AnyGen 服务,根据文字提示生成幻灯片、文档、网站和图表。