CLI server for Zotero 7/8/9 — let AI manage your library. 70+ CLI commands for search, import, PDF, BibTeX, notes, and more. Works with Claude, Cursor, ChatGPT.
# Add to your Claude Code skills
git clone https://github.com/PiaoyangGuohai1/cli-anything-zoteroGuides for using ai agents skills like cli-anything-zotero.
cli-anything-zotero is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by PiaoyangGuohai1. CLI server for Zotero 7/8/9 — let AI manage your library. 70+ CLI commands for search, import, PDF, BibTeX, notes, and more. Works with Claude, Cursor, ChatGPT. It has 144 GitHub stars.
cli-anything-zotero's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/PiaoyangGuohai1/cli-anything-zotero" and add it to your Claude Code skills directory (see the Installation section above).
cli-anything-zotero is primarily written in Python. It is open-source under PiaoyangGuohai1 on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh cli-anything-zotero against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Let AI manage your Zotero library.
中文文档 | English | Roadmap | TODO | Commands
MCP legacy notice:
v0.9.5is the final release with thezotero-mcpcommand andcli-anything-zotero[mcp]extra. New releases are CLI/SDK-first. Existing MCP users should pinpip install "cli-anything-zotero[mcp]==0.9.5"or use thelegacy/mcpbranch.
This tool is designed to be used by AI, not memorized by you. After a simple install (~3 minutes), just talk to your AI assistant in plain language:
"Find papers about diabetes and kidney disease in my Zotero library"
"Import this DOI into my CKM collection: 10.1038/s41586-024-07871-6"
"Export all papers in my thesis collection as BibTeX"
"Find PDFs for items in my review collection that are missing them"
All you need to do:
Built on CLI-Anything by HKUDS, this tool gives AI agents full access to your local Zotero library through a JS Bridge — a lightweight Zotero plugin that exposes a privileged JavaScript endpoint.
Prerequisite: the Zotero desktop app must be running. This is intentional — we automate the local client (Connector, Local API, CLI Bridge), not a cloud-only API substitute.
Key capabilities:
{{zotero:ITEMKEY}} placeholders into static text or refreshable Zotero fields (see below)All write operations run locally through the JS Bridge — no API key or internet connection required.
AI-authored drafts should use placeholders such as {{zotero:ITEMKEY}} or
{{zotero:KEY1,KEY2}}, then convert them with the docx commands.
| Mode | Command | Output | Extra software |
|---|---|---|---|
| Static (default for simple finals) | docx render-citations or docx cite --mode static |
Plain-text citations + static bibliography | No. Only pip install + JS Bridge + running Zotero (Local API). |
| Dynamic (refreshable fields) | docx insert-citations or docx cite --mode dynamic |
Real Zotero fields in Word/LibreOffice + refreshable bibliography | Yes — extra stack required (see table below). |
| Auto | docx cite --mode auto |
Picks dynamic if the stack is ready, else static | Same as dynamic when available |
Dynamic mode is optional and is not installed by pip alone. You also need:
| Requirement | Why |
|---|---|
| Zotero Desktop (running) | Source library + word-processor integration |
CLI Bridge plugin (zotero-cli app install-plugin) |
Local privileged bridge used by conversion |
| LibreOffice | Opens/saves the DOCX during field insertion |
| Zotero LibreOffice plugin | Creates refreshable citation/bibliography fields |
Check the machine before relying on dynamic mode:
zotero-cli --json docx doctor
If doctor reports missing LibreOffice / the LO add-in / Bridge, use static
mode (or install the missing pieces). On macOS the full dynamic path is tested
end-to-end; on Windows/Linux, doctor works but auto open/save may still need
manual LibreOffice interaction until verified.
One-shot when you are unsure:
zotero-cli --json docx cite draft.docx --output draft-cited.docx --mode auto --force
cli-anything-zotero is now maintained as a CLI/SDK-first tool. The primary interface is the zotero-cli shell command, which works well for Codex, Claude Code, Cursor, shell scripts, and other agents that can run terminal commands.
For legacy MCP users, install the frozen MCP release explicitly:
pip install "cli-anything-zotero[mcp]==0.9.5"
The legacy/mcp branch and the v0.9.5 release remain available, but MCP receives no new feature maintenance after that line.
Prerequisites: Python 3.10+, Zotero 7+ (running).
pip install cli-anything-zotero
This installs the zotero-cli command. The old cli-anything-zotero command remains as a compatibility alias.
zotero-cli app install-plugin
The first install goes through Zotero's Plugins window (Zotero switches off plugins that appear in its profile on their own):
.xpi file and prints its path.xpi file, then restart ZoteroAfter the first install,
app install-pluginupgrades the bridge without the Plugins window. With Zotero running and the bridge active, it upgrades through the bridge. With Zotero closed, it replaces the plugin in the profile and Zotero loads it on its next start.
Upgrading to Zotero 10: bridge versions up to 1.2.1 only declare support for Zotero 7–9, so Zotero 10 disables them. Upgrade cli-anything-zotero (1.4.2 or later), quit Zotero, run
zotero-cli app install-plugin, then start Zotero.
For existing users upgrading to the dynamic DOCX citation workflow, update both the Python package and the Zotero bridge plugin:
python -m pip install -U cli-anything-zotero
zotero-cli app install-plugin
# restart Zotero
zotero-cli app plugin-status
zotero-cli docx doctor
No client-specific setup is required. Tell your AI assistant that zotero-cli is available; it can run zotero-cli --help to discover commands.
Verify it works:
zotero-cli app ping
zotero-cli js "return Zotero.version"
| Problem | Solution |
|---|---|
Cannot resolve Zotero profile directory |
Launch Zotero at least once first |
| Plugin not appearing | Restart Zotero after installing the .xpi |
endpoint_active: false |
Plugin failed to load — reinstall via Zotero UI |
No endpoint found after a Zotero major upgrade |
Zotero disabled the bridge as incompatible; zotero-cli app doctor reports app_disabled. Upgrade cli-anything-zotero, quit Zotero, run zotero-cli app install-plugin, then start Zotero |
app doctor reports user_disabled |
The bridge is switched off in Zotero: turn it on in Tools → Plugins |
Windows: pip not recognized |
Close and reopen PowerShell after installing Python |
Search & Browse
zotero-cli item find "machine learning"
zotero-cli item search-fulltext "CRISPR"
zotero-cli collection tree
Import
# Preferred agent ingest
zotero-cli --json add doi "10.1038/s41586-024-07871-6" --tag "review" --fetch-pdf
zotero-cli --json add arxiv 2602.02093 --collection COLLECTION_KEY
zotero-cli --json add file ./paper.pdf
zotero-cli --json add bibtex ./refs.bib --collection COLLECTION_KEY
# Lower-level import still available
zotero-cli import doi "10.1038/s41586-024-07871-6" --no-translator
zotero-cli --json item fetch-pdf ITEM_KEY --sources zotero,unpaywall,arxiv
zotero-cli --json collection fetch-pdfs COLLECTION_KEY --limit 20 --jsonl-progress
# DOCX one-shot citations
zotero-cli --json docx cite draft.docx --output draft-cited.docx --mode auto --force
# Audit recent write ops
zotero-cli --json audit tail --limit 20
Library hygiene
# Find duplicate clusters. Matches on DOI, and on normalized title confirmed by
# a shared creator surname and an agreeing year. Each copy reports its
# attachment counts and its Better BibTeX citation key.
zotero-cli --json item duplicates --limit 20
zotero-cli --json item duplicates --year-tolerance 0 # exact year agreement only
zotero-cli --json item merge KEEP OTHER1 # dry-run; --confirm applies
Clusters whose copies carry more than one pinned citation key are flagged with
citation_key_conflict: true. Merging those silently orphans whichever key your
manuscript already cites, so resolve the key before merging.
Deleting things
zotero-cli item delete ITEM_KEY --confirm # -> trash. Reversible.
zotero-cli item restore ITEM_KEY # <- back out of the trash
zotero-cli collection delete COLLECTION_KEY --confirm # with its subcollections
zotero-cli collection restore COLLECTION_KEY # brings the subcollections back too
delete moves things to the Zotero trash, exactly as the Delete key does in the
Zotero UI. Trashed items keep their keys and stay recoverable until you empty the
trash, which the CLI never does for you. collection delete --delete-items also
trashes the items of the collection and of e