← 返回
开发者工具 中文

Zotero PDF Local Import

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...
通过Zotero本地连接器(127.0.0.1),在Windows/macOS/Linux命令行中将本地PDF文件导入Zotero。适用于单个PDF导入、文件夹...
mxingchtongaelofficial2568
开发者工具 clawhub v0.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 518
下载
💾 34
安装
1
版本
#latest

概述

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:/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 , port xxxx, collection xxxx
  • “Import this PDF: , 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

版本历史

共 1 个版本

  • v0.0.1 当前
    2026-03-30 03:09 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 323,999
ai-intelligence

文献精读小工具

mxingchtongaelofficial2568
将论文 PDF 批处理为中文精读总结报告的工作流技能。适用于“PaddleOCR 或 pdfplumber 抽取文本 + 大模型总结论文”场景。使用时仅读取 skill 目录下 config.json 与 prompt.md,并运行 scr
★ 0 📥 1,986
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 67 📥 180,031