library command
library is the default local read-first surface. It handles “search first, narrow down, then move to item or workspace.”
Subcommands
library search <query>library listlibrary recentlibrary statslibrary citekey <citekey>library tagslibrary librarieslibrary feedslibrary feed-items <library-id>library semantic-search <query>library semantic-indexlibrary semantic-statuslibrary duplicateslibrary duplicates-mergelibrary saved-search listlibrary saved-search createlibrary saved-search delete
search
library search supports broad search plus structured filters.
Common examples:
bash
zot --json library search "transformer attention" --limit 10
zot --json library search "reward hacking" --collection COLL001 --type preprint --limit 20
zot --json library search "attention" --tag attention --creator Vaswani --year 2017
zot --json library search "alignment" --sort date-added --direction descAvailable options:
--collection <key>--type <item-type>--tag <tag>--creator <name>--year <yyyy or prefix>--sort <date-added|date-modified|title|creator>--direction <asc|desc>--limit--offset
recent
library recent now supports two modes:
bash
zot --json library recent --count 10
zot --json library recent 2026-04-01 --limit 20Notes:
--count <n>means the latest N library items, returned bydateAdded desc<YYYY-MM-DD> --limit <n>means items since a date boundary- without arguments, it defaults to
library recent --count 10
citation key, tags, libraries, and feeds
bash
zot --json library citekey Smith2024
zot --json library tags
zot --json library libraries
zot --json library feeds
zot --json library feed-items 3 --limit 20Notes:
citekeyuses local Extra-field fallback first and strengthens via Better BibTeX when availablelibrary librariescan enumerate user, group, and feed library summaries together- feeds are explicit
library feeds/feed-itemsflows, not a--libraryscope switch
semantic index / search / status
bash
zot --json library semantic-status
zot --json library semantic-index --fulltext
zot --json library semantic-index --collection COLL001 --force-rebuild
zot --json library semantic-search "mechanistic interpretability" --mode hybrid --limit 10Supported modes:
bm25semantichybrid
Notes:
- the library-level semantic index is stored in a local sidecar SQLite file
- it reuses the same index implementation as workspace retrieval, but not the same file
- do not assume
semanticorhybridis meaningful when embeddings are not configured semantic-indexuses replace-style incremental indexing by default: without--force-rebuild, it rebuilds only the selected items and removes keys that no longer exist in the library--force-rebuildclears the entire index file before writing; reserve it for real rebuilds (for example, after changing the embedding model)
duplicates and merge
bash
zot --json library duplicates --method both --limit 50
zot --json library duplicates --method title
zot --json library duplicates --method doi
zot --json library duplicates-merge --keeper KEEP001 --duplicate DUPE001 --duplicate DUPE002
zot --json library duplicates-merge --keeper KEEP001 --duplicate DUPE001 --duplicate DUPE002 --confirmduplicates-merge is dry-run by default. Only --confirm performs the actual merge:
- fill keeper metadata fields that are currently empty
- merge tags
- preserve or add collections
- re-parent child items
- skip obviously duplicate attachments when possible
- move duplicate items to Trash
If you already have two explicit item keys rather than a duplicate-candidate set, switch to item merge on the item page.
saved search
bash
zot --json library saved-search list
zot --json library saved-search create --name "Recent RL" --conditions conditions.json
zot --json library saved-search delete SRCH0001Notes:
saved-search listreturns saved-search metadata and conditionssaved-search createaccepts--conditionsas either a JSON string or a JSON file pathsaved-search deleteremoves the saved search itself, not the items- Zotero Web API does not currently return saved-search results directly
Recommended flow
Typical sequence:
library searchorlibrary citekeyitem getitem cite/item export/item pdf/item children
If you are building a long-lived topic set instead of working on one item, move to workspace.