Introduction
Beets is a command-line music library manager that handles the tedious work of organizing, tagging, and cataloging music collections. It uses the MusicBrainz database for accurate metadata matching and provides a plugin architecture for tasks like fetching lyrics, generating playlists, and transcoding.
What Beets Does
- Automatically identifies and tags music files using MusicBrainz acoustic fingerprinting
- Organizes files into a consistent directory structure based on metadata templates
- Maintains a SQLite database of your music collection for fast querying
- Supports batch operations across thousands of albums with smart duplicate detection
- Fetches album art, lyrics, and genre information from multiple online sources
Architecture Overview
Beets is built as a Python application with a core import pipeline that matches audio files against the MusicBrainz database using a combination of tag-based and acoustic fingerprint matching. The library database is SQLite with a query language supporting regex, numeric ranges, and boolean logic. Plugins hook into well-defined extension points (import stages, commands, template functions) without modifying core code.
Self-Hosting & Configuration
- Install via pip or your system package manager (available in most Linux distros)
- Configure in
~/.config/beets/config.yamlwith directory paths and plugin list - Set path templates like
$albumartist/$album%aunique{}/$track $titlefor file organization - Enable plugins by listing them in config:
plugins: fetchart lyrics lastgenre - Supports MusicBrainz rate limiting and custom server URLs for local MB instances
Key Features
- Acoustic fingerprinting via Chromaprint identifies tracks without relying on filenames
- Flexible query language supports regex, date ranges, and field comparisons
- Path templates with functions allow complex naming rules without scripting
- Web plugin provides a JSON API and simple web interface for library browsing
- ReplayGain plugin calculates loudness normalization values for consistent playback
Comparison with Similar Tools
- MusicBrainz Picard — GUI-based tagger; Beets is CLI-first with better automation for large libraries
- Mp3tag — Windows GUI editor; Beets is cross-platform and scriptable
- Lidarr — focused on automated downloading; Beets excels at organizing existing collections
- Navidrome/Jellyfin — media servers; Beets handles the library management layer beneath them
FAQ
Q: Does Beets modify my original files?
A: By default it writes corrected tags and can move/copy files. Use copy: yes to preserve originals.
Q: How accurate is the auto-tagging? A: Very accurate for well-known releases. The interactive importer lets you confirm or override matches.
Q: Can Beets handle 100,000+ tracks? A: Yes, the SQLite backend handles large libraries efficiently. Import speed is mainly network-bound.
Q: Does it support FLAC, MP3, and other formats? A: Yes, via Mutagen it supports MP3, FLAC, OGG, AAC, WMA, AIFF, and more.