cli-anything-calibre
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)...
What this skill does
# 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 <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. ```bash 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. ```bash 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. ```bash 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. ```bash 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. ```bash 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 Language Used with `books search` and `books list --search`: ``` author:asimov # Author contains "asimov" title:"Foundation" # Title phrase tags:fiction # Tag match rating:>3 # Rating greater than 3 series:"Foundation" # Series match pubdate:[2020-01-01,2021-12-31] # Date range identifiers:isbn:1234567890 # Specific identifier has:cover # Has cover image not:tags:fiction # Negation author:asimov and tags:scifi # Boolean AND ``` ## Key Metadata Fields | Field | Type | Description | |-------|------|-------------| | `title` | text | Book title | | `authors` | text | Author names (&-separated) | | `tags` | text | Comma-separated tags | | `series` | text | Series name | | `series_index` | float | Position in series | | `rating` | float | Rating 1-5 | | `publisher` | text | Publisher name | | `pubdate` | datetime | Publication date | | `comments` | text | Description/comments | | `languages` | text | Language codes | | `identifiers` | text | ISBN, ASIN, etc. (`type:value`) | ## Supported Formats **Input:** EPUB, MOBI, AZW, AZW3, PDF, HTML, DOCX, ODT, FB2, TXT, RTF, LIT, and more **Output (conversion):** EPUB, MOBI, AZW3, PDF, HTML, DOCX, TXT, and more ## State Management The CLI maintains session state with: - **Session file**: `~/.cli-anything-calibre/session.json` - **Library path persistence**: Active library is saved across sessions - **Environment override**: `CALIBRE_LIBRARY` environment variable ## Output Formats All commands support dual output modes: - **Human-readable** (default): Tables, colors, formatted text - **Machine-readable** (`--json` flag): Structured JSON for agent consumption ```bash # Human output cli-anything-calibre books list # JSON output for agents cli-anything-calibre --json books list ``` ## For AI Agents When using this CLI programmatically: 1. **Always use `--json` flag** for parseable output 2. **Check return codes** - 0 for success, non-zero for errors 3. **Parse stderr** for error messages on failure 4. **Verify outputs exist** after export/conversion operations 5. **Use `--library` flag** or `CALIBRE_LIBRARY` env to specify library path 6. **Chapter export requires EPUB format** - convert first if needed ## More Information - Full documentation: See README.md in the package - Architecture SOP: See CALIBRE.md in the agent-harness directory - Test coverage: See test_core.py and test_full_e2e.py in the tests directory - Methodology: See HARNESS.md in the cli-anything-plugin ## Version 1.0.0
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".