Skip to content

Latest commit

 

History

History
85 lines (61 loc) · 2.42 KB

README.md

File metadata and controls

85 lines (61 loc) · 2.42 KB

Zotero Fetch

A utility to work with a local instance of zotero, using it as a persistent archival store.

Supports search by title and tags, a simple markdown-esque file-reference output, and opening snapshots.

A lot of this code was generated by claude 3.5.

Tested with Zotero 7.0.10 on macOS.

Prerequisites

  1. Install Zotero
  2. Configure Zotero for local storage:
    • Open Zotero → Preferences → Advanced → Files and Folders
    • Note down your "Data Directory Location"

Installation

# Clone the repository
git clone [repository-url]
cd zotero-fetch


# Configure paths in main.go
# Update these constants to match your Zotero data directory:
DBPath      = "/Users/username/data/zotero/zotero.sqlite"
StoragePath = "/Users/username/data/zotero/storage/"

# Build
go build;

# Execute
./store-zotero

Usage

# List all items (minimal output)
store-zotero

# List all items with details
store-zotero -v

# Search by title
store-zotero -f "collaboration"

# Search by tag
store-zotero -t "research"

# Combined verbose search (title AND tag)
store-zotero -f "do" -t "tag2" -v

# Open item attachment
store-zotero open <STABLEID>

# Generate reference
store-zotero reference <STABLEID>

Example Output

Verbose listing (-v):

23F7YCDG        What do you mean by "E...       tag1,tag2       /Users/username/data/zotero/storage/RJMBK2ND/201701-event-driven.html
NJYVSTNH        quick save guide                                /Users/username/data/zotero/storage/ATLTQ2LQ/quick_start_guide.html
J3YWYCQB        Building real-time col...       tag1,tag3       /Users/username/data/zotero/storage/RNC6Y89E/real-time-collaboration-ot-vs-crdt.html
VE7W9J39        save                                            /Users/username/data/zotero/storage/VE7W9J39/save.txt
NJGNJB8U        book-no-attachment

Verbose search (-v -t tag1):

23F7YCDG        What do you mean by "E...       tag1       /Users/username/data/zotero/storage/RJMBK2ND/201701-event-driven.html
J3YWYCQB        Building real-time col...       tag1      /Users/username/data/zotero/storage/RNC6Y89E/real-time-collaboration-ot-vs-crdt.html

Reference output (reference J3YWYCQB):

[zotero: Building real-time collaboration applications: OT vs CRDT, stableid: J3YWYCQB, tags: {tag1,tag3}, version: 1.0](/Users/username/data/zotero/storage/RNC6Y89E/real-time-collaboration-ot-vs-crdt.html)