zotero-local-import-en

Import local PDF files into Zotero from the command line on Windows/macOS/Linux via the Zotero local connector (127.0.0.1). Use for single-PDF import, folder batch import, importing into an existing collection, listing collections, and verifying recent imported attachments. Requires Zotero desktop setting to allow local app communication and a user-provided connector port.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "zotero-local-import-en" with this command: npx skills add mxingchtongaelofficial2568/zotero-local-import-en

Zotero Local Import Skill (Windows / macOS / Linux)

Before using this skill, make sure Zotero Desktop is open and configured:

  1. Open Zotero → Settings → Advanced
  2. Enable: Allow other applications on this computer to communicate with Zotero
  3. Note the connector port (commonly 23119) and provide it to the agent via --port

This skill only imports into existing collections. It does not create collections. If --collection is not provided, imports default to My Library.

Script location

  • scripts/zotero_tool.py

Features

  1. Import a single PDF
  2. Import all PDFs in a folder (optional recursive mode)
  3. Import into an existing collection
  4. List local Zotero collections
  5. Check recently imported attachments (read-only from zotero.sqlite)

Agent pre-execution contract (foolproof mode)

The agent must support all of the following user input forms and complete import automatically:

  1. A folder path
  2. A single PDF path
  3. Multiple PDF paths
  4. A few PDFs inside a folder (user can provide file names such as x.pdf, y.pdf, z.pdf)

The agent must also collect:

  • Zotero local connector port
  • Optional collection name (if omitted, default to My Library)

Required execution flow:

  1. Run doctor --auto-install-deps
  2. If successful, run import

Natural-language parsing (paths, file names, port, collection) must be handled by the agent, not by the script. The script accepts structured arguments only.

Command usage

Run from repository root (or use absolute script path):

python skills/zotero-local-import-en/scripts/zotero_tool.py --help

0) Environment check (mandatory)

python skills/zotero-local-import-en/scripts/zotero_tool.py doctor \
  --port <USER_ZOTERO_PORT> \
  --auto-install-deps

This checks and auto-handles:

  • Python runtime availability
  • requests dependency (auto-installs if missing)
  • http://127.0.0.1:<port>/connector/ping connectivity
  • Platform URL opener availability (Windows: os.startfile, macOS: open, Linux: xdg-open)

If auto-install fails, the agent should surface the error and suggest:

python -m pip install requests>=2.31.0

NL) Natural-language input policy (agent-side parsing only)

Users may say things like:

  • “Import x.pdf, y.pdf, z.pdf from <folder>, port xxxx, collection xxxx
  • “Import this PDF: <absolute path>, port xxxx

The agent must convert NL input into structured CLI args, then call import:

  • Folder mode: --dir + optional --pick
  • Single/multiple PDF mode: repeated --pdf
  • Port: --port
  • Collection: optional --collection (defaults to My Library)

A) Import a single PDF

python skills/zotero-local-import-en/scripts/zotero_tool.py import \
  --pdf "<ABSOLUTE_PDF_PATH>" \
  --port <USER_ZOTERO_PORT>

A2) Import multiple PDFs (repeat --pdf)

python skills/zotero-local-import-en/scripts/zotero_tool.py import \
  --pdf "<PDF_PATH_1>" \
  --pdf "<PDF_PATH_2>" \
  --pdf "<PDF_PATH_3>" \
  --port <USER_ZOTERO_PORT>

B) Batch import a folder (non-recursive)

python skills/zotero-local-import-en/scripts/zotero_tool.py import \
  --dir "<ABSOLUTE_FOLDER_PATH>" \
  --port <USER_ZOTERO_PORT>

C) Batch import a folder (recursive)

python skills/zotero-local-import-en/scripts/zotero_tool.py import \
  --dir "<ABSOLUTE_FOLDER_PATH>" \
  --recursive \
  --port <USER_ZOTERO_PORT>

D) Import into a specific existing collection

python skills/zotero-local-import-en/scripts/zotero_tool.py import \
  --dir "<ABSOLUTE_FOLDER_PATH>" \
  --recursive \
  --collection "<EXISTING_COLLECTION_NAME>" \
  --port <USER_ZOTERO_PORT>

D2) Import selected PDFs from a folder (CSV file names)

python skills/zotero-local-import-en/scripts/zotero_tool.py import \
  --dir "<ABSOLUTE_FOLDER_PATH>" \
  --pick "x.pdf,y.pdf,z.pdf" \
  --collection "<EXISTING_COLLECTION_NAME>" \
  --port <USER_ZOTERO_PORT>

Or repeat --pick:

python skills/zotero-local-import-en/scripts/zotero_tool.py import \
  --dir "<ABSOLUTE_FOLDER_PATH>" \
  --pick "x.pdf" \
  --pick "y.pdf" \
  --pick "z.pdf" \
  --port <USER_ZOTERO_PORT>

E) List local collections

python skills/zotero-local-import-en/scripts/zotero_tool.py list-collections --port <USER_ZOTERO_PORT>

F) Check recently imported attachments

python skills/zotero-local-import-en/scripts/zotero_tool.py check --limit 10

Key parameters

  • --port: Zotero connector port (provided by user; defaults to ZOTERO_PORT env var, fallback 23119)
  • --timeout: HTTP timeout in seconds (default 90)
  • --collection: target existing collection name
  • --db: zotero.sqlite path (override for check)

Platform notes

  • Windows: supported by default
  • macOS: requires open
  • Linux: requires xdg-open

Failure handling

  • error=collection not found: create the collection manually in Zotero first
  • Connection failures: verify Zotero is running, local-app communication is enabled, and port is correct
  • Import failures: retry with one PDF first, then run batch import

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Leads

Leads - command-line tool for everyday use

Registry SourceRecently Updated
General

Bmi Calculator

BMI计算器。BMI计算、理想体重、健康计划、体重追踪、儿童BMI、结果解读。BMI calculator with ideal weight, health plan. BMI、体重、健康。

Registry SourceRecently Updated
General

Blood

Blood — a fast health & wellness tool. Log anything, find it later, export when needed.

Registry SourceRecently Updated
General

Better Genshin Impact

📦BetterGI · 更好的原神 - 自动拾取 | 自动剧情 | 全自动钓鱼(AI) | 全自动七圣召唤 | 自动伐木 | 自动刷本 | 自动采集/挖矿/锄地 | 一条龙 | 全连音游 - UI A better genshin impact, c#, auto-play-game, automatic, g...

Registry SourceRecently Updated