Set up Zotero Assistant credentials and verify the connection. Use when the user wants to configure Zotero access, fix credential issues, or when any zotero skill fails with a missing env var or HTTP 403 error. Triggers on: "set up zotero", "configure zotero", "zotero-setup", "fix zotero credentials", "my zotero key isn't working".
Walk the user through setting up credentials for the Zotero Assistant skills.
Run these checks in parallel:
# Check if env file exists and has both keys
test -f ~/.config/zotero-assistant/env && echo "env file exists" || echo "no env file"
# Check file permissions (should be 600)
stat -f "%Lp" ~/.config/zotero-assistant/env 2>/dev/null || echo "n/a"
# Check which keys are present (without revealing values)
awk -F= '/^[^#]/ && /=/ {print $1}' ~/.config/zotero-assistant/env 2>/dev/null || echo "no file"
# Check if uv is installed
command -v uv && uv --version || echo "uv not found"
Report what's missing before proceeding.
If uv is not found:
curl -LsSf https://astral.sh/uv/install.sh | sh
If the file doesn't exist or is incomplete, tell the user:
You need two values from https://www.zotero.org/settings/keys:
- API key — click "Create new private key", enable "Allow library access" (read is enough), save
- User ID — shown at the top of the page as "Your userID for use in API calls is ..."
Paste them here and I'll create the file for you. Or create it yourself:
mkdir -p ~/.config/zotero-assistant cat > ~/.config/zotero-assistant/env << 'EOF' ZOTERO_API_KEY=your_key ZOTERO_USER_ID=your_id EOF chmod 600 ~/.config/zotero-assistant/env
If the user pastes the values, create the file:
mkdir -p ~/.config/zotero-assistant
cat > ~/.config/zotero-assistant/env << 'EOF'
ZOTERO_API_KEY=<key>
ZOTERO_USER_ID=<id>
EOF
chmod 600 ~/.config/zotero-assistant/env
Important: replace <key> and <id> with the actual values. Never echo the values back to the user after writing the file.
If the file exists but permissions are not 600:
chmod 600 ~/.config/zotero-assistant/env
Run a test search to confirm everything works:
uv run ~/.claude/skills/zotero-find/scripts/zotero_find.py --recent 3
If this returns JSON with items, setup is complete. Report success with the number of items in the library.
If it fails:
uv not found: go back to Step 2ls ~/.claude/skills/zotero-find/SKILL.md ~/.claude/skills/zotero-read/SKILL.md ~/.claude/skills/zotero-compare/SKILL.md 2>&1
If any are missing, tell the user to install:
npx skills add philipnickel/zotero-assistant -g -a claude-code -y