A Rust CLI tool for managing Flickr photo libraries — duplicate detection (metadata, fuzzy, and AI-based), bulk sync, and OAuth authentication.
# Build
cargo build --release
# Set up Flickr API credentials (https://www.flickr.com/services/apps/create/)
export FLICKR_API_KEY="your_key"
export FLICKR_API_SECRET="your_secret"
# Authenticate (opens browser for OAuth 1.0a flow)
flickr-cli auth
# Scan for duplicate photos by title/filename
flickr-cli scan
# AI-based duplicate detection on local images
flickr-cli ai-dedupe --directory ~/PhotosAuthenticate with Flickr via OAuth 1.0a. Opens a browser for authorization, then stores tokens in the system keychain (macOS Keychain, etc.) with file fallback at ~/.flickr_tokens.
flickr-cli authScan your Flickr library for duplicates by metadata fields.
# Default: group by title + filename
flickr-cli scan
# Custom fields
flickr-cli scan --by title,datetakenFields: title, filename, datetaken
Find near-duplicate photo titles using fuzzy string matching (RapidFuzz).
# Default threshold: 85%
flickr-cli fuzzy-scan
# Stricter matching
flickr-cli fuzzy-scan --threshold 95Download all Flickr photos to a local directory. Skips already-downloaded files.
flickr-cli sync-flickr --directory ~/flickr-backup
# Limit to first 500 photos
flickr-cli sync-flickr --directory ~/flickr-backup --max-images 500AI-based duplicate detection on local images using perceptual hashing or vision model embeddings.
# Auto-select best available method
flickr-cli ai-dedupe --directory ~/Photos
# Specific method + model
flickr-cli ai-dedupe --directory ~/Photos --method onnx --model siglip2-b16
# Lower threshold to catch more near-duplicates
flickr-cli ai-dedupe --directory ~/Photos --similarity-threshold 0.85 --max-images 1000Methods:
| Method | Feature | Description |
|---|---|---|
phash |
phash (default) |
Perceptual hashing (dHash) — fast, no model needed |
onnx |
onnx |
Vision model embeddings via ONNX Runtime |
coreml |
coreml |
ONNX with CoreML acceleration (macOS only) |
Vision models (for onnx/coreml):
| Model | Input | Embedding | Notes |
|---|---|---|---|
clip-vit-b32 |
224px | 512-dim | Original CLIP, fastest |
siglip2-b16 |
224px | 768-dim | Default. Best quality/speed ratio |
siglip2-so400m |
384px | 1152-dim | Highest quality, ~7GB RAM |
Compare deduplication methods on a set of images.
flickr-cli benchmark-methods --directory ~/Photos --num-images 20The dedupe-engine crate uses Cargo features to control which backends are compiled:
# Default (phash only — no external dependencies)
cargo build --release
# With ONNX Runtime support
cargo build --release --features dedupe-engine/onnx
# With auto-download from HuggingFace
cargo build --release --features dedupe-engine/download
# Everything
cargo build --release --features dedupe-engine/fullcrates/
flickr-cli/ Binary — CLI interface (clap), command dispatch
flickr-api/ Library — Flickr OAuth 1.0a + REST client
dedupe-engine/ Library — Image dedup (phash, ONNX, CoreML)
| Variable | Required | Description |
|---|---|---|
FLICKR_API_KEY |
Yes | Flickr API key (create one) |
FLICKR_API_SECRET |
Yes | Flickr API secret |
- Rust 1.75+
- Flickr API credentials
- macOS recommended (for Keychain token storage and CoreML support)
MIT