taggr
is a C++ command-line tool for editing and managing metadata tags in audio files.
It supports FLAC, MP3, Ogg, WavPack, and more via the excellent TagLib library.
With taggr
, you can:
- Show, set, or remove metadata tags
- Import or export tags based on filename patterns
- Work with cover art and other binary tags
- Batch-edit files using globs and folders
You’ll need these libraries:
# Clone taggr source code
git clone https://github.com/balinbob/taggr.git
cd taggr
# Install dependencies via vcpkg
vcpkg install taglib cli11
# Build with CMake (MSVC)
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config Release
# Resulting binary: build/taggr.exe
Replace the path to
vcpkg
if installed elsewhere.
taggr [OPTIONS] files...
Name | Description |
---|---|
files |
File paths or globs (Required) |
Option | Description |
---|---|
-h , --help |
Print help message and exit |
--recurse |
Recurse into subdirectories |
-v , --verbose |
Verbose mode (more output) |
-q , --quiet |
Quiet mode (no filenames) |
-n , --noact |
No action (dry run only) |
-l , --list |
List all available tags |
--clear |
Clear all tags |
-s , --show TEXT ... |
Show specific tag(s) Ex: --show genre |
-t , --tag TEXT ... |
Set tag(s) as key="value" Ex: -t title="Come Together" |
-a , --add TEXT ... |
Add value to multi-value tag Ex: -a genre="rock" |
-r , --remove TEXT ... |
Remove tag or tag value Ex: --remove genre="pop" |
-b , --binary TEXT ... |
Set binary tag (e.g., cover art) Ex: --binary frontcover="cover.jpg" |
--fn2tag TEXT |
Extract tags from filename pattern Ex: --fn2tag "%l\%n %t.flac" |
--tag2fn TEXT |
Rename file using tag pattern Ex: --tag2fn "%l\%n %t.flac" |
Code | Tag Field |
---|---|
%l |
Album |
%n |
Track Number |
%t |
Title |
%a |
Artist |
%c |
Composer ! |
%D |
Discnumber |
Given a filename:
Abbey Road\01 Come Together.flac
You can extract tags with:
taggr "Abbey Road\01 Come Together.flac" --fn2tag "%l\%n %t.flac"
Result:
album
= Abbey Roadtracknumber
= 01title
= Come Together
Given these tags:
- Album:
Abbey Road
- Track Number:
01
- Title:
Come Together
You can rename the file like this:
taggr song.flac --tag2fn "%l\%n %t.flac"
Resulting filename:
Abbey Road\01 Come Together.flac
# Show all tags in a file
taggr song.flac --list
# Show only title and artist
taggr song.flac --show title artist
# Set tags explicitly
taggr song.flac -t title="Come Together" -t album="Abbey Road"
# Add genres (multi-value)
taggr song.flac -a genre="rock" -a genre="classic rock"
# Remove one genre and the comment tag
taggr song.flac -r genre="pop" -r comment
# Extract tags from a structured filename
taggr "01 Come Together.flac" --fn2tag "%n %t.flac"
# Rename a file using its tags
taggr song.flac --tag2fn "%n %t.flac"
-
CLI11
: A powerful and easy-to-use C++ command-line parser used to define options like--tag
or--fn2tag
. -
glob.hpp
: A simple C++17 header-only globbing library that lets you use*.flac
or**/*.mp3
patterns to match files on Windows.
These are included with the taggr
source or installed via vcpkg
.
- TagLib — audio tag reading/writing engine
- CLI11 — command-line parser
- glob.hpp — file pattern matching
This project is licensed under the MIT License.
MIT License
Copyright (c) 2025 balinbob
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
...
- Thanks to the TagLib community for their stable and high-quality library.
- CLI parsing by CLI11.
- Globbing powered by glob.hpp.
Author: balinbob