Agent skill

Zotero CLI

by 54yyyu in 54yyyu/zotero-mcp

Reads and edits a Zotero library from the shell with zotero-cli: search by keyword or meaning, read PDF text, manage tags, notes and collections, and export bibliographies.

MITAuto-check passedResearch & Science

Install Zotero CLI

skills CLI
$ npx skills add 54yyyu/zotero-mcp --skill zotero-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 54yyyu/zotero-mcp zotero-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/54yyyu/zotero-mcp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/zotero_mcp/skills/zotero-cli .claude/skills/zotero-cli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
zotero-cli
GitHub stars
5.3k
Token cost
~2.3k tokens
SKILL.md length
1,023 words
Files
2
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Reads and edits a Zotero library from the shell with zotero-cli: search by keyword or meaning, read PDF text, manage tags, notes and collections, and export bibliographies.

  • Works in 4 steps: zotero-cli --json layout ATTACHMENT_KEY… → Write one JSON object per line:… → zotero-cli annotations batch… → …
  • Finding papers in a Zotero library by title, author or topic
  • SKILL.md covers Always pass --json when you…, The core loop, Choosing a search mode and Reading efficiently, plus 5 more sections
  • Calls jq; needs ATTACHMENT_KEY and ITEM_KEY

What it does

The skill tells the agent to use `zotero-cli` instead of the Zotero MCP server whenever shell access exists, because the MCP tool schemas add roughly 14k tokens of context to every request while the CLI costs only what is run. Before the first real call, `zotero-cli config` confirms the setup. Local mode needs the Zotero desktop app running with its local API enabled; web mode needs ZOTERO_API_KEY and ZOTERO_LIBRARY_ID. If neither works, the agent should say so rather than guess at library contents.

Passing `--json` returns one object per call with an ok flag, the command name, a schema number and either data or an error, and `zotero-cli --json-schema` prints the full contract. Most tasks follow a find-then-act loop on eight-character item keys, with `--detail keys_only` keeping search results small. Search modes cover items, semantic (which needs the index built with `zotero-cli db update`), tag, advanced conditions, citekey and note text. A separate reference.md file holds the remaining commands.

When your agent uses it

  • Finding papers in a Zotero library by title, author or topic
  • Reading the full text or page ranges of a saved PDF
  • Adding items to the library by DOI, URL or ISBN
  • Exporting a bibliography from selected items

Example prompts

  • “Search my Zotero library for papers about diffusion models and summarize the top five.”
  • “Add the Attention Is All You Need paper to my transformers collection and tag it important.”
  • “Export a BibTeX bibliography of everything I tagged to-read.”
  • “What did I write in my notes about the research question for the survey paper?”

Requirements

  • The `zotero-cli` command
  • Zotero desktop app with its local API enabled, or ZOTERO_API_KEY and ZOTERO_LIBRARY_ID for web mode
  • A built search index for semantic search

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. zotero-cli --json layout ATTACHMENT_KEY lists figure, table and
  2. Write one JSON object per line: `{"page": 4, "text": "exact words",
  3. zotero-cli annotations batch --attachment-key ATTACHMENT_KEY --file plan.jsonl --dry-run
  4. Run it again without --dry-run. Anything that did not land is listed

What it can do on your machine

Read from SKILL.md and the folder at commit 0faf1b2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ATTACHMENT_KEY
    • ITEM_KEY
    • ZOTERO_API_KEY
    • ANNOTATION_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Zotero CLI loads about 2.3k tokens when it runs. Until then it costs about 103 tokens; SKILL.md has 1,023 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from 54yyyu/zotero-mcp at commit 0faf1b2, republished under its MIT licence (© 54yyyu). 1,023 words, ~2,271 tokens.

Download SKILL.mdSave it as .claude/skills/zotero-cli/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
zotero-cli
description
Read and write a Zotero library from the shell with the `zotero-cli` command - search papers by keyword or meaning, read PDF full text and page ranges, get and set metadata, manage collections, tags, notes and annotations, add items by DOI/URL/ISBN, and export bibliographies. Use whenever the user asks about their Zotero library, references, citations, papers they have saved, or their reading notes.

Zotero from the shell

zotero-cli reaches a Zotero library directly. Prefer it over the Zotero MCP server when you have shell access: the MCP server's tool schemas cost ~14k tokens of context on every request whether or not you use them, while this costs only what you actually run.

Check it is set up before the first real call:

bash
zotero-cli config          # prints the resolved Zotero settings

If that fails, Zotero is not reachable. Local mode needs the Zotero desktop app running with its local API enabled; web mode needs ZOTERO_API_KEY and ZOTERO_LIBRARY_ID. Say so rather than guessing at library contents.

Always pass --json when you will read the output

Default output is markdown for humans. --json gives you one object per invocation with a stable shape, so you never parse prose:

json
{"ok": true, "command": "search", "schema": 1, "data": {...}}
{"ok": false, "command": "search", "schema": 1, "error": {"message": "...", "code": "..."}}

Both go to stdout; [INFO]/[WARN] diagnostics go to stderr. Check ok before using data. Run zotero-cli --json-schema for the full contract.

The core loop

Almost every task is: find keys → act on keys. Item keys are 8 characters and are the currency of every command.

bash
# 1. find - use --detail keys_only to keep the result small while browsing
zotero-cli --json search "attention mechanisms" --limit 10 --detail keys_only

# 2. act - metadata, full text, or a page range
zotero-cli --json get metadata ABCD1234
zotero-cli --json get fulltext ABCD1234
zotero-cli --json read ABCD1234 --start-page 3 --end-page 8

Pipe keys straight into the next call:

bash
zotero-cli --json search "diffusion models" --limit 5 --detail keys_only \
  | jq -r '.data.items[].key' \
  | while read -r key; do zotero-cli --json get metadata "$key"; done

Choosing a search mode

ModeUse it forCommand
items (default)a title, author or phrase you knowsearch "Vaswani attention"
semantica topic or idea, no exact wordingsearch --mode semantic "why transformers scale"
tagitems you filed under a tagsearch --mode tag "to-read,important"
advancedstructured field conditionssearch --mode advanced --conditions '[...]'
citekeya BibTeX citation keysearch --mode citekey smith2020
notestext inside your notes, not item fieldssearch --mode notes "research question"

semantic needs the search index built (zotero-cli db status to check, zotero-cli db update to build). If it is empty, fall back to items and say why rather than reporting no results.

Every search covers one library — the active one. When you don't know which library holds something, or a search comes up empty and the item might live in a group library, add --all-libraries:

bash
zotero-cli search "Cladder-Micus" --all-libraries

Each result is then labelled **Library:** <name>. It needs the SQLite backend, the default in local mode, and errors clearly if it is not in use, so try it once and fall back to per-library searches if it is refused. Tag filters work with it; --collection does not, because a collection lives inside one library.

Reading efficiently

get fulltext on a book-length PDF returns a great deal of text. When you need one section, use the outline to find it and read only those pages. To locate a passage by its words, --find returns the matching pages with short snippets instead of the pages themselves:

bash
zotero-cli --json outline ABCD1234
zotero-cli --json read ABCD1234 --find "robustness check"
zotero-cli --json read ABCD1234 --start-page 42 --end-page 55

For "what does my library say about X", prefer search --mode semantic followed by targeted get metadata over reading whole papers.

Paging

Listings cap at --limit. When more exists, the response says so and names the next offset:

bash
zotero-cli --json get collection-items QS7TQPPA --limit 100 --offset 100

Keep going until data.count is less than --limit.

Writing

Write commands report what they did as text under data.text.

bash
zotero-cli add doi 10.1038/s41586-021-03819-2 -c "Reading List"
zotero-cli edit ABCD1234 --title "Corrected Title" --add-tags reviewed
zotero-cli notes create --item-key ABCD1234 --text "Key finding: ..."
zotero-cli batch --item-keys A1B2C3D4,E5F6G7H8 --add-tags screened

Note text is Markdown, converted to Zotero's note format: headings, lists, tables, code, links (zotero:// ones stay clickable), $math$ and $$display$$, plus <u>, <s>, <sub>, <sup>, <mark> and <span style="color: red"> or background-color (red, orange, yellow, green, purple, magenta, blue, gray, or #hex). Pipe long text with --text -. HTML starting with <p>/<div> is kept to the note editor's tags, so a note read with notes list --raw-html, edited and written back with notes update keeps its citations and images; notes update --append adds to the end.

add is idempotent by default: re-running files the existing item into the named collection rather than creating a duplicate. Use --if-exists skip to never touch an existing item.

Before a destructive change (delete, duplicates merge, a batch over many items), confirm with the user and show what will be affected. delete item refuses notes unless --allow-note is passed.

Show full SKILL.md (400 more words)Show less

Reading and annotating a paper

bash
zotero-cli get children ITEM_KEY                          # the PDF's attachment key
zotero-cli read ITEM_KEY --start-page 1 --end-page 99     # end page clamps to the last page
zotero-cli path ATTACHMENT_KEY                            # the PDF file on disk
zotero-cli open ITEM_KEY --page 7                         # show that page in the Zotero reader
zotero-cli open --annotation ANNOTATION_KEY               # jump to one annotation and select it

When the user is reading along in Zotero and asks where something is, point the reader at it with open rather than only quoting a page number. annotations create --open does both in one step.

Extracted text is reliable for prose and unreliable for math, figures and tables: symbols drop out and table cells run together. read flags each page where that happens ("Garbled in this text: Equation (1), Table 2"). For those pages, look at the page itself if you can view images:

bash
zotero-cli read ITEM_KEY --start-page 4 --format image                         # PNG per page, up to 10
zotero-cli read ITEM_KEY --start-page 4 --format image --rect 0.35,0.49,0.3,0.05   # zoom into one region

To annotate, plan everything, check it, then write it in one run:

  1. zotero-cli --json layout ATTACHMENT_KEY lists figure, table and equation boxes with their captions and a paste-ready rect_arg.
  2. Write one JSON object per line: {"page": 4, "text": "exact words", "comment": "...", "color": "yellow"} for a highlight, or {"page": 3, "rect": "x,y,w,h", "comment": "..."} for a box, or {"page": 1, "note": "x,y", "comment": "..."} for a sticky note centered on a point (its text is the comment). Copy highlight text exactly from read; it is searched for on that page and two pages either side.
  3. zotero-cli annotations batch --attachment-key ATTACHMENT_KEY --file plan.jsonl --dry-run shows the words each highlight would cover. Fix every miss.
  4. Run it again without --dry-run. Anything that did not land is listed under data.results with ok: false, and the exit code is 1.

Colors take Zotero's names: yellow, red, green, blue, purple, magenta, orange, gray. Three or four colors with fixed meanings read better than eight; say what they mean in a note on the item.

Writes in local mode need a one-time zotero-mcp authorize-local (Zotero 10 or newer) or web API credentials. A write refused for that reason says so.

When something looks wrong

  • Empty search results: check zotero-cli config and, for semantic mode, zotero-cli db status. Do not report "you have no papers on X" until you know the library is actually reachable and indexed.
  • ok: false: read error.message. It names the cause.
  • A partial-results note on a search means the scan was cut short, not that nothing else matched. Narrow the query and re-run.
  • An item marked "deleted": true is in the trash. Do not treat it as part of the live library.

Full command reference

reference.md in this skill directory lists every command and flag. Read it when you need something not covered above. zotero-cli <command> --help also works for any single command.

© 54yyyu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in src/zotero_mcp/skills/zotero-cli of 54yyyu/zotero-mcp.

  • SKILL.md
  • reference.md

Open the folder on GitHubat commit 0faf1b2

Compare with similar skills

Zotero CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Zotero CLI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Zotero CLI this skill54yyyu/zotero-mcp5.3k—~2.3kAutomated safety check: PassMIT
Deeppapernote917Dhj/DeepPaperNote1.2k1 repos~5.9kAutomated safety check: PassMIT
Social Science Paper Writingfakerqwq/social-science-paper-writing-skill375—~7kAutomated safety check: PassNone
Ref Downloaderltczding-gif/ref-downloader139—~5.9kAutomated safety check: PassMIT
Gs Exportcookjohn/gs-skills524—~1.2kAutomated safety check: PassMIT
Literature DownloaderLucaswangzcx/literature-downloader-skill236—~1.4kAutomated safety check: PassMIT

Similar skills

  • Deeppapernote

    917Dhj/DeepPaperNote

    Generate a high-quality deep-reading note for a single paper and write it into an Obsidian-style vault.

    1.2k GitHub starsUsed in 1 repo~5.9k tokens
    Research & ScienceAuto-check passed
  • Social Science Paper Writing

    fakerqwq/social-science-paper-writing-skill

    Helps draft, diagnose, review and revise social science papers, from topic and research question to literature review, citation risks and pre-submission checks.

    375 GitHub stars~7k tokensUpdated 4 mo ago
    Research & ScienceAuto-check passed
  • Ref Downloader

    ltczding-gif/ref-downloader

    A skill your agent uses when the user asks to batch-download academic PDFs with ref-downloader — either ALL references of one paper (Mode A: DOI or PDF input), OR a custom batch of papers (Mode B…

    139 GitHub stars~5.9k tokensUpdated 4 mo ago
    Research & ScienceAuto-check passed
  • Gs Export

    cookjohn/gs-skills

    Export Google Scholar paper(s) to Zotero via BibTeX. An agent skill from cookjohn/gs-skills.

    524 GitHub stars~1.2k tokensUpdated 6 mo ago
    Research & ScienceAuto-check passed
  • Literature Downloader

    Lucaswangzcx/literature-downloader-skill

    中文文献检索、筛选、批量采集和合法全文获取助手。用于用户需要查找论文、下载可合法获取的 PDF/HTML/XML 全文、生成关键词和检索式、查询 DOI/PMID、筛选高影响因子或高分区期刊、检查开放获取、做引用链扩展、批量文献候选表、下载日志、去重清单、Zotero/BibTeX 整理,或解决文献难下载问题;禁止绕过付费墙、盗版下载、共享账号或规避版权限制。

    236 GitHub stars~1.4k tokensUpdated 5 mo ago
    Research & ScienceAuto-check passed
  • Scholar RAG

    joshzyj/open-scholar-skill

    Build and query a local vector database + GraphRAG over your entire reference library (Zotero or a PDF folder) for literature review.

    168 GitHub stars~7.4k tokensUpdated 20 days ago
    Research & ScienceAuto-check: notes

More from 54yyyu/zotero-mcp

  • Annotate Paper

    54yyyu/zotero-mcp

    Read the open paper and write study annotations into its PDF with zotero-cli - a context box on the title, a four-part summary on the abstract, role-coded abstract highlights, one box per figure…

    5.3k GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Works with

Questions about Zotero CLI

What does Zotero CLI do?

Reads and edits a Zotero library from the shell with zotero-cli: search by keyword or meaning, read PDF text, manage tags, notes and collections, and export bibliographies. The skill tells the agent to use `zotero-cli` instead of the Zotero MCP server whenever shell access exists, because the MCP tool schemas add roughly 14k tokens of context to every request while the CLI costs only what is run. Before the first real call, `zotero-cli config` confirms the setup.

When should I use Zotero CLI?

Zotero CLI fits situations like: finding papers in a Zotero library by title, author or topic; reading the full text or page ranges of a saved PDF; adding items to the library by DOI, URL or ISBN; exporting a bibliography from selected items.

How do I install Zotero CLI in Claude Code?

Run `npx skills add 54yyyu/zotero-mcp --skill zotero-cli -a claude-code`. Or copy the skill folder (src/zotero_mcp/skills/zotero-cli in 54yyyu/zotero-mcp) into .claude/skills/zotero-cli in your project. Claude Code loads it when a task matches its description.

How do I install Zotero CLI in Codex?

Run `npx skills add 54yyyu/zotero-mcp --skill zotero-cli -a codex`. Or copy the skill folder (src/zotero_mcp/skills/zotero-cli in 54yyyu/zotero-mcp) into .agents/skills/zotero-cli in your project. Codex loads it when a task matches its description.

Can I use Zotero CLI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 54yyyu/zotero-mcp --skill zotero-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/zotero-cli, .gemini/skills/zotero-cli, .github/skills/zotero-cli and .opencode/skills/zotero-cli in your project.

What does Zotero CLI need to run?

Going by SKILL.md and its folder, Zotero CLI needs the command-line tools its instructions call (jq) and credentials named ATTACHMENT_KEY, ITEM_KEY, ZOTERO_API_KEY and ANNOTATION_KEY. Our summary lists: The `zotero-cli` command; Zotero desktop app with its local API enabled, or ZOTERO_API_KEY and ZOTERO_LIBRARY_ID for web mode; A built search index for semantic search.

Does Zotero CLI access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Zotero CLI safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Zotero CLI use?

Zotero CLI is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Zotero CLI use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Zotero CLI?

Skills that share tags, products or a category with Zotero CLI: Deeppapernote (917Dhj/DeepPaperNote, 1.2k stars), Social Science Paper Writing (fakerqwq/social-science-paper-writing-skill, 375 stars), Ref Downloader (ltczding-gif/ref-downloader, 139 stars) and Gs Export (cookjohn/gs-skills, 524 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Zotero CLI?

54yyyu (a GitHub user) maintains it in 54yyyu/zotero-mcp, which has 5,278 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 8, 2026.

Source: 54yyyu/zotero-mcp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.