CLI tool to scan and catalog your movie library
npm install movie-librarianCLI tool to scan directories for video files, identify movies and TV shows via TMDb, and output a CSV catalog.
- Go to nodejs.org
- Download the LTS version
- Run the installer
1. Create a free account at themoviedb.org
2. Go to Settings ā API
3. Request an API key (choose "Developer" option)
4. Copy your API key
Only needed if you want AI fallback for hard-to-identify files.
1. Go to platform.openai.com
2. Create an account and add billing
3. Go to API Keys and create a new key
4. Set a usage limit (e.g., $5/month) in Settings ā Limits
``bash`
npx movie-librarian
The tool will prompt you for your API keys on first run and save them to ~/.movie-librarian/config.json.
`
š¬ 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.csv
`
1. Pattern matching - regex extracts title, year, season/episode from filenames
2. TMDb lookup - verifies and enriches metadata
3. Progressive search - tries shorter title fragments if no match
4. AI fallback (optional) - uses GPT to parse difficult filenames
.mkv, .mp4, .avi, .mov, .m4v, .wmv
| Column | Description |
|--------|-------------|
| title | Movie/show name |
| type | movie or tv |verified
| 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 | , unverified, unidentified |
Config is stored in ~/.movie-librarian/config.json:
`json``
{
"tmdbApiKey": "your-tmdb-api-key",
"openaiApiKey": "your-openai-api-key"
}
This product uses the TMDb API but is not endorsed or certified by TMDb.

MIT