CALIBREDB(1) calibre CALIBREDB(1) NAME calibredb - calibredb calibredb command [options] [arguments] calibredb is the command line interface to the calibre database. It has several sub-commands, documented below. calibredb can be used to manipulate either a calibre database specified by path or a calibre Content server running either on the local machine or over the internet. You can start a calibre Content server using either the calibre-server program or in the main calibre program click Connect/share -> Start Content server. Since calibredb can make changes to your calibre libraries, you must setup authentication on the server first. There are two ways to do that: o If you plan to connect only to a server running on the same computer, you can simply use the --enable-local-write option of the Content server, to allow any program, including calibredb, running on the local computer to make changes to your calibre data. When running the server from the main calibre program, this option is in Preferences->Sharing over the net->Advanced. o If you want to enable access over the internet, then you should setup user accounts on the server and use the --username and --password options to calibredb to give it access. You can setup user authentication for calibre-server by using the --enable-auth option and using --manage-users to create the user accounts. If you are running the server from the main calibre program, use Preferences->Sharing over the net->Require username/password. To connect to a running Content server, pass the URL of the server to the --with-library option, see the documentation of that option for details and examples. o o list o add o o remove o add_format o remove_format o show_metadata o set_metadata o export o catalog o EPUB o saved_searches o add_custom_column o custom_columns o remove_custom_column o set_custom o restore_database o check_library o list_categories o backup_metadata o clone o embed_metadata o search o fts_index o fts_search --help, -h --library-path, --with-library calibre calibre URLhttp://hostname:port/#library_id http://localhost:8080/#mylibrarylibrary_id id library_id id https://manual.calibre-ebook.com/generated/en/calibredb.html --password calibre ::( : >) --timeout calibre --username Calibre --version LIST calibredb list [options] calibre calibredb: "/some path/with spaces" --ascending --fields, -f author_sort, authors, comments, cover, formats, identifiers, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, size, tags, template, timestamp, title, uuid title,authorsall*field_name#rating*rating --for-machine JSON --limit --line-width, -w --prefix --search, -s --separator --sort-by The field by which to sort the results. You can specify multiple fields by separating them with commas. Available fields: author_sort, authors, comments, cover, formats, identifiers, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, size, tags, template, timestamp, title, uuid Default: id --template The template to run if "template" is in the field list. Default: None --template_file, -t Path to a file containing the template to run if "template" is in the field list. Default: None --template_heading Heading for the template column. Default: template. This option is ignored if the option --for-machine is set ADD calibredb add [] file1 file2 file3 ... calibredb: "/some path/with spaces" --authors, -a --automerge, -m ()Ignoreoverwritenew_record --cover, -c --duplicates, -d --automerge --empty, -e --identifier, -I -I asin:XXX -I isbn:YYY --isbn, -i ISBN --languages, -l (ISO639) --series, -s --series-index, -S --tags, -T --title, -t --add (glob) --ignore (glob) *.pdf PDF --one-book-per-directory, -1 --recurse, -r REMOVE calibredb remove ids id ids id ( id )23,34,57-85 () calibredb: "/some path/with spaces" --permanent ADD_FORMAT calibredb add_format [options] id ebook_file ebook_file id calibredb: "/some path/with spaces" --as-extra-data-file Add the file as an extra data file to the book, not an ebook format --dont-replace REMOVE_FORMAT calibredb remove_format [options] id fmt ID fmt IDfmt LRF TXT EPUB fmt calibredb: "/some path/with spaces" SHOW_METADATA calibredb show_metadata [options] id calibre id id id calibredb: "/some path/with spaces" --as-opf OPF (XML) SET_METADATA calibredb set_metadata [options] book_id [/path/to/metadata.opf] Set the metadata stored in the calibre database for the book identified by book_id from the OPF file metadata.opf. book_id is a book id number from the search command. You can get a quick feel for the OPF format by using the --as-opf switch to the show_metadata command. You can also set the metadata of individual fields with the --field option. If you use the --field option, there is no need to specify an OPF file. calibredb: "/some path/with spaces" --field, -f field_name:value--field tags:tag1,tag2:option:--list-fields`ISO639 (enfr):option:--field` identifiers:isbn:XXXX,doi:YYYYY(/) --list-fields, -l --field EXPORT calibredb export [options] ids Export the books specified by ids (a comma separated list) to the filesystem. The export operation saves all formats of the book, its cover and metadata (in an OPF file). Any extra data files associated with the book are also saved. You can get id numbers from the search command. calibredb: "/some path/with spaces" --all id --dont-asciiize calibre Unicode --dont-save-cover Normally, calibre will save the cover in a separate file along with the actual e-book files. --dont-save-extra-files Save any data files associated with the book when saving the book --dont-update-metadata calibre --dont-write-opf calibreOPF --formats --progress --replace-whitespace --single-dir --template The template to control the filename and folder structure of the saved files. Default is "{author_sort}/{title}/{title} - {authors}" which will save books into a per-author subfolder with filenames containing title and author. Available controls are: {author_sort, authors, id, isbn, languages, last_modified, pubdate, publisher, rating, series, series_index, tags, timestamp, title} --timefmt %d - %b - %m - %Y - %b, %Y --to-dir . --to-lowercase CATALOG calibredb catalog /path/to/destination.(csv|epub|mobi|xml...) [options] Export a catalog in format specified by path/to/destination extension. Options control how entries are displayed in the generated catalog output. Note that different catalog formats support different sets of options. To see the different options, specify the name of the output file and then the --help option. calibredb: "/some path/with spaces" --ids, -i ID --search --search, -s --verbose, -v EPUB --catalog-title 'My Books' AZW3ePubMOBI --cross-reference-authors : 'False' : AZW3, EPUB, MOBI --debug-pipeline Save the output from different stages of the conversion pipeline to the specified folder. Useful if you are unsure at which stage of the conversion process a bug is occurring. Default: 'None' Applies to: AZW3, EPUB, MOBI output formats --exclude-genre '[.+]|^+$' '[Project Gutenberg]', '+', AZW3, EPUB, MOBI --exclusion-rules ('','','') ('','','') (('','#',''),) : "(('Catalogs','Tags','Catalog'),)" : AZW3, EPUB, MOBI --generate-authors "" 'False' AZW3, EPUB, MOBI --generate-descriptions "" 'False' AZW3, EPUB, MOBI --generate-genres "" 'False' AZW3, EPUB, MOBI --generate-recently-added "" 'False' AZW3, EPUB, MOBI --generate-series "" 'False' AZW3, EPUB, MOBI --generate-titles "" 'False' AZW3, EPUB, MOBI --genre-source-field "" '' AZW3, EPUB, MOBI --header-note-source-field : '' : AZW3, EPUB, MOBI --merge-comments-rule #:[before|after]:[True|False] : [before|after] [True|False] - : '::' : AZW3, EPUB, MOBI --output-profile 'kindle' 'kindle_dx' 'None' AZW3EPUBMOBI --prefix-rules ('','','','') : "(('Read books','tags','+','\/'),('Wishlist item','tags','Wishlist','x'))" AZW3, EPUB, MOBI --preset GUI : 'None' : AZW3, EPUB, MOBI --thumb-width () 1.0 - 2.0 '1.0' AZW3, EPUB, MOBI --use-existing-cover 'False' AZW3, EPUB, MOBI SAVED_SEARCHES calibredb saved_searches [options] (list|add|remove) calibredb saved_searches add search_name search_expression calibredb saved_searches remove search_name calibredb: "/some path/with spaces" ADD_CUSTOM_COLUMN calibredb add_custom_column [options] label name datatype bool, comments, composite, datetime, enumeration, float, int, rating, series, text calibredb: "/some path/with spaces" --display JSON --display"{\ "enum_values\ ":[\ "val1\ ", \ "val2\ "]}" composite: composite_template, composite_sort, make_category,contains_html, use_decorations datetime: date_format enumeration: enum_values, enum_colors, use_decorations int, float: number_format text: is_names, use_decorations GUI OPF ( OPF) OPF JSON --is-multiple CUSTOM_COLUMNS calibredb custom_columns [options] ids calibredb: "/some path/with spaces" --details, -d REMOVE_CUSTOM_COLUMN calibredb remove_custom_column [options] label custom_columns command calibredb: "/some path/with spaces" --force, -f SET_CUSTOM calibredb set_custom [options] column id value id id custom_columns calibredb: "/some path/with spaces" --append, -a RESTORE_DATABASE calibredb restore_database [options] Restore this database from the metadata stored in OPF files in each folder of the calibre library. This is useful if your metadata.db file has been corrupted. WARNING: This command completely regenerates your database. You will lose all saved searches, user categories, plugboards, stored per-book conversion settings, and custom recipes. Restored metadata will only be as accurate as what is found in the OPF files. calibredb: "/some path/with spaces" --really-do-it, -r CHECK_LIBRARY calibredb check_library [options] invalid_titles, extra_titles, invalid_authors, extra_authors, missing_formats, extra_formats, extra_files, missing_covers, extra_covers, failed_folders calibredb: "/some path/with spaces" --csv, -c CSV --ignore_extensions, -e --ignore_names, -n --report, -r --vacuum-fts-db LIST_CATEGORIES calibredb list_categories [options] calibredb: "/some path/with spaces" --categories, -r --csv, -c CSV --dialect CSV: excel, excel-tab, unix --item_count, -i --width, -w BACKUP_METADATA calibredb backup_metadata [] OPF OPF --all OPF calibredb: "/some path/with spaces" --all OPT CLONE calibredb path/to/new/library calibredb: "/some path/with spaces" EMBED_METADATA calibredb embed_metadata [options] book_id calibre calibre calibre book_id all ID ID calibredb embed_metadata 1 2 10-15 23 calibredb: "/some path/with spaces" --only-formats, -f SEARCH calibredb search [options] search expression IDID calibrecalibredb search author:asimov 'title:"i robot"' calibredb: "/some path/with spaces" --limit, -l FTS_INDEX calibredb fts_index [options] enable/disable/status/reindex Control the Full text search indexing process. 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. calibredb: "/some path/with spaces" --indexing-speed Slow --wait-for-completion FTS_SEARCH calibredb fts_search [options] search expression Do a full text search on the entire library or a subset of it. calibredb: "/some path/with spaces" --do-not-match-on-related-words Only match on exact words not related words. So correction will not match correcting. --include-snippets Include snippets of the text surrounding each match. Note that this makes searching much slower. --indexing-threshold How much of the library must be indexed before searching is allowed, as a percentage. Defaults to 90 --match-end-marker The marker used to indicate the end of a matched word inside a snippet --match-start-marker The marker used to indicate the start of a matched word inside a snippet --output-format The format to output the search results in. Either "text" for plain text or "json" for JSON output. --restrict-to Restrict the searched books, either using a search expression or ids. For example: ids:1,2,3 to restrict by ids or search:tag:foo to restrict to books having the tag foo. AUTHOR Kovid Goyal COPYRIGHT Kovid Goyal 7.10.0 5 03, 2024 CALIBREDB(1)