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.
Last scanned: 7/1/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-07-01T08:13:43.346Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}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 100 GitHub stars.
Yes. cli-anything-zotero passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
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. SkillsLLM 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!
Let AI manage your Zotero library.
中文文档 | English
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.
Key capabilities:
All write operations run locally through the JS Bridge — no API key or internet connection required.
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/8/9 (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
First install requires manual steps in Zotero:
.xpi file and prints its path.xpi file, then restart ZoteroAfter the first install, future upgrades via
app install-pluginare automatic.
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 |
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
zotero-cli import doi "10.1038/s41586-024-07871-6" --tag "review"
zotero-cli import pmid "37821702" --collection FMTCPUWN
zotero-cli import file ./refs.ris
Read & Export
zotero-cli item get ITEM_KEY
zotero-cli item find "keyword" --scope fields
zotero-cli item export ITEM_KEY --format bibtex
zotero-cli export bib --items KEY1,KEY2 --output refs.bib
zotero-cli item citation ITEM_KEY
zotero-cli item context ITEM_KEY # LLM-ready context
zotero-cli docx inspect-citations draft.docx # detect Zotero/EndNote/static citation fields
zotero-cli docx validate-placeholders draft.docx
zotero-cli docx render-citations draft.docx --output draft-static.docx --force
zotero-cli docx doctor
zotero-cli docx insert-citations draft.docx --output draft-zotero.docx --force
For AI-authored DOCX workflows, use Zotero-bound placeholders such as
{{zotero:ITEMKEY}} or {{zotero:KEY1,KEY2}}, then choose the final output
mode:
docx render-citations replaces placeholders with ordinary citation text and appends a static bibliography. It only needs Zotero's Local API, so it is the easiest path for lightweight reports or one-off documents. Static output cannot be refreshed by the Zotero word processor plugin.docx insert-citations converts placeholders into real Zotero/LibreOffice fields and creates or updates a refreshable bibliography field. This is the better path for theses, manuscripts, and documents that will be edited or restyled later.AI agents should ask the user which mode they want when the request is
ambiguous. If the user only wants a simple final DOCX and has not installed
LibreOffice, prefer static citations. Dynamic DOCX citation insertion is an
optional LibreOffice-backed workflow: it requires Zotero Desktop, LibreOffice,
the Zotero LibreOffice Add-in, and the CLI Bridge plugin. Run docx doctor
when setting up a machine or when an AI agent needs to decide whether the
workflow is installed.
Recommended AI protocol:
zotero-cli --json docx validate-placeholders <input.docx>zotero-cli --json docx doctorzotero-cli --json docx insert-citations <input.docx> --output <final.docx> --forcedoctor and ask the user for next steps.zotero-cli --json docx render-citations <input.docx> --output <final.docx> --forceKeep these files only as handoff artifacts:
<input.docx>)<final.docx>)--debug-dir is explicitly requested.Platform support for this optional workflow:
docx doctor can report missing dependencies. Full automatic LibreOffice open/save for dynamic DOCX citations still needs real Windows/Linux desktop validation; users may need to open or save the LibreOffice document manually until platform automation is verified.validate-placeholders, zoterify-preflight, and zoterify-probe are
diagnostics for setup or failure cases. Add --debug-dir only when you want
JSON artifacts for troubleshooting.
docx prepare-zotero-import exists only as an experimental debugging command;
it is not a supported writing workflow after Zotero 9 + LibreOffice testing.
docx insert-citations and docx render-citations are the two supported outputs
for AI-authored citation insertion.
item citation and item bibliography render static previews; they are not
refreshable Word/LibreOffice Zotero fields. BIB export is a separate export
feature and is not part of the DOCX writing workflow.
Write & Manage
zotero-cli item update KEY --field title="New Title"
zotero-cli item tag KEY --add "important"
zotero-cli item attach KEY ./paper.pdf
zotero-cli item find-pdf KEY
zotero-cli note add KEY --text "My note"
zotero-cli sync
Advanced
zotero-cli item search-annotations "risk"
zotero-cli item annotations KEY
zotero-cli item metrics KEY # NIH citation metrics
zotero-cli collection stats COLLECTION_KEY
zotero-cli js "return await Zotero.Items.getAll(1).then(i => i.length)"
Full command reference: docs/COMMANDS.md
These require extra services. Everything else works without them.
Any OpenAI-compatible /v1/embeddings endpoint (Ollama, LM Studio, OpenAI, etc.).
zotero-cli item build-index # one-time
zotero-cli item semantic-search "cardiovascular risk"
zotero-cli item similar ITEM_KEY
| Variable | Default | Description |
|---|---|---|
ZOTERO_EMBED_API |
http://127.0.0.1:8080/v1/embeddings |
Embedding API endpoint |
ZOTERO_EMBED_MODEL |
nomic-embed-text |
Model name |
ZOTERO_EMBED_KEY |
(empty) | API key (if needed) |
e