A precision CLI tool for organizing and normalizing local music libraries
Built by AI agents for AI agents, perfect for humans π€ β π€
| Feature | Description |
|---|---|
| π | Recursive directory scanning |
| π·οΈ | Metadata extraction (FLAC, MP3, WAV, OGG, M4A, DSF, WavPack) |
| π | Artist β Album β Track inference |
| π€ | Title and genre normalization |
| π³ | Tree visualization |
| π | Duplicate detection (SHA256) |
| π | Structured output for AI/MCP |
| π | CUE file operations |
| π | Progress output with --verbose |
| β | Metadata schema validation |
# Install music-chore CLI
curl -fsSL https://github.com/Komdosh/music-chore/releases/latest/download/install.sh | bash
# Install MCP server for AI agents
curl -fsSL https://github.com/Komdosh/music-chore/releases/latest/download/install_mcp.sh | bash# Scan your music library
musicctl scan /path/to/your/music
# View the structure
musicctl tree /path/to/your/music
# Check metadata quality
musicctl validate /path/to/your/music| Command | Description | Example |
|---|---|---|
scan |
Discover music files | musicctl scan ~/Music |
scan --verbose |
Discover with progress output | musicctl scan ~/Music --verbose |
tree |
Visual library view | musicctl tree ~/Music |
read |
Extract file metadata | musicctl read track.flac |
write |
Update metadata | musicctl write track.flac --title "New Title" |
normalize |
Title and genre normalization | musicctl normalize ~/Music |
validate |
Check metadata quality | musicctl validate ~/Music |
duplicates |
Find duplicate files | musicctl duplicates ~/Music |
emit |
Export structured metadata | musicctl emit ~/Music --json |
# Generate CUE sheet from album
musicctl cue --generate /path/to/album
# Parse existing CUE file
musicctl cue --parse /path/to/album.cue
# Validate CUE against audio files
musicctl cue --validate /path/to/album.cueBy default, operations that modify files (like normalize and write) run in dry-run mode. They will show you what would happen without making any changes.
# Preview normalization (dry run)
musicctl normalize ~/Music
# Apply changes (actual modification)
musicctl normalize ~/Music --apply# Normalize an entire library (outputs reports, no file modification)
musicctl normalize ~/Music
# Validate a specific album and get JSON output
musicctl validate ~/Music/Artist/Album --json
# Emit library metadata in JSON format
musicctl emit ~/Music --json > library_metadata.json
# Find duplicates in a specific directory
musicctl duplicates ~/Music/Compilations-
Permission errors: Ensure you have read/write permissions for the directories and files you're working with.
-
Unsupported format errors: The tool only supports FLAC, MP3, WAV, OGG, M4A, DSF, and WavPack formats. Convert unsupported files to a supported format first.
-
Metadata not updating: Remember to use the
--applyflag when writing metadata; by default, operations are dry runs. -
DSF/WavPack reading issues: Some test files may not contain proper audio data. If you encounter issues with these formats, ensure your files are valid DSF or WavPack files with proper headers.
Use the --verbose flag with commands to get more detailed output and debugging information.
AI agents can integrate directly with music-chore via MCP (Model Context Protocol).
# Add to Claude Desktop
claude mcp add -e MUSIC_LIBRARY_PATH="/path/to/music" music-chore -- musicctl-mcp
# Add to Gemini CLI
gemini mcp add -e MUSIC_LIBRARY_PATH="/path/to/music" music-chore musicctl-mcp
# Add to Qwen
qwen mcp add music-chore musicctl-mcp -e MUSIC_LIBRARY_PATH="/path/to/music"Configure the MCP server with environment variables:
# Logging level (error, warn, info, debug, trace)
export RUST_LOG=info
# Default library path
export MUSIC_LIBRARY_PATH=/Users/username/Music
# Scan timeout in seconds
export MUSIC_SCAN_TIMEOUT=300
# Security: restrict access to specific paths
export MUSIC_ALLOWED_PATHS=/Users/username/Music,/Volumes/Music
# Run with configuration
musicctl-mcpKey Variables:
RUST_LOG: Control logging verbosityMUSIC_LIBRARY_PATH: Default music directoryMUSIC_SCAN_TIMEOUT: Directory scan timeout (default: 300s)MUSIC_ALLOWED_PATHS: Comma-separated allowed paths for security
| Tool | Purpose |
|---|---|
scan_directory |
Discover music files recursively |
get_library_tree |
Get hierarchical library view |
read_file_metadata |
Extract metadata from audio files |
normalize |
Normalize titles and genres |
emit_library_metadata |
Full library export (JSON) |
validate_library |
Check metadata completeness |
find_duplicates |
Detect duplicate files |
cue_file |
Generate/parse/validate CUE sheets |
The MCP server provides a compact, high-value prompt set:
- Listening:
listen-now - Web Discovery:
web-perfect-match - Maintenance:
library-health-check,metadata-cleanup-guide,duplicate-resolution,cue-sheet-assistant
music-chore/
βββ src/
β βββ core/ # Business logic & domain entities
β β βββ domain/ # Core models (Artist, Album, Track)
β β βββ services/ # Operation implementations
β β βββ logging.rs # Centralized logging
β βββ adapters/ # Audio format handlers (AudioFile trait)
β βββ presentation/ # CLI parser and commands
β βββ mcp/ # MCP server & expert AI prompts
βββ tests/
β βββ fixtures/ # Test audio files
β βββ integration/ # Integration tests
βββ Cargo.toml
Extensible Design: Add new audio formats by implementing the AudioFile trait in src/adapters/audio_formats/.
# Build the project
cargo build
# Build release version
cargo build --release
# Run all tests (640+ tests)
cargo test
# Run specific test
cargo test test_name
# Check code without building
cargo check
# Format code
cargo fmt
# Run linter
cargo clippy| Format | Read | Write |
|---|---|---|
| FLAC | β | β |
| MP3 | β | β |
| WAV | β | β |
| OGG | β | β |
| DSF | β | β |
| WavPack | β | β |
| M4A | β | β |
Maps 40+ genre variants to standards:
| Input | Output |
|---|---|
"rock and roll" |
"Rock" |
"hip hop" |
"Hip-Hop" |
"smooth jazz" |
"Jazz" |
"electronic dance music" |
"Electronic" |
"r&b" |
"R&B" |
Made with β€οΈ for music lovers and AI agents
β Star us on GitHub | π Report issues | π‘ Feature requests