Download Gravatar avatar images to local files. Use when the user wants to save Gravatar images, download profile pictures, or create local avatar caches.
Download Gravatar avatar images to local files.
npx tsx scripts/download.ts <email> <output-file> [options]
| Argument | Required | Description |
|---|---|---|
email |
Yes | Email address |
output-file |
Yes | Path where image will be saved |
| Option | Description |
|---|---|
--size=N |
Image size in pixels (default: 200, max: 2048) |
--default=TYPE |
Default image type: mp, identicon, monsterid, wavatar, retro, robohash, blank |
--rating=LEVEL |
Rating level: g, pg, r, x (default: g) |
--no-cache |
Bypass cache and fetch fresh data |
Email: user@example.com
Output: avatar.jpg
Hash: b48bf4373d7b7374351c0544f36f7fc3
ā Downloaded successfully
Size: 12.4 KB
File: avatar.jpg
npx tsx scripts/download.ts <email> <output-file> [options]
Options:
--size=N - Image size in pixels (default: 200, max: 2048)--default=TYPE - Default image type: mp, identicon, monsterid, wavatar, retro, robohash, blank--rating=LEVEL - Rating level: g, pg, r, x (default: g)--no-cache - Bypass cache and fetch fresh dataRun from the gravatar plugin directory: ~/.claude/plugins/cache/gravatar/
Basic download (200px PNG):
npx tsx scripts/download.ts user@example.com avatar.png
Large avatar (800px):
npx tsx scripts/download.ts user@example.com large-avatar.jpg --size=800
Download with fallback to identicon:
npx tsx scripts/download.ts newuser@example.com avatar.png --default=identicon
Force fresh download:
npx tsx scripts/download.ts user@example.com avatar.png --no-cache
| Size | Use Case | File Size (approx) |
|---|---|---|
| 80 | Small thumbnails | 2-4 KB |
| 200 | Profile avatars (default) | 8-15 KB |
| 400 | Large profile images | 20-35 KB |
| 800 | High-resolution displays | 50-90 KB |
| 2048 | Maximum quality | 200-400 KB |
When no Gravatar exists, these defaults are used:
| Type | Description |
|---|---|
mp |
Mystery Person (simple silhouette) |
identicon |
Geometric pattern based on email hash |
monsterid |
Unique monster generated from email |
wavatar |
Unique face generated from email |
retro |
8-bit arcade-style face |
robohash |
Unique robot generated from email |
blank |
Transparent PNG |
Download avatars for all team members:
for email in dev1@company.com dev2@company.com dev3@company.com; do
npx tsx scripts/download.ts "$email" "avatars/${email}.png" --size=400
done
Save user avatars locally:
npx tsx scripts/download.ts maintainer@project.org backup/maintainer.jpg --size=800
Create consistent default avatars:
npx tsx scripts/download.ts user1@example.com user1.png --default=identicon
npx tsx scripts/download.ts user2@example.com user2.png --default=identicon
Download retina-ready images:
npx tsx scripts/download.ts user@example.com avatar@2x.png --size=400
Downloaded images are cached for 24 hours:
--no-cache = fresh downloadThis reduces API calls and bandwidth usage.
The script will fail if:
Error messages indicate the specific failure for troubleshooting.
Gravatar serves images in these formats:
The file extension in the output path determines the format saved.
gravatar-check skill to verify Gravatar exists before downloadinggravatar-url skill to generate URLs for web display