mit einem Klick
logseq-zotero-sync
Sync Logseq pages tagged with
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Menü
Sync Logseq pages tagged with
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Basierend auf der SOC-Berufsklassifikation
| name | logseq-zotero-sync |
| version | 1.1.0 |
| description | Sync Logseq pages tagged with |
Automatically synchronize Logseq literature notes with Zotero by tagging referenced items with in_logseq.
Use this skill when the user wants to:
in_logseq tag for new literature notesKeywords: logseq, zotero, sync, tagging, literature notes, bibliography, knowledge management
This skill syncs Logseq pages tagged with #zotero to Zotero by:
in_logseqin_logseq tag to items that don't have itKey Feature: Idempotent batch processing - safe to run repeatedly, only tags what's needed.
logseq CLI on your PATH (ships with current Logseq.app; no npm install needed)pip3 install pyzotero keyring
Shares credentials with zotero-tag-automation skill via macOS Keychain (service: zotero-tag-automation).
If credentials aren't set up yet (or Zotero returns 403 Invalid key), run the
included setup script. It stores the Library ID and API key in the Keychain and
verifies the key against Zotero (warning if it lacks write access):
python setup_credentials.py
cd /Users/niyaro/Documents/Code/logseq-zotero-sync
python sync_logseq_to_zotero.py
Auto-detects the most recent Logseq DB graph.
python sync_logseq_to_zotero.py "2025-10-26 Logseq DB"
Instead of checking each item individually, this script:
in_logseq tag in one queryThis is much more efficient than checking each item one-by-one, especially as the library grows.
The script uses the Logseq.app-bundled CLI with these commands:
logseq graph list --output jsonlogseq query --graph "NAME" --query 'EDN' --output jsonThe CLI always exits 0 (even on error), so the script checks the JSON status field (must equal "ok"). A harmless Electron codesign line is printed to stderr on every call — the script ignores stderr entirely and only parses stdout.
The datalog query used:
[:find (pull ?b [:block/title {:user.property/ZoteroURL-om1JHnZv [:block/title]}])
:where [?b :user.property/ZoteroURL-om1JHnZv]]
This finds all pages/blocks with the Zotero URL property and extracts the URLs.
Zotero URLs have the format:
zotero://select/library/items/M2QGSQA9
The script extracts the item key (M2QGSQA9) using regex pattern matching.
Uses pyzotero to:
zot.items(tag='in_logseq')zot.item(item_key)zot.update_item(item)When the user asks to sync Logseq to Zotero or tag items in Zotero based on Logseq:
User: "Tag all my Logseq literature notes in Zotero"
Claude:
1. Checks if credentials are set up
2. Lists available Logseq graphs
3. Asks user to confirm graph name
4. Runs: python sync_logseq_to_zotero.py "GraphName"
5. Shows summary of tagged items
The script is idempotent - running it multiple times has no negative effects:
==============================================================
Logseq to Zotero Sync
==============================================================
Querying Logseq graph: 2025-10-26 Logseq DB
Found 14 items in Logseq with Zotero URLs
Querying Zotero for items with 'in_logseq' tag...
Found 10 items already tagged with 'in_logseq'
Found 4 items that need tagging:
- AA8CFB7Y
- DUF7Q2B6
- M2QGSQA9
- ZTSWUK3C
Tagging 4 items with 'in_logseq'...
[1/4] ✓ AA8CFB7Y: Here we are together
[2/4] ✓ DUF7Q2B6: Reflections on Orthography
[3/4] ✓ M2QGSQA9: Taiwan Archaeology
[4/4] ✓ ZTSWUK3C: Who owns "the culture"
==============================================================
Summary:
Successful: 4/4
Failed: 0/4
Tag: in_logseq
==============================================================
Problem: Logseq CLI can't find the graph Solutions:
logseq graph list --output json to see available graphs403 Invalid keyProblem: No credentials in Keychain, or the stored API key was revoked/regenerated (Zotero returns 403 Invalid key)
Solution: Run the setup script to store or replace the credentials (it also verifies the key against Zotero):
python setup_credentials.py
Problem: Logseq Desktop app not installed or logseq CLI not on PATH
Solution:
logseq CLI ships with current Logseq.applogseq --versionProblem: Query returns 0 items but user says items exist Possible causes:
/Users/niyaro/Documents/Code/logseq-zotero-sync/
├── sync_logseq_to_zotero.py # Main script
├── requirements.txt # Python dependencies
├── README.md # User documentation
├── SKILL.md # This file (skill documentation)
└── .gitignore # Git ignore rules
in_logseq tag in Zotero to see which items are in knowledge basePotential improvements: