Examples

Set title containing an apostrophe. Commands passed to kid3-cli with -c have to be in quotes if they do not only consist of a single word. If such a command itself has an argument containing spaces, that argument has to be quoted too. In UNIX® shells single or double quotes can be used, but on the Windows Command Prompt, it is important that the outer quoting is done using double quotes and inside these quotes, single quotes are used. If the text inside the single quotes contains a single quote, it has to be escaped using a backslash character, as shown in the following example:

kid3-cli -c "set title 'I\'ll be there for you'" /path/to/folder

Set album cover in all files of a folder using the batch import function:

kid3-cli -c "autoimport 'Cover Art'" /path/to/folder

Remove comment frames and apply the tag format in both tags of all MP3 files of a folder:

kid3-cli -c "set comment '' 1" -c "set comment '' 2" \
-c "tagformat 1" -c "tagformat 2" /path/to/folder/*.mp3

Automatically import tag 2, synchronize to tag 1, set file names from tag 2 and finally create a playlist:

kid3-cli -c autoimport -c "syncto 1" -c fromtag -c playlist \
  /path/to/folder/*.mp3

For all files with an ID3v2.4.0 tag, convert to ID3v2.3.0 and remove the arranger frame:

kid3-cli -c "filter 'ID3v2.4.0 Tag'" -c "select all" -c to23 \
  -c "set arranger ''" /path/to/folder

This Python script uses kid3-cli to generate iTunes Sound Check iTunNORM frames from replay gain information.


#!/usr/bin/env python3
# Generate iTunes Sound Check from ReplayGain.
import os, sys, subprocess

def rg2sc(dirpath):
  for root, dirs, files in os.walk(dirpath):
    for name in files:
      if name.endswith(('.mp3', '.m4a', '.aiff', '.aif')):
        fn = os.path.join(root, name)
        rg = subprocess.check_output([
          'kid3-cli', '-c', 'get "replaygain_track_gain"',
           fn]).strip()
        if rg.endswith(b' dB'):
          rg = rg[:-3]
        try:
          rg = float(rg)
        except ValueError:
          print('Value %s of %s in not a float' % (rg, fn))
          continue
        sc = (' ' + ('%08X' % int((10 ** (-rg / 10)) * 1000) )) * 10
        subprocess.call([
          'kid3-cli', '-c', 'set iTunNORM "%s"' % sc, fn])

if __name__ == '__main__':
  rg2sc(sys.argv[1])