Skip to content

Command reference

Auto-generated from the zot CLI (v0.8.5) — do not edit by hand; run python scripts/gen_cli_reference.py.

Global flags on every command: --json, -q/--quiet, --debug, --yes, --base/--token/--user-id (or ZOTERO_AGENT_*). Exit codes: 0 ok, 1 error, 2 connection/exec, 3 not-found, 4 config.

zot search [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--limit LIMIT] [--all]
[--item-type ITEM_TYPE] [--tag TAG] [--raw]
query
ArgumentDescription
query
--limit
--allfetch all results (paginate)
--item-type
--tag
--rawemit the read API’s own JSON instead of the shared flat item shape
zot get [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--raw]
key
ArgumentDescription
keyZotero item key, or a BBT citekey (prefix @ to force)
--rawemit the read API’s own JSON instead of the shared flat item shape
zot cite [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
citekey
ArgumentDescription
citekey
zot pdf [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
key
ArgumentDescription
keyitem/attachment key, or a BBT citekey (prefix @ to force)
zot collections [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID]
[-q] [--debug] [-y] [--json] [--limit LIMIT] [--all]
ArgumentDescription
--limit
--allfetch all (paginate)
zot tags [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--limit LIMIT] [--all]
ArgumentDescription
--limit
--allfetch all (paginate)
zot export [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
[--format {json,csv,csljson,bibtex,biblatex,ris}]
[--out OUT] [--recursive]
collection
ArgumentDescription
collectioncollection key or name
--format
--outwrite to file instead of stdout
--recursiveinclude items in subcollections (default: only items filed directly in this collection)
zot missing [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--collection COLLECTION]
[--detail {concise,full}]
field
ArgumentDescription
fieldfield or alias: abstract, date, doi, url, publisher, publication
--collectionlimit to a collection (key or name)
--detailfull keeps abstracts
zot author [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--detail {concise,full}]
name
ArgumentDescription
name
--detailfull keeps abstracts
zot stats [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
zot recent [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--limit LIMIT] [--raw]
ArgumentDescription
--limit
--rawemit the read API’s own JSON instead of the shared flat item shape
zot bib [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--style STYLE] [--linkwrap]
[--out OUT]
keys [keys ...]
ArgumentDescription
keysitem keys or citekeys
--styleCSL style id (e.g. apa, chicago-note-bibliography)
--linkwrap
--out
zot annotations [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID]
[-q] [--debug] [-y] [--json] [--to-note]
[--samples SAMPLES]
key
ArgumentDescription
key
--to-notewrite annotations into a child note
--samples
zot related [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
key
ArgumentDescription
key
zot notes [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
key
ArgumentDescription
key
zot lint [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--samples SAMPLES]
ArgumentDescription
--samplesexamples to show per issue
zot add [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--pdf] [--collection COLLECTION]
[--check-duplicate]
{doi,isbn,arxiv} identifier
ArgumentDescription
kind
identifier
--pdfalso try to attach an open-access PDF
--collectionadd to this collection (key or name)
--check-duplicaterefuse to add if a close title+author match is already in the library
zot dedupe [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--by {title,doi,content}]
[--collection COLLECTION] [--plan FILE] [--merge] [--force]
[--fuzzy] [--threshold THRESHOLD] [--samples SAMPLES]
ArgumentDescription
--bywhat makes two items the same: their title, their DOI, or the file they share (‘content’ finds the ones whose titles do not resemble each other)
--collectionlimit to a collection (key or name); else whole library
--planwrite the merge plan as JSONL for review, then run zot merge --from FILE
--mergemerge the confident groups now (master is the oldest item, or the best-documented one with —by content); NOT undoable
--forcewith —merge, also merge groups whose author/year/edition disagree
--fuzzyalso group near-identical titles (Levenshtein); title axis only
--thresholdsimilarity threshold for —fuzzy (0-1)
--samples
zot tag [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--new NEW] [--map MAP] [--rules RULES]
[--out FILE] [--apply] [--dry-run] [--samples SAMPLES]
{add,rm,rename,purge,normalize,from-collections} [tag]
[keys ...]
ArgumentDescription
action
tagthe tag (for add/rm/rename)
keysitem keys/citekeys (for add/rm; ’-’ reads stdin)
--newnew tag name (for rename)
--mapCSV old,new mapping file (for normalize)
--rulesJSON rules file (for from-collections): {containers:[…], rules:[{match, tags}]}
--outwrite the plan as JSONL for zot apply (for from-collections)
--applywrite the tags now, undoably (for from-collections)
--dry-runpreview (for normalize / from-collections)
--samples
zot set [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
field value keys [keys ...]
ArgumentDescription
fieldfield or alias (e.g. abstract, publisher, date)
value
keysitem keys/citekeys (’-’ reads stdin)
zot move [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
collection keys [keys ...]
ArgumentDescription
collection
keysitem keys/citekeys (’-’ reads stdin)
zot collection [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID]
[-q] [--debug] [-y] [--json] [--parent PARENT]
name
ArgumentDescription
name
--parentparent collection (key or name)
zot note [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--file FILE] [--text TEXT]
[--if-not-exists] [--dry-run]
key
ArgumentDescription
key
--fileread note body (HTML or text) from a file
--textnote body as a string
--if-not-existsskip if an identical note already exists (idempotent)
--dry-runshow what would be added, don’t write
zot toc [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--from FILE] [--attachment ATTACHMENT]
[--dry-run] [--max-level MAX_LEVEL] [--offset OFFSET]
[--backup] [--mark-for-sync] [--cap CAP] [--samples SAMPLES]
{show,scan,set,auto,clear} key
ArgumentDescription
actionshow the embedded outline, scan for evidence, set one from a file, build one automatically, or remove it
keyitem/attachment key, or a BBT citekey (prefix @ to force)
--fromoutline to write (for set); ’-’ reads stdin. Text or JSON.
--attachmentattachment key, when the item has several PDFs
--dry-runpreview the outline; don’t touch the file
--max-leveldeepest nesting level to keep (default 4)
--offsetforce printed-page → physical-page delta instead of detecting it
--backupcopy the untouched PDF into ~/.local/state/zotero-agent first
--mark-for-synctell Zotero to re-upload the file on the next sync
--capmax heading candidates in a scan
--samplesrows to print per section of a scan
zot apply [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--dry-run] [--samples SAMPLES]
file
ArgumentDescription
fileJSONL file, or ’-’ for stdin
--dry-runpreview writes, don’t persist
--samples
zot undo [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--keep]
[op]
ArgumentDescription
opop id, ‘last’ (default), or ‘list’
--keepdon’t delete the snapshot after undo
zot enrich [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] --field {doi,date,abstract}
[--source {crossref,openalex}] [--collection COLLECTION]
[--limit LIMIT] [--delay DELAY]
[--min-similarity MIN_SIMILARITY] [--dry-run]
[--samples SAMPLES]
ArgumentDescription
--field
--source
--collectionlimit to a collection (key or name)
--limitcap items looked up (0 = no cap)
--delayseconds between API calls (be polite)
--min-similaritytitle-similarity floor for accepting a search hit (0-1); items with no year and no author need 0.98 regardless
--dry-runpreview, don’t write
--samples
zot ping [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
zot init [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
zot skill [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--dest DEST] [--project] [--force]
[--link]
{install,path,agents-md}
ArgumentDescription
actioninstall it, print the bundled source path, or print AGENTS.md to stdout
--destinstall here (default: ~/.claude/skills/zotero)
--projectinstall into ./.claude/skills/zotero (this project only)
--forcereplace an existing install
--linksymlink the source instead of copying (dev checkout)
zot backup [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--dir DIR] [--keep-days KEEP_DAYS]
ArgumentDescription
--dirdestination dir (default: ~/.config/zotero-agent/backups)
--keep-dayskeep the newest snapshot of each of the N most recent days (default 3); 0 disables pruning
zot sync [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json]
zot restart [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--plugin] [--no-launch]
[--timeout TIMEOUT]
ArgumentDescription
--pluginreload only the zotero-agent plugin, leaving Zotero running
--no-launchnever start the Zotero app; only act on a running one
--timeoutseconds to wait for the bridge to answer again (default: 90)
zot exec [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--dry-run]
source
ArgumentDescription
source
--dry-runintercept writes and report what would change (best-effort)
zot mcp [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--allow-exec]
ArgumentDescription
--allow-execexpose the run_javascript tool (arbitrary JS)
zot completion [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID]
[-q] [--debug] [-y] [--json]
{bash,zsh,fish}
ArgumentDescription
shell
zot pdf-prep [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID]
[-q] [--debug] [-y] [--json] [--collection COLLECTION]
[--attachment ATTACHMENT] [--split {auto,always,never}]
[--gutter GUTTER] [--overlap OVERLAP] [--single PAGES]
[--rtl] [--ocr LANG] [--no-ocr]
[--profile {balanced,quality,small}] [--rotate]
[--title TITLE] [--out DIR] [--replace] [--prune]
[--trash-annotated] [--force] [--timeout TIMEOUT]
[--dry-run]
[keys ...]
ArgumentDescription
keysitem keys or BBT citekeys (’-’ reads stdin)
--collectionprocess every item in a collection (key or name)
--attachmentattachment key, when the item has several PDFs
--splitsplit two-up scans into one page per leaf (default: auto-detect)
--gutterforce the cut as a fraction of page width (0.5 = middle)
--overlapextra width each half keeps past the cut (default 0.008)
--singlepages to leave whole, e.g. ‘1,2,147’ (covers, fold-outs)
--rtlright-to-left book: right half first
--ocrtesseract languages (default: from the item’s language field)
--no-ocrsplit and optimise only; leave the file without a text layer
--profilebalanced (default), quality (300 dpi OCR, bigger), or small
--rotatelet OCR fix sideways pages
--titletitle for the new attachment (default: ‘PDF (OCR)‘)
--outwrite the result to a directory instead of attaching it
--replacetrash the original attachment once the new one is attached
--prunetrash originals superseded by an earlier run; processes nothing
--trash-annotatedalso trash originals carrying highlights (they do NOT follow the new file — Zotero ties them to the attachment)
--forcereprocess items already prepared
--timeoutseconds to allow OCR per item
--dry-runanalyse and report the plan; touch nothing
zot merge [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] --from FILE [--dry-run]
[--samples SAMPLES]
ArgumentDescription
--fromJSONL merge plan, or ’-’ for stdin
--dry-runpreview, don’t merge
--samples
zot attach [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--file FILE] [--url URL] [--link]
[--title TITLE]
key
ArgumentDescription
keyitem key, or a BBT citekey (prefix @ to force)
--filelocal file to import as an attachment
--urlURL to attach (a snapshot unless —link)
--linkstore the URL as a link, not a snapshot
--titleattachment title (defaults to Zotero’s)
zot pdf-fetch [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID]
[-q] [--debug] [-y] [--json] [--collection COLLECTION]
[--retry-with-pdf]
[keys ...]
ArgumentDescription
keysitem keys or BBT citekeys; ’-’ reads them from stdin
--collectionevery item in a collection (key or name)
--retry-with-pdfalso try items that already have a PDF attached
zot disk [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--min-mb MIN_MB] [--samples SAMPLES]
ArgumentDescription
--min-mbthreshold for listing heavy PDFs (default 25)
--samples
zot shrink [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--min-mb MIN_MB] [--max-mb MAX_MB]
[--force] [--dpi DPI] [--mono-dpi MONO_DPI]
[--max-ratio MAX_RATIO] [--out DIR] [--timeout TIMEOUT]
[--dry-run]
[keys ...]
ArgumentDescription
keysitem or attachment keys/citekeys (’-’ reads stdin); omit to sweep everything over —min-mb
--min-mbwith no keys, shrink every PDF at least this big (default 25)
--max-mbwith no keys, stop at this size — lets you sweep one band at a time
--forcere-examine files already tagged ‘shrunk’ or ‘shrink-nogain’ (re-shrinking is lossy: it re-encodes them again)
--dpitarget resolution for colour/grey images (default 200)
--mono-dpitarget resolution for bitonal images (default 300)
--max-ratiokeep the original unless the rewrite is at most this fraction of its size (default 0.80)
--outwrite results to DIR instead of replacing in place
--timeoutseconds to allow per file
--dry-runreport the plan, touch nothing
zot gc [-h] [--base BASE] [--token TOKEN] [--user-id USER_ID] [-q]
[--debug] [-y] [--json] [--orphans] [--snapshots]
[--empty-trash] [--dry-run]
ArgumentDescription
--orphansattachments nothing claims: no parent, no collection, no tags, no annotations (a filed parentless PDF is an item, and is kept)
--snapshotssaved page snapshots (the item keeps its URL)
--empty-trashalso erase everything already in the trash — PERMANENT
--dry-runreport, don’t write