tagutil(1)
is a CLI tool to edit music file's tag. It aims to provide both an
easy-to-script interface and ease of use interactively. Unlike most other tag
tools out there, it fully support Vorbis Comments for both ogg/vorbis files
and FLAC. Vorbis Comments are sexy, because you can set tags with any
key/value without much restrictions (you can even have more than one value for
a key).
Optionals dependencies are detected by cmake. If you want to override the
detection you can define WITHOUT_$LIB
to avoid tagutil to link against
$LIB
.
type make
, it'll create the build/ directory and call cmake and make to
configure and build tagutil. Or if you want to gives some arguments to
cmake do (for example):
mkdir build && cd build
cmake -DWITHOUT_TAGLIB=yes ../src
make
build tagutil, then cd build && make install
. You might need root access
to call make install
.
A package is provided in the
AUR. Use your favorite AUR
helper
to install it or download the AUR tarball and run makepkg -si
to build and
install the package.
Use the print action. Since it is the default action, you can omit it from the command line:
% tagutil fearless.flac
# fearless.flac
---
- album: Meddle
- artist: Pink Floyd
- date: 1971
- title: Fearless
- tracknumber: 03
- genre: Progressive Rock
There are commands for basic editing stuff like clear, add and set.
If you need to do something more complex, the edit action let you use your
favourite $EDITOR
.
One powerful feature of tagutil is the rename action. It rename the
music files after inferring the new name from a rename pattern. In the rename
pattern, %{name}
is replaced by the name
tag. You can also use the simpler
form %name
if the tag is only composed of alphanumeric characters. Example:
% tagutil -p rename:"[%date] %artist/%tracknumber - %title" fearless.flac
rename `fearless.flac' to `[1971] Pink Floyd/03 - Fearless.flac'? [y/n]
tagutil can easily be scripted. Basic scripts can use the editing actions while more complex scripts can use print, parse the output, do some modifications and then use load. There are two examples in the scripts/ directory:
01
for the first file, 02
for the
second and so on. Useful to set the track number of an album.% tagutil -h
tagutil v3.0
usage: tagutil [OPTION]... [ACTION:ARG]... [FILE]...
Modify or display music file's tag.
Options:
-h show this help
-p create destination directories if needed (used by rename)
-F fmt use the fmt format for print, edit and load actions (see Formats)
-Y answer yes to all questions
-N answer no to all questions
Actions:
print print tags (default action)
backend print the backend used (see Backend)
clear:TAG clear all tag TAG. If TAG is empty, all tags are cleared
add:TAG=VALUE add a TAG=VALUE pair
set:TAG=VALUE set TAG to VALUE
edit prompt for editing
load:PATH load PATH yaml tag file
rename:PATTERN rename to PATTERN
Formats:
yml: YAML - YAML Ain't Markup Language
json: JSON - JavaScript Object Notation
Backends:
libFLAC: Free Lossless Audio Codec (FLAC) files format
libvorbis: Ogg/Vorbis files format
TagLib: various file format but limited set of tags
% gem install bundler
% make test
It is a BSD 2-Clause license, see LICENSE.