--- name: "cli-anything-calibre" description: >- 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)... --- # 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: ```bash 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) ```bash # 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 ```bash # 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: ```bash 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 ` | 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 ` | Search using Calibre query language | | `add ` | Add book files to library | | `remove ` | Remove books (move to trash or permanent delete) | | `show ` | Show full metadata for a book | | `export ` | Export books to directory | | `export-chapters ` | Export each chapter as separate PDF (requires EPUB format) | ### Meta Metadata editing (wrap `calibredb set_metadata`). | Command | Description | |---------|-------------| | `get [field]` | Get metadata (all or specific field) | | `set ` | Set a metadata field | | `embed ` | Embed metadata into book files | ### Formats Format management (wrap `calibredb` + `ebook-convert`). | Command | Description | |---------|-------------| | `list ` | List available formats for a book | | `add ` | Add a format to a book | | `remove ` | Remove a format from a book | | `convert ` | Convert book format | ### Custom Custom columns (wrap `calibredb`). | Command | Description | |---------|-------------| | `list` | List all custom columns | | `add