### Connecting to a Remote Calibre Content Server Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Example of how to specify a remote library using a URL. The library ID can be a specific ID or '-' to list available libraries. ```bash http://localhost:8080/#mylibrary ``` -------------------------------- ### Customize Match Markers in Snippets Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Define custom markers for the start and end of matched words within snippets using --match-start-marker and --match-end-marker. ```bash calibredb fts_search --match-start-marker "" --match-end-marker "" "search expression" ``` -------------------------------- ### Reading Password from Standard Input Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Demonstrates how to use '' to securely provide a password for Content server authentication without hardcoding it. ```bash ``` -------------------------------- ### Basic `calibredb` Command Structure Source: https://manual.calibre-ebook.com/generated/en/calibredb.html This shows the general syntax for using the `calibredb` command. Replace 'command' with a specific sub-command like 'list', 'add', or 'search'. ```bash calibredb command [options] [arguments] ``` -------------------------------- ### List Custom Columns Source: https://manual.calibre-ebook.com/generated/en/calibredb.html This command lists all available custom columns, showing their labels and IDs. Use the `--details` option to view more information about each column. ```bash calibredb custom_columns [options] ``` ```bash --details, -d ``` -------------------------------- ### Backup Metadata to OPF Files Source: https://manual.calibre-ebook.com/generated/en/calibredb.html This command backs up metadata from the database into individual OPF files in each book's folder. It can be forced to regenerate all OPF files using the --all option. Normally, OPF files are backed up automatically when metadata changes. ```bash calibredb backup_metadata [options] ``` -------------------------------- ### Configure Indexing Threshold for Searching Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Set the minimum library indexing percentage required before searches are permitted using --indexing-threshold. Defaults to 90%. ```bash calibredb fts_search --indexing-threshold 95 "search expression" ``` -------------------------------- ### List Available Metadata Fields Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Lists all available metadata field names that can be used with the --field option for setting metadata. ```bash --list-fields, -l List the metadata field names that can be used with the `--field` option ``` -------------------------------- ### Export With Progress Reporting Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Enables progress reporting during the export process. ```bash calibredb export --progress ``` -------------------------------- ### Clone Calibre Library Structure Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Create a clone of the current library, which results in a new, empty library with identical custom columns, virtual libraries, and settings. To create a full duplicate including books, use filesystem copy operations. ```bash calibredb clone path/to/new/library ``` -------------------------------- ### Set Book Metadata from OPF Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Sets a book's metadata using an OPF file. Alternatively, individual fields can be set using the --field option without an OPF file. Enclose arguments with spaces in quotation marks. ```bash calibredb set_metadata [options] book_id [/path/to/metadata.opf] ``` -------------------------------- ### Catalog With Verbose Output Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Enables detailed output information, which is useful for debugging. ```bash calibredb catalog --verbose ``` -------------------------------- ### Export All Books Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Exports all books in the database, ignoring any specified IDs. ```bash calibredb export --all ``` -------------------------------- ### Add E-book Format Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Adds a new format to an existing book identified by its ID. If the format exists, it will be replaced unless --dont-replace is specified. Use --as-extra-data-file to add as extra data instead of a format. Enclose arguments with spaces in quotation marks. ```bash calibredb add_format [options] id ebook_file ``` -------------------------------- ### Export With Custom Filename Template Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Defines the filename and folder structure using a template. The default template organizes by author and title. ```bash calibredb export --template="{title} - {authors}" ``` -------------------------------- ### Generate Catalog Command Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Exports a catalog of books in a specified format (CSV, EPUB, MOBI, XML, etc.). Options control the output details. Enclose paths with spaces in quotation marks. ```bash calibredb catalog /path/to/destination.(csv|epub|mobi|xml...) [options] ``` -------------------------------- ### Export Specific Formats Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Specifies a comma-separated list of formats to save for each book. Defaults to saving all available formats. ```bash calibredb export --formats="epub,pdf" ``` -------------------------------- ### Show Book Metadata Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Displays the metadata for a given book ID. Use the --as-opf option to view metadata in OPF (XML) format. Enclose arguments with spaces in quotation marks. ```bash calibredb show_metadata [options] id ``` -------------------------------- ### Catalog Specific IDs Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Specifies a comma-separated list of database IDs to include in the catalog. If provided, the --search option is ignored. ```bash calibredb catalog --ids="1,5,10" ``` -------------------------------- ### Search Calibre Library for Books Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Search the library using Calibre's search query language and return a comma-separated list of matching book IDs. The output is suitable for input into other commands. A limit can be set for the number of results. ```bash calibredb search [options] search expression ``` -------------------------------- ### Export to Single Directory Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Exports all books into a single folder, rather than creating individual subfolders. ```bash calibredb export --single-dir ``` -------------------------------- ### Export to Specific Directory Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Specifies the destination folder for exported books. Defaults to the current directory. ```bash calibredb export --to-dir="/path/to/export" ``` -------------------------------- ### clone Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Creates a clone of the current library, including all custom columns, Virtual libraries, and other settings, but without any books. ```APIDOC ## clone ### Description Create a clone of the current library. This creates a new, empty library that has all the same custom columns, Virtual libraries and other settings as the current library. The cloned library will contain no books. ### Method CLI Command ### Endpoint calibredb clone path/to/new/library ### Parameters #### Path Parameters - **path/to/new/library** (string) - Required - The path to the new library to be created. ### Request Example ``` calibredb clone "/path/to/my new library" ``` ### Response #### Success Response - A new, empty library is created at the specified path with the same settings as the current library. #### Response Example ``` (No specific output, operation is performed in place) ``` ``` -------------------------------- ### Reading Password from a File Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Shows the syntax for specifying a password stored in a file using ''. Ensure the path is correct and angle brackets are handled by the shell. ```bash ``` -------------------------------- ### Restore Database from OPF Files Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Restores the Calibre metadata database from OPF files. This is a destructive operation that regenerates the database and requires the `--really-do-it` flag to proceed. ```bash calibredb restore_database [options] ``` ```bash --really-do-it, -r ``` -------------------------------- ### Configure Enumeration Column Display Source: https://manual.calibre-ebook.com/generated/en/calibredb.html For enumeration columns, the `--display` option accepts a JSON string to define enumeration values and their associated display properties, such as colors. ```bash --display"{ \"enum_values\":[ \"val1\" , \"val2\" ]}" ``` -------------------------------- ### List Categories in Calibre Database Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Use this command to generate a report of category information, similar to the Tag browser. Options allow filtering by category names, outputting in CSV format, specifying CSV dialect, showing item counts, and setting line width. ```bash calibredb list_categories [options] ``` -------------------------------- ### Specify Output Format for Search Results Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Control the output format of search results using --output-format, choosing between plain text ('text') or JSON ('json'). ```bash calibredb fts_search --output-format "json" "search expression" ``` -------------------------------- ### backup_metadata Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Backs up the metadata stored in the database into individual OPF files in each book's folder. Can be forced to re-generate OPF files for all books. ```APIDOC ## backup_metadata ### Description Backup the metadata stored in the database into individual OPF files in each books folder. This normally happens automatically, but you can run this command to force re-generation of the OPF files, with the –all option. ### Method CLI Command ### Endpoint calibredb backup_metadata [options] ### Parameters #### Query Parameters - **--all** (boolean) - Optional - Normally, this command only operates on books that have out of date OPF files. This option makes it operate on all books. ### Request Example ``` calibredb backup_metadata --all ``` ### Response #### Success Response - The command completes execution, updating OPF files as specified. #### Response Example ``` (No specific output, operation is performed in place) ``` ``` -------------------------------- ### Export Books Command Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Exports specified books with their metadata, cover, and associated files. Use IDs obtained from the search command. Enclose paths with spaces in quotation marks. ```bash calibredb export [options] ids ``` -------------------------------- ### Remove E-book Format Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Removes a specified format from a book. If the book does not have the format, the command does nothing. Enclose arguments with spaces in quotation marks. ```bash calibredb remove_format [options] id fmt ``` -------------------------------- ### Control Full-Text Search Indexing Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Manage the Full-Text Search (FTS) indexing process. Commands include enabling, disabling, checking status, and re-indexing the library or specific books. Options control indexing speed and whether to wait for completion. ```bash calibredb fts_index [options] enable/disable/status/reindex ``` -------------------------------- ### Export With Custom Date Format Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Specifies the date format for use in templates. Supports day (%d), month (%b, %m), and year (%Y). ```bash calibredb export --timefmt="%Y-%m-%d" ``` -------------------------------- ### Set Specific Metadata Field Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Sets a specific metadata field for a book. The format is field_name:value. Multiple fields can be set by repeating the option. Use ISO639 codes for languages and specific syntax for identifiers. Boolean fields accept true/false or yes/no. ```bash --field, -f The field to set. Format is field_name:value, for example: `--field` tags:tag1,tag2. Use `--list-fields` to get a list of all field names. You can specify this option multiple times to set multiple fields. Note: For languages you must use the ISO639 language codes (e.g. en for English, fr for French and so on). For identifiers, the syntax is `--field` identifiers:isbn:XXXX,doi:YYYYY. For boolean (yes/no) fields use true and false or yes and no. ``` -------------------------------- ### Export With Lowercase Paths Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Converts all generated paths to lowercase. ```bash calibredb export --to-lowercase ``` -------------------------------- ### Full-Text Search Including Text Snippets Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Enable the inclusion of surrounding text snippets for each match using --include-snippets. Be aware this significantly slows down search performance. ```bash calibredb fts_search --include-snippets "search expression" ``` -------------------------------- ### Enable Multiple Values for Text Column Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Use the `--is-multiple` flag when creating a text column if it needs to store multiple, comma-separated values. ```bash --is-multiple ``` -------------------------------- ### Embed Metadata into Book Files Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Update metadata within actual book files from the Calibre database. This command is useful for updating files in place. It supports updating metadata for specific book IDs, ranges, or all books, and can be restricted to certain formats. ```bash calibredb embed_metadata [options] book_id ``` -------------------------------- ### Add a Custom Column Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Use this command to create a new custom column in your Calibre database. Specify the column's label, human-friendly name, and data type. Options like `--display` allow for detailed customization based on data type. ```bash calibredb add_custom_column [options] label name datatype ``` -------------------------------- ### Basic Full-Text Search Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Perform a full-text search using a search expression. Enclose arguments with spaces in quotation marks. ```bash calibredb fts_search [options] search expression ``` -------------------------------- ### Export With Whitespace Replacement Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Replaces whitespace characters in filenames with underscores. ```bash calibredb export --replace-whitespace ``` -------------------------------- ### CalibreDB Saved Searches Management Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Manage saved searches in the Calibre database. Use quotation marks for arguments with spaces. ```bash calibredb saved_searches [options] (list|add|remove) ``` ```bash calibredb saved_searches add search_name search_expression ``` ```bash calibredb saved_searches remove search_name ``` ```bash calibredb "/some path/with spaces" ``` -------------------------------- ### Export Without Writing OPF Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Prevents calibre from writing the metadata into a separate OPF file. ```bash calibredb export --dont-write-opf ``` -------------------------------- ### Catalog Filtered by Search Query Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Filters the catalog entries based on a search query. Refer to the User Manual for search query syntax. ```bash calibredb catalog --search="title:Calibre" ``` -------------------------------- ### Check Library Integrity Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Performs various checks on the Calibre library filesystem to identify potential issues like invalid titles, missing formats, or malformed paths. Reports can be filtered using options like `--report`, `--ignore-extensions`, and `--ignore-names`. ```bash calibredb check_library [options] ``` ```bash --csv, -c ``` ```bash --ignore_extensions, -e ``` ```bash --ignore_names, -n ``` ```bash --report, -r ``` ```bash --vacuum-fts-db ``` -------------------------------- ### Export Without Saving Cover Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Prevents calibre from saving the book cover in a separate file. ```bash calibredb export --dont-save-cover ``` -------------------------------- ### list_categories Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Produces a report of the category information in the database, equivalent to the Tag browser. Supports filtering by categories, CSV output, dialect specification, item count display, and output width control. ```APIDOC ## list_categories ### Description Produce a report of the category information in the database. The information is the equivalent of what is shown in the Tag browser. ### Method CLI Command ### Endpoint calibredb list_categories [options] ### Parameters #### Query Parameters - **--categories, -r** (string) - Optional - Comma-separated list of category lookup names. Default: all - **--csv, -c** (boolean) - Optional - Output in CSV - **--dialect** (string) - Optional - The type of CSV file to produce. Choices: excel, excel-tab, unix - **--item_count, -i** (boolean) - Optional - Output only the number of items in a category instead of the counts per item within the category - **--width, -w** (integer) - Optional - The maximum width of a single line in the output. Defaults to detecting screen size. ### Request Example ``` calibredb list_categories --categories "fiction,non-fiction" --csv ``` ### Response #### Success Response - Output will be a formatted report of category information, potentially in CSV format if specified. #### Response Example ``` Category,Count Fiction,150 Non-Fiction,75 ``` ``` -------------------------------- ### Restrict Search Scope by Expression or IDs Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Limit the search to specific books using --restrict-to, either by providing a search expression (e.g., tag:foo) or a comma-separated list of IDs. ```bash calibredb fts_search --restrict-to "ids:1,2,3" "search expression" ``` ```bash calibredb fts_search --restrict-to "search:tag:foo" "search expression" ``` -------------------------------- ### Full-Text Search with Exact Word Matching Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Use the --do-not-match-on-related-words option to ensure only exact word matches are returned, excluding related word variations. ```bash calibredb fts_search --do-not-match-on-related-words "search expression" ``` -------------------------------- ### Set Custom Column Value Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Sets or updates the value of a custom column for a specific book, identified by its ID. Use the `--append` option to add values to multi-value columns instead of replacing them. ```bash calibredb set_custom [options] column id value ``` ```bash --append, -a ``` -------------------------------- ### Export Without ASCII Conversion Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Disables the conversion of non-English characters to English equivalents for filenames. Useful for legacy filesystems. ```bash calibredb export --dont-asciiize ``` -------------------------------- ### Export Without Saving Extra Files Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Disables the saving of data files associated with the book. ```bash calibredb export --dont-save-extra-files ``` -------------------------------- ### Remove Books by ID Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Removes books from the database using a comma-separated list of IDs. Ranges are supported but the end of the range is not included. Enclose arguments with spaces in quotation marks. ```bash calibredb remove ids ``` -------------------------------- ### fts_index Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Controls the Full Text Search (FTS) indexing process for the library, allowing enabling, disabling, checking status, and re-indexing. Supports controlling indexing speed and waiting for completion. ```APIDOC ## fts_index ### Description Control the Full text search indexing process. ### Method CLI Command ### Endpoint calibredb fts_index [options] enable/disable/status/reindex ### Parameters #### Path Parameters - **enable/disable/status/reindex** (string) - Required - The action to perform on FTS indexing. - **enable**: Turns on FTS indexing for this library. - **disable**: Turns off FTS indexing for this library. - **status**: Shows the current indexing status. - **reindex**: Can be used to re-index either particular books or the entire library. To re-index particular books specify the book ids as additional arguments after the reindex command. If no book ids are specified the entire library is re-indexed. #### Query Parameters - **--indexing-speed** (string) - Optional - The speed of indexing. Use fast for fast indexing using all your computers resources and slow for less resource intensive indexing. Note that the speed is reset to slow after every invocation. - **--wait-for-completion** (boolean) - Optional - Wait till all books are indexed, showing indexing progress periodically. ### Request Example ``` calibredb fts_index enable calibredb fts_index reindex --indexing-speed fast --wait-for-completion calibredb fts_index status ``` ### Response #### Success Response - Depending on the action, output will indicate success, status, or progress. #### Response Example ``` FTS indexing is enabled. Indexing status: 50% complete. ``` ``` -------------------------------- ### search Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Searches the library for a specified search term and returns a comma-separated list of book IDs matching the search expression. Supports limiting the number of results. ```APIDOC ## search ### Description Search the library for the specified search term, returning a comma separated list of book ids matching the search expression. The output format is useful to feed into other commands that accept a list of ids as input. ### Method CLI Command ### Endpoint calibredb search [options] search expression ### Parameters #### Path Parameters - **search expression** (string) - Required - The search query using calibre’s search query language. #### Query Parameters - **--limit, -l** (integer) - Optional - The maximum number of results to return. Default is all results. ### Request Example ``` calibredb search author:asimov 'title:"i robot"' --limit 10 ``` ### Response #### Success Response (200) - **book_ids** (string) - A comma-separated list of book IDs matching the search expression. #### Response Example ``` 1,5,12,23 ``` ``` -------------------------------- ### Export Without Updating Metadata Option Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Disables the updating of metadata in saved files from the calibre library, potentially speeding up the process. ```bash calibredb export --dont-update-metadata ``` -------------------------------- ### embed_metadata Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Updates the metadata in the actual book files stored in the calibre library from the metadata in the calibre database. Can update metadata in all books or specific formats. ```APIDOC ## embed_metadata ### Description Update the metadata in the actual book files stored in the calibre library from the metadata in the calibre database. Normally, metadata is updated only when exporting files from calibre, this command is useful if you want the files to be updated in place. ### Method CLI Command ### Endpoint calibredb embed_metadata [options] book_id ### Parameters #### Path Parameters - **book_id** (string) - Required - The ID of the book to update. Can be a single ID, a comma-separated list, or an ID range (e.g., '1', '1,2,10-15', 'all'). #### Query Parameters - **--only-formats, -f** (string) - Optional - Only update metadata in files of the specified format. Specify it multiple times for multiple formats. By default, all formats are updated. ### Request Example ``` calibredb embed_metadata --only-formats EPUB --only-formats MOBI 15 calibredb embed_metadata all ``` ### Response #### Success Response - Metadata is embedded into the specified book files. #### Response Example ``` (No specific output, operation is performed in place) ``` ``` -------------------------------- ### Remove a Custom Column Source: https://manual.calibre-ebook.com/generated/en/calibredb.html Removes a custom column identified by its label. The `--force` option can be used to bypass the confirmation prompt. ```bash calibredb remove_custom_column [options] label ``` ```bash --force, -f ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.