movie-librarian
v1.0.0
Published
CLI tool to scan and catalog your movie library
Maintainers
Readme
🎬 Movie Librarian
CLI tool to scan directories for video files, identify movies and TV shows via TMDb, and output a CSV catalog.
Quick Start
1. Install Node.js (if needed)
- Go to nodejs.org
- Download the LTS version
- Run the installer
2. Get a TMDb API Key (required)
- Create a free account at themoviedb.org
- Go to Settings → API
- Request an API key (choose "Developer" option)
- Copy your API key
3. Get an OpenAI API Key (optional)
Only needed if you want AI fallback for hard-to-identify files.
- Go to platform.openai.com
- Create an account and add billing
- Go to API Keys and create a new key
- Set a usage limit (e.g., $5/month) in Settings → Limits
4. Run the tool
npx movie-librarianThe tool will prompt you for your API keys on first run and save them to ~/.movie-librarian/config.json.
Usage
🎬 Welcome to Movie Librarian!
📁 Enter directories to scan (comma-separated):
> /Volumes/Movies, /Volumes/TV Shows
💾 Output filename [catalog.csv]:
> my-library.csv
🤖 Enable AI fallback for hard-to-identify files? (y/n):
> y
🔍 Scanning directories...
Found 2000 video files
📽️ Processing files...
✓ [1/2000] The Ballad of Wallis Island (2025)
✓ [2/2000] Afternoons of Solitude (2024)
✗ [3/2000] random_file.mp4
✨ Complete!
🎬 Movies: 1847
📺 TV Shows: 142
❓ Unidentified: 11
💾 Saved to my-library.csvHow It Works
- Pattern matching - regex extracts title, year, season/episode from filenames
- TMDb lookup - verifies and enriches metadata
- Progressive search - tries shorter title fragments if no match
- AI fallback (optional) - uses GPT to parse difficult filenames
Supported File Extensions
.mkv, .mp4, .avi, .mov, .m4v, .wmv
CSV Output
| Column | Description |
|--------|-------------|
| title | Movie/show name |
| type | movie or tv |
| year | Release year |
| director | Director name |
| runtime | Minutes |
| season | Season number (TV only) |
| episode | Episode number (TV only) |
| imdb_id | IMDB ID |
| imdb_url | Link to IMDB page |
| file_path | Full path to file |
| duplicate_group | ID linking duplicate files |
| status | verified, unverified, unidentified |
Configuration
Config is stored in ~/.movie-librarian/config.json:
{
"tmdbApiKey": "your-tmdb-api-key",
"openaiApiKey": "your-openai-api-key"
}Attribution
This product uses the TMDb API but is not endorsed or certified by TMDb.
License
MIT
