Agent skill

CLI Anything Zotero

by PiaoyangGuohai1 in PiaoyangGuohai1/cli-anything-zotero

Full-featured CLI for Zotero reference management. An agent skill from PiaoyangGuohai1/cli-anything-zotero.

Apache-2.0Auto-check passedResearch & Science

Install CLI Anything Zotero

skills CLI
$ npx skills add PiaoyangGuohai1/cli-anything-zotero --skill cli-anything-zotero -a claude-code

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

GitHub CLI
$ gh skill install PiaoyangGuohai1/cli-anything-zotero cli-anything-zotero --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/PiaoyangGuohai1/cli-anything-zotero.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli_anything/zotero/skills .claude/skills/cli-anything-zotero && 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
cli-anything-zotero
GitHub stars
138
Token cost
~2.6k tokens
SKILL.md length
406 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

Full-featured CLI for Zotero reference management. An agent skill from PiaoyangGuohai1/cli-anything-zotero.

  • Works in 4 steps: Run zotero-cli --json app doctor first.… → Prefer zotero-cli --json ... for… → Write ops are appended to a local audit… → …
  • Tasks that involve Citation management
  • SKILL.md covers Before You Start, When to Use, Key Commands by Task and Output Format, plus 3 more sections
  • Reaches doi.org; needs ITEM_KEY and COLLECTION_KEY

What it does

CLI Anything Zotero is an agent skill from PiaoyangGuohai1/cli-anything-zotero. Full-featured CLI for Zotero reference management. Search, import by DOI/PMID, export BibTeX, attach PDFs, semantic search, manage tags/collections, and more. Use this tool whenever you need to interact with a Zotero library programmatically.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Citation management. It works with Zotero, LaTeX, Model Context Protocol and OpenAI. The repository describes itself as: 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. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Citation management

Example prompts

  • “/cli-anything-zotero”

Requirements

  • A credential in ITEM_KEY
  • A credential in COLLECTION_KEY

Workflow steps

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

  1. Run zotero-cli --json app doctor first. If write_ready is false, follow next_steps (start Zotero / install plugin / enable Local API).
  2. Prefer zotero-cli --json ... for machine-readable results (ok, status, code, key).
  3. Write ops are appended to a local audit log: zotero-cli --json audit tail --limit 20 / audit path.
  4. Optionally run zotero-cli app check-update once per session.

What it can do on your machine

Read from SKILL.md and the folder at commit e42a930. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • doi.org

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

  • Credentials

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

    • ITEM_KEY
    • COLLECTION_KEY
    • ZOTERO_EMBED_KEY

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

Context cost

CLI Anything Zotero loads about 2.6k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 406 words of instructions outside code blocks.

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

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 PiaoyangGuohai1/cli-anything-zotero at commit e42a930, republished under its Apache-2.0 licence (© PiaoyangGuohai1). 406 words, ~2,598 tokens.

Download SKILL.mdSave it as .claude/skills/cli-anything-zotero/SKILL.md (or your agent's skills folder).
name
cli-anything-zotero
description
Full-featured CLI for Zotero reference management. Search, import by DOI/PMID, export BibTeX, attach PDFs, semantic search, manage tags/collections, and more. Use this tool whenever you need to interact with a Zotero library programmatically.

cli-anything-zotero

Agent-native CLI for Zotero 7/8/9 desktop. 40+ commands across four backends.

Before You Start

  1. Run zotero-cli --json app doctor first. If write_ready is false, follow next_steps (start Zotero / install plugin / enable Local API).
  2. Prefer zotero-cli --json ... for machine-readable results (ok, status, code, key).
  3. Write ops are appended to a local audit log: zotero-cli --json audit tail --limit 20 / audit path.
  4. Optionally run zotero-cli app check-update once per session.

When to Use

  • User asks to search, find, or look up papers in their Zotero library
  • User needs to import a paper by DOI or PMID
  • User wants to export citations or BibTeX
  • User needs to attach a PDF to a Zotero item
  • User wants to find available PDFs for items missing them
  • User asks about collection statistics, duplicates, or annotations
  • User needs semantic search ("find papers similar to X")
  • User wants to update metadata, tags, or manage collections

Key Commands by Task

Search & Discovery
bash
# Keyword search
zotero-cli item find "query" --limit 10

# Search all Zotero fields, tags, notes, and annotations
zotero-cli item find "query" --scope fields --limit 10

# Search everything Zotero can search, including full content
zotero-cli item find "query" --scope everything --limit 10

# Full-text search inside PDFs
zotero-cli item search-fulltext "query" --limit 10

# Semantic search (requires ZOTERO_EMBED_* env vars)
zotero-cli item semantic-search "natural language query" --top-k 10

# Find papers similar to a known item
zotero-cli item similar ITEM_KEY --top-k 5

# Search annotations/highlights by keyword or color
zotero-cli item search-annotations "keyword" --color "#ff6666" --limit 10

# Find duplicates
zotero-cli --json item duplicates --by doi --limit 20
zotero-cli --json item merge KEEP OTHER1 OTHER2   # dry-run default; --confirm to apply
Read Item Details
bash
# Full item metadata (returns JSON with title, creators, DOI, tags, attachments, etc.)
zotero-cli --json item get ITEM_KEY

# List attachments
zotero-cli --json item attachments ITEM_KEY

# View PDF annotations
zotero-cli --json item annotations ITEM_KEY

# Citation metrics from NIH iCite
zotero-cli --json item metrics PMID --pmid
# Or by Zotero item key (auto-extracts PMID from extra field)
zotero-cli --json item metrics ITEM_KEY
Import Papers
bash
# Preferred: unified add
zotero-cli --json add doi "10.1038/s41586-024-07871-6" --tag "review" --collection COLLECTION_KEY --fetch-pdf
zotero-cli --json add arxiv 2602.02093 --collection COLLECTION_KEY
zotero-cli --json add file ./paper.pdf --collection COLLECTION_KEY
zotero-cli --json add bibtex ./references.bib --collection COLLECTION_KEY
zotero-cli --json add url https://doi.org/10.1038/s41586-021-03819-2

# Lower-level DOI import still available
zotero-cli --json import doi "10.1038/s41586-024-07871-6" --if-exists file --no-translator
zotero-cli import pmid "38551621" --tag "epidemiology"
Export & Citations
bash
# Export one item in BibTeX
zotero-cli item export ITEM_KEY --format bibtex

# Export a standalone BibTeX file for downstream tools
zotero-cli export bib --items KEY1,KEY2 --output refs.bib
zotero-cli export bib --collection COLLECTION_KEY --output refs.bib

# Other formats: ris, biblatex, csljson, csv, mods, refer
zotero-cli item export ITEM_KEY --format ris

# Render citation preview (static HTML, not a refreshable DOCX field)
zotero-cli item citation ITEM_KEY --style apa

# Render bibliography preview (static HTML, not a refreshable DOCX field)
zotero-cli item bibliography ITEM_KEY --style apa

# Inspect citation fields inside a DOCX before mixing Zotero/EndNote/static references
zotero-cli --json docx inspect-citations manuscript.docx

# AI-authored DOCX citations must use real Zotero placeholders, then validate them
zotero-cli --json docx inspect-placeholders manuscript.docx
zotero-cli --json docx validate-placeholders manuscript.docx

# Static final DOCX: replace placeholders with ordinary text citations and bibliography
zotero-cli --json docx render-citations manuscript.docx --output manuscript-static.docx --force

# Preferred one-shot pipeline (auto: dynamic if LibreOffice ready, else static)
zotero-cli --json docx cite manuscript.docx --output manuscript-cited.docx --mode auto --force

# Dynamic final DOCX: use Zotero/LibreOffice fields when the user needs Refresh
zotero-cli --json docx doctor
zotero-cli --json docx insert-citations manuscript.docx --output manuscript-zotero.docx --force

### AI DOCX Citation Decision Flow

When the user provides a DOCX draft that contains citations, follow this explicit branch:

- Ask for intent if mode is unclear:
  - "Do you want static references (final text now), or dynamic references (refreshable in Zotero/LibreOffice)?"
- Preferred default for agents:
  - `zotero-cli --json docx cite <docx> --output <final.docx> --mode auto --force`
- If static is explicitly requested:
  - `zotero-cli --json docx cite <docx> --output <final.docx> --mode static --force`
- If dynamic is explicitly requested or user mentions later editing/refresh:
  - `zotero-cli --json docx cite <docx> --output <final.docx> --mode dynamic --force`
  - or lower-level: validate → doctor → insert-citations
- If dynamic conversion returns environment errors:
  - do not retry blindly
  - report exact error context from `docx doctor`/`docx zoterify-probe`
  - offer fallback to static mode (`render-citations`)

Keep only user-facing outputs:
- input placeholder DOCX
- final converted DOCX
- debug artifacts only if user explicitly asked for `--debug-dir`

Behavior note:
- `item citation` and `item bibliography` are static previews and must **not** be used as a replacement for DOCX writing conversion.
- `docx prepare-zotero-import` remains experimental and should not be called in normal user workflows.

When drafting DOCX content with AI, never invent final static citations such as (Author, 2024) unless the user explicitly asks for static prose. Insert {{zotero:ITEMKEY}} or {{zotero:KEY1,KEY2}} placeholders from real Zotero items and validate the document before handoff. When the user asks to insert citations without specifying a mode, ask whether they want static citations (docx render-citations, simplest) or dynamic Zotero fields (docx insert-citations, refreshable but requires LibreOffice).

PDF Management
bash
# Attach a local PDF to an existing item
zotero-cli item attach ITEM_KEY /path/to/paper.pdf

# Zotero-only find PDF
zotero-cli --json item find-pdf ITEM_KEY

# Cascade: Zotero → Unpaywall → EuropePMC → bioRxiv → arXiv
zotero-cli --json item fetch-pdf ITEM_KEY --sources zotero,unpaywall,epmc,biorxiv,arxiv

# Batch cascade for a collection (JSONL progress optional)
zotero-cli --json collection fetch-pdfs COLLECTION_KEY --limit 20 --jsonl-progress --resume
Write Operations
bash
# Update metadata fields
zotero-cli item update ITEM_KEY --field title="New Title" --field DOI="10.1234/xxx"

# Add/remove tags
zotero-cli item tag ITEM_KEY --add "important" --remove "unread"

# Delete item (requires --confirm)
zotero-cli item delete ITEM_KEY --confirm
Collection Management
bash
# List all collections
zotero-cli collection list

# Collection hierarchy
zotero-cli collection tree

# Find collection by name
zotero-cli collection find "query"

# Items in a collection (includes DOI, hasPdf, date)
zotero-cli --json collection items COLLECTION_KEY

# Collection statistics (total items, PDF coverage, year/journal distribution)
zotero-cli --json collection stats COLLECTION_KEY

# Create / rename / delete collection
zotero-cli collection create "New Collection"
zotero-cli collection rename COLLECTION_KEY --name "New Name"
zotero-cli collection delete COLLECTION_KEY --confirm

# Add/remove items from collection
zotero-cli item add-to-collection ITEM_KEY COLLECTION_KEY
zotero-cli collection remove-item COLLECTION_KEY ITEM_KEY
Sync & Utilities
bash
# Trigger Zotero sync
zotero-cli sync

# Execute arbitrary Zotero JavaScript
zotero-cli js "return Zotero.Items.getAll(1).length;" --wait 5

# Interactive REPL
zotero-cli repl
Show full SKILL.md (171 more words)Show less

Output Format

  • Use --json flag on the root command for machine-readable JSON output:
    bash
    zotero-cli --json item find "query"
  • Without --json, output is human-readable text.

Important Constraints

  • All platforms: Works on macOS, Windows, and Linux with the JS Bridge plugin installed.
  • Zotero desktop must be running: This is a hard prerequisite (not optional). Use zotero-cli --json app doctor / app launch if it is closed. Do not invent cloud-only or read-only degraded workflows.
  • JS Bridge plugin required: Install via zotero-cli app install-plugin. Once installed, all JS bridge commands work silently.
  • Semantic search: Requires ZOTERO_EMBED_API, ZOTERO_EMBED_MODEL, and ZOTERO_EMBED_KEY environment variables, plus a pre-built vector index at ZOTERO_VECTOR_DB.
  • Item references: Most commands accept a Zotero item key (8-char alphanumeric like 9LPV3KTS), title fragment, or numeric ID.
  • Collection references: Accept collection key or numeric ID.

Common Workflows

"Find papers about X and export BibTeX"
bash
zotero-cli --json item find "X" --limit 20
# Pick relevant keys from output, then:
zotero-cli export bib --items KEY1,KEY2 --output refs.bib
"Import a paper and attach its PDF"
bash
zotero-cli import doi "10.xxxx/yyyy"
# Note the item key from output, then:
zotero-cli item attach ITEM_KEY /path/to/paper.pdf
"What papers in collection X are missing PDFs?"
bash
zotero-cli --json collection stats COLLECTION_KEY
# Shows total vs withPDF vs noPDF count
# Then batch-find:
zotero-cli collection find-pdfs COLLECTION_KEY
"Find papers similar to one I'm reading"
bash
zotero-cli --json item similar ITEM_KEY --top-k 10

Version

1.2.1+ (see package __version__ / PyPI). Roadmap: repo docs/ROADMAP.md.

© PiaoyangGuohai1, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in cli_anything/zotero/skills of PiaoyangGuohai1/cli-anything-zotero.

Open the folder on GitHubat commit e42a930

Compare with similar skills

CLI Anything Zotero 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.

CLI Anything Zotero compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
CLI Anything Zotero this skillPiaoyangGuohai1/cli-anything-zotero138—~2.6kAutomated safety check: PassApache-2.0
Annotate Paper54yyyu/zotero-mcp5.3k—~1.5kAutomated safety check: PassMIT
NSFC Literature Review WriterHuiyuLi-2000/Chinese-Grant-Writer-Skills4391 repos~1.4kAutomated safety check: NotesMIT
Autonomous Researchfedericodeponte/opendraft507—~8.2kAutomated safety check: PassApache-2.0
Arxiv MCP Serverblazickjp/arxiv-mcp-server3.2k—~353Automated safety check: PassApache-2.0
Zoterocongcongwang0122/zotero-skill200—~1.6kAutomated safety check: PassNone

Similar skills

  • 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 3 days ago
    Research & ScienceAuto-check passed
  • NSFC Literature Review Writer

    HuiyuLi-2000/Chinese-Grant-Writer-Skills

    Writes the research-status literature review and critique section of an NSFC grant proposal, backed by a bundled multi-source literature search.

    439 GitHub starsUsed in 1 repo~1.4k tokens
    Research & ScienceAuto-check: notes
  • Autonomous Research

    federicodeponte/opendraft

    An 18-agent pipeline that turns one topic line into a drafted research paper, literature review, or thesis chapter.

    507 GitHub stars~8.2k tokensUpdated 9 days ago
    Research & ScienceAuto-check passed
  • Arxiv MCP Server

    blazickjp/arxiv-mcp-server

    A skill your agent uses when finding, comparing, reading, or monitoring arXiv papers, including requests for abstracts, citation graphs, original LaTeX, section-level technical details, or…

    3.2k GitHub stars~353 tokensUpdated 2 days ago
    Research & ScienceAuto-check passed
  • Zotero

    congcongwang0122/zotero-skill

    Use Zotero Desktop to enable/probe the local API, search a local Zotero library, list items/collections/tags, export BibTeX, insert citation keys into LaTeX or Markdown drafts, read indexed full…

    200 GitHub stars~1.6k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Academic Integrity Rewrite

    lin1111-1/academic-integrity-rewrite

    Revise Chinese or English academic writing for lower unnecessary textual overlap while preserving meaning, evidence, numbers, equations, terminology, and citations.

    102 GitHub stars~1.1k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed

Questions about CLI Anything Zotero

What does CLI Anything Zotero do?

Full-featured CLI for Zotero reference management. An agent skill from PiaoyangGuohai1/cli-anything-zotero. CLI Anything Zotero is an agent skill from PiaoyangGuohai1/cli-anything-zotero. Full-featured CLI for Zotero reference management.

When should I use CLI Anything Zotero?

CLI Anything Zotero fits situations like: tasks that involve Citation management.

How do I install CLI Anything Zotero in Claude Code?

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

How do I install CLI Anything Zotero in Codex?

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

Can I use CLI Anything Zotero 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 PiaoyangGuohai1/cli-anything-zotero --skill cli-anything-zotero -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cli-anything-zotero, .gemini/skills/cli-anything-zotero, .github/skills/cli-anything-zotero and .opencode/skills/cli-anything-zotero in your project.

What does CLI Anything Zotero need to run?

Going by SKILL.md and its folder, CLI Anything Zotero needs credentials named ITEM_KEY, COLLECTION_KEY and ZOTERO_EMBED_KEY. Our summary lists: A credential in ITEM_KEY; A credential in COLLECTION_KEY.

Does CLI Anything Zotero access the network?

SKILL.md names 1 domain. In commands or code: doi.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is CLI Anything Zotero 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 CLI Anything Zotero use?

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

How many tokens does CLI Anything Zotero use?

About 2.6k tokens (SKILL.md is roughly 10k 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 CLI Anything Zotero?

Skills that share tags, products or a category with CLI Anything Zotero: Annotate Paper (54yyyu/zotero-mcp, 5.3k stars), NSFC Literature Review Writer (HuiyuLi-2000/Chinese-Grant-Writer-Skills, 439 stars), Autonomous Research (federicodeponte/opendraft, 507 stars) and Arxiv MCP Server (blazickjp/arxiv-mcp-server, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains CLI Anything Zotero?

PiaoyangGuohai1 (a GitHub user) maintains it in PiaoyangGuohai1/cli-anything-zotero, which has 138 GitHub stars. The repository was last updated on July 28, 2026.

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