Zotero Enhanced Library Manager
This skill provides a suite of scripts to interact with a Zotero library, covering the full document lifecycle: adding, searching, and reading. Includes enhanced metadata fetching for PDFs with DOI or arXiv IDs.
Storage Modes
The skill supports two storage configurations:
1. Zotero Cloud Storage (Default)
- - Uses Zotero's built-in cloud storage (300MB free)
- No WebDAV configuration needed
- File size limit: ~100MB per file
- Required variables:
ZOTERO_USER_ID, INLINECODE1
2. WebDAV Storage
- - For users with their own WebDAV server (Synology, Nextcloud, etc.)
- No file size limits (subject to server constraints)
- Supports both
imported_file (stored directly) and imported_url (referenced via WebDAV URL) attachment types - Required variables:
ZOTERO_USER_ID, ZOTERO_API_KEY, WEBDAV_URL, WEBDAV_USER, INLINECODE8
Authentication
All scripts require Zotero API credentials. Get your API key from: https://www.zotero.org/settings/keys
- - ZOTEROUSERID: Your Zotero user ID (found in profile URL)
- ZOTEROAPIKEY: Your Zotero API key
- WEBDAV_*: Only required if using WebDAV storage
1. Searching for Documents
Use scripts/search.sh to find items in the library by keyword.
Usage
# Ensure the script is executable
chmod +x scripts/search.sh
# Run the search
ZOTERO_USER_ID="<user_id>" \
ZOTERO_API_KEY="<api_key>" \
bash scripts/search.sh "your search query"
The script outputs a formatted list of matching items with their
Key, needed for reading.
2. Reading a Document
Option A: Universal Reader (Recommended)
Use
scripts/read_universal.sh to read documents from either storage mode.
Usage
CODEBLOCK1
Option B: WebDAV-only Reader
Use
scripts/read.sh for WebDAV storage only (legacy).
3. Managing Notes
The skill now supports creating, reading, updating, and deleting notes in your Zotero library. Notes can be standalone or attached to parent items (documents).
Creating a Note
Use scripts/create_note.sh to create a new note with plain text content.
Usage
CODEBLOCK2
Options
- -
--parent KEY: Attach note to a parent item (document key) - INLINECODE15 : Add a tag (can be used multiple times)
- INLINECODE16 : Show steps without creating the note
The script automatically converts plain text to HTML for Zotero storage.
Reading a Note
Use scripts/read_note.sh to read a note and convert HTML back to plain text.
Usage
CODEBLOCK3
Output Formats
- -
plain (default): Human-readable plain text - INLINECODE19 : Raw HTML content
- INLINECODE20 : Full JSON item data
Updating a Note
Use scripts/update_note.sh to update existing notes with new content or tags.
Usage
CODEBLOCK4
Options
- -
--replace: Replace note content (default) - INLINECODE23 : Append new content to existing note
- INLINECODE24 : Add a tag (can be used multiple times)
- INLINECODE25 : Remove a tag (can be used multiple times)
- INLINECODE26 : Show steps without updating
The script includes version checking to prevent update conflicts.
Deleting a Note
Use scripts/delete_note.sh to delete notes safely with confirmation and backup options.
Usage
CODEBLOCK5
Safety Features
- - Confirmation prompt: Requires manual confirmation unless
--no-confirm is used - Backup option: Saves note content to
~/.zotero-backup/ before deletion - Version checking: Prevents deletion if note was modified by another process
- Dry-run mode: Preview deletion without actually deleting
4. Adding a New Document
Option A: Universal Upload with Metadata Fetching (Recommended)
Use
scripts/add_to_zotero_universal.sh for full metadata fetching and flexible storage.
Features
- - Automatic Metadata: Extracts DOI/arXiv ID, fetches metadata from Crossref/arXiv API
- Flexible Storage: Works with both Zotero cloud and WebDAV storage
- Smart Detection: Falls back to title extraction if no metadata found
- Dry-run mode: Use
--dry-run to see what would be uploaded without making changes
Usage
CODEBLOCK6
Example: Adding a Paper with DOI
The universal script will:
- 1. Extract DOI
10.1126/science.aec8352 from PDF - Query Crossref API for metadata (authors, journal, date, abstract, etc.)
- Create Zotero item with complete metadata
- Upload PDF via Zotero API (cloud) or WebDAV (if configured)
Option B: Enhanced Upload (Flexible Storage)
Use
scripts/add_to_zotero_enhanced.sh for flexible storage with metadata fetching. Supports both Zotero cloud and WebDAV storage.
Option C: Basic Upload (Flexible Storage)
Use
scripts/add_to_zotero.sh for flexible storage with title-only extraction. Supports both Zotero cloud and WebDAV storage.
5. Requirements
Core Dependencies
- -
curl: HTTP requests - INLINECODE36 : JSON processing (for enhanced/universal scripts)
- INLINECODE37 : PDF text extraction (from poppler-utils)
- INLINECODE38 : File compression (for WebDAV mode)
Platform Support
All scripts are cross‑platform compatible (Linux and macOS). The universal scripts automatically detect platform‑specific commands (
md5sum/
md5,
stat options).
Installation (Debian/Ubuntu)
CODEBLOCK7
Installation (macOS)
CODEBLOCK8
Quick Start
- 1. Get Zotero API credentials from your Zotero settings
- Install dependencies as shown above
- Check dependencies (optional but recommended):
bash scripts/check_deps.sh
- 4. Test search functionality:
ZOTERO_USER_ID="1234567" \
ZOTERO_API_KEY="abc123def456" \
bash scripts/search.sh "artificial intelligence"
- 5. Add your first paper:
CODEBLOCK11
Changelog
v1.3.2 (2026‑03‑31)
- - Updated external services metadata in SKILL.md to resolve ClawHub scan errors
- Added external API URLs (Crossref, arXiv, Zotero API, WebDAV) to metadata for better compatibility
v1.3.1 (2026‑03‑30)
- - Fixed version conflict in Clawhub publication
v1.3.0 (2026‑03‑30)
- - Added note management support with four new scripts:
-
create_note.sh: Create notes (plain text → HTML, optional parent, tags)
-
read_note.sh: Read notes (HTML → text, with format options)
-
update_note.sh: Update notes (append/replace, tag management, version checking)
-
delete_note.sh: Delete notes (with confirmation, backup option)
- - Implemented HTML ↔ plain text conversion for notes
- Added safety features: dry-run mode, confirmation prompts, backup before deletion
- Updated documentation with comprehensive Note Management section
v1.2.2 (2026‑03‑30)
- - Removed library organization tools (
check_attachments.sh, find_duplicates.sh, analyze_tags.sh) per user request. - Reverted documentation to focus on core metadata fetching and file management.
v1.2.1 (2026‑03‑30)
- - Added
imported_url support in read_universal.sh for WebDAV‑stored PDFs. - Implemented
--dry‑run mode for add_to_zotero_universal.sh. - Improved argument parsing and help messages.
- Updated security documentation.
v1.2.0 (2026‑03‑30)
- - Cross‑platform compatibility (Linux/macOS) with automatic detection of
md5sum/md5 and stat variants. - Added dependency checker script (
check_deps.sh). - Added OpenClaw metadata declaration for better integration.
- Added LICENSE and SECURITY.md files.
- Improved script safety headers and
--help/--version flags.
Troubleshooting
"No PDF attachment found"
- - Ensure the item has an attached PDF (not just a URL)
- Check that attachment has
linkMode: "imported_file" (stored directly) or linkMode: "imported_url" (referenced via WebDAV) - If using WebDAV, the
read_universal.sh script will search for both types automatically
"WebDAV authentication failed"
- - Verify WebDAV URL, username, and password
- Test WebDAV access with: INLINECODE62
"Crossref API failed"
- - Check internet connection
- Verify DOI is valid: INLINECODE63
"File too large for Zotero API"
- - Large files (>100MB) require WebDAV storage
- Set
WEBDAV_URL, WEBDAV_USER, WEBDAV_PASS variables
Zotero 增强版库管理器
本技能提供了一套与 Zotero 库交互的脚本,涵盖完整的文档生命周期:添加、搜索和阅读。包含针对带有 DOI 或 arXiv ID 的 PDF 的增强元数据获取功能。
存储模式
本技能支持两种存储配置:
1. Zotero 云存储(默认)
- - 使用 Zotero 内置云存储(300MB 免费)
- 无需 WebDAV 配置
- 文件大小限制:每个文件约 100MB
- 所需变量: ZOTEROUSERID、ZOTEROAPIKEY
2. WebDAV 存储
- - 适用于拥有自己的 WebDAV 服务器(群晖、Nextcloud 等)的用户
- 无文件大小限制(受服务器约束)
- 支持 importedfile(直接存储)和 importedurl(通过 WebDAV URL 引用)两种附件类型
- 所需变量: ZOTEROUSERID、ZOTEROAPIKEY、WEBDAVURL、WEBDAVUSER、WEBDAV_PASS
身份验证
所有脚本都需要 Zotero API 凭证。从以下地址获取您的 API 密钥:https://www.zotero.org/settings/keys
- - ZOTEROUSERID:您的 Zotero 用户 ID(在个人资料 URL 中查找)
- ZOTEROAPIKEY:您的 Zotero API 密钥
- WEBDAV_*:仅在使用 WebDAV 存储时需要
1. 搜索文档
使用 scripts/search.sh 按关键词在库中查找项目。
使用方法
bash
确保脚本可执行
chmod +x scripts/search.sh
运行搜索
ZOTERO
USERID=
\
ZOTEROAPIKEY= \
bash scripts/search.sh 您的搜索查询
脚本会输出匹配项目的格式化列表,包含其 Key,用于阅读。
2. 阅读文档
选项 A:通用阅读器(推荐)
使用 scripts/read_universal.sh 从任一存储模式阅读文档。
使用方法
bash
chmod +x scripts/read_universal.sh
对于 Zotero 云存储:
ZOTEROUSERID= \
ZOTEROAPIKEY= \
bash scripts/readuniversal.sh ITEMKEY
对于 WebDAV 存储(添加 WebDAV 变量):
ZOTEROUSERID= \
ZOTEROAPIKEY= \
WEBDAV_URL= \
WEBDAV_USER= \
WEBDAV_PASS= \
bash scripts/readuniversal.sh ITEMKEY
选项 B:仅 WebDAV 阅读器
使用 scripts/read.sh 仅用于 WebDAV 存储(旧版)。
3. 管理笔记
本技能现在支持在您的 Zotero 库中创建、阅读、更新和删除笔记。笔记可以是独立的,也可以附加到父项目(文档)上。
创建笔记
使用 scripts/create_note.sh 创建包含纯文本内容的新笔记。
使用方法
bash
chmod +x scripts/create_note.sh
创建独立笔记:
ZOTEROUSERID= \
ZOTEROAPIKEY= \
bash scripts/create_note.sh 我重要的研究笔记
创建附加到文档的笔记:
bash scripts/createnote.sh --parent ITEMKEY 关于这篇论文的会议记录
创建带标签的笔记:
bash scripts/create_note.sh --tag research --tag to-read 跟进这篇论文
选项
- - --parent KEY:将笔记附加到父项目(文档键)
- --tag TAG:添加标签(可多次使用)
- --dry-run:显示步骤但不创建笔记
脚本会自动将纯文本转换为 HTML 以存储在 Zotero 中。
阅读笔记
使用 scripts/read_note.sh 阅读笔记并将 HTML 转换回纯文本。
使用方法
bash
chmod +x scripts/read_note.sh
以纯文本阅读(默认):
ZOTEROUSERID= \
ZOTEROAPIKEY= \
bash scripts/readnote.sh NOTEKEY
以 HTML 阅读:
bash scripts/readnote.sh --format html NOTEKEY
以 JSON 阅读(完整项目数据):
bash scripts/readnote.sh --format json NOTEKEY
输出格式
- - plain(默认):人类可读的纯文本
- html:原始 HTML 内容
- json:完整的 JSON 项目数据
更新笔记
使用 scripts/update_note.sh 用新内容或标签更新现有笔记。
使用方法
bash
chmod +x scripts/update_note.sh
替换笔记内容:
echo 新内容 | \
ZOTEROUSERID= \
ZOTEROAPIKEY= \
bash scripts/updatenote.sh --replace NOTEKEY
追加到现有内容:
echo 附加笔记 | \
bash scripts/updatenote.sh --append NOTEKEY
添加标签:
bash scripts/updatenote.sh --tag important --tag to-read NOTEKEY
移除标签:
bash scripts/updatenote.sh --remove-tag obsolete NOTEKEY
选项
- - --replace:替换笔记内容(默认)
- --append:将新内容追加到现有笔记
- --tag TAG:添加标签(可多次使用)
- --remove-tag TAG:移除标签(可多次使用)
- --dry-run:显示步骤但不更新
脚本包含版本检查以防止更新冲突。
删除笔记
使用 scripts/delete_note.sh 安全删除笔记,带有确认和备份选项。
使用方法
bash
chmod +x scripts/delete_note.sh
带确认删除:
ZOTEROUSERID= \
ZOTEROAPIKEY= \
bash scripts/deletenote.sh NOTEKEY
不带确认删除(谨慎使用):
bash scripts/deletenote.sh --no-confirm NOTEKEY
删除前备份:
bash scripts/deletenote.sh --backup NOTEKEY
预览删除操作:
bash scripts/deletenote.sh --dry-run NOTEKEY
安全特性
- - 确认提示:除非使用 --no-confirm,否则需要手动确认
- 备份选项:删除前将笔记内容保存到 ~/.zotero-backup/
- 版本检查:如果笔记被其他进程修改,则阻止删除
- 预览模式:预览删除操作而不实际删除
4. 添加新文档
选项 A:带元数据获取的通用上传(推荐)
使用 scripts/addtozotero_universal.sh 进行完整的元数据获取和灵活存储。
特性
- - 自动元数据:提取 DOI/arXiv ID,从 Crossref/arXiv API 获取元数据
- 灵活存储:同时适用于 Zotero 云存储和 WebDAV 存储
- 智能检测:如果未找到元数据,则回退到标题提取
- 预览模式:使用 --dry-run 查看将上传的内容而不实际更改
使用方法
bash
chmod +x scripts/addtozotero_universal.sh
Zotero 云存储(无需 WebDAV):
ZOTEROUSERID= \
ZOTEROAPIKEY= \
bash scripts/addtozotero_universal.sh /path/to/paper.pdf
WebDAV 存储:
ZOTEROUSERID= \
ZOTEROAPIKEY= \
WEBDAV_URL= \
WEBDAV_USER= \
WEBDAV_PASS= \
bash scripts/addtozotero_universal.sh /path/to/paper.pdf
示例:添加带 DOI 的论文
通用脚本将:
- 1. 从 PDF 中提取 DOI 10.1126/science.aec8352
- 查询 Crossref API 获取元数据(作者、期刊、日期、摘要等)
- 创建带有完整元数据的 Zotero 项目
- 通过 Zotero API(云存储)或 WebDAV(如果配置)上传 PDF
选项 B:增强上传(灵活存储)
使用 scripts/addtozotero_enhanced.sh 进行带元数据获取的灵活存储。支持 Zotero 云存储和 WebDAV 存储。
选项 C:基础上传(灵活存储)
使用 scripts/addtozotero.sh 进行仅提取标题的