Skip to content

Run

plyrix needs a local copy of LRCLIB that it can reach over HTTP. From a checkout, with your copied library at /srv/music:

Terminal window
uv sync
export PLYRIX_LRCLIB_URL=http://localhost:3300/api
uv run plyrix run /srv/music

LRCLIB has to hold a fully loaded dump. Before each run, plyrix checks that LRCLIB answers, that its search index is ready and that it holds tracks, and if not it stops with nothing recorded. It can’t tell a partly loaded database from a complete one, and every track missing from a partial one would count as a miss.

The run prints counts only. Add --verbose to print each track’s outcome and path as well, with anything outside printable ASCII escaped, so Björk prints as Bj\xf6rk. Paths are relative to the music root.

Add --dry-run to see what a run would do first. A dry run reads tags and asks LRCLIB as a real run does, changes nothing in the library or the state database, and prints what a real run would count. It stops with exit code 75 if another run is using the state database, and with exit code 2 if a killed run left that database mid-write, in which case do a normal run first.

Setting Flag or argument Variable In the config file Default
LRCLIB URL --lrclib-url PLYRIX_LRCLIB_URL lrclib_url none, required
Music root PATH argument PLYRIX_MUSIC_ROOT music_root none, required
Excludes --exclude, repeatable PLYRIX_EXCLUDES, as a JSON list excludes none
State database --state-db PLYRIX_STATE_DB state_db $XDG_STATE_HOME/plyrix/state.db
Loaded dump’s filename: the flag overrides the dump recorded live, the variable and file only stand in when none is --dump-id PLYRIX_DUMP_ID dump_id none
Plain-only lyrics --plain PLYRIX_PLAIN plain write
Print paths --verbose PLYRIX_VERBOSE verbose off
Dry run --dry-run PLYRIX_DRY_RUN dry_run off
Retry every earlier miss after a dump update --full PLYRIX_FULL full off
Load limit, in tracks per second --max-rate PLYRIX_MAX_RATE max_rate no limit
How sidecars are created --sidecar-method PLYRIX_SIDECAR_METHOD sidecar_method auto
JSON report --report PLYRIX_REPORT_FILE report_file none
Plex URL --plex-url PLYRIX_PLEX_URL plex_url none
Plex library section --plex-section PLYRIX_PLEX_SECTION plex_section none
Plex token none, on purpose PLYRIX_PLEX_TOKEN, or a secret file plyrix_plex_token plex_token none
Music root as Plex sees it --plex-music-root PLYRIX_PLEX_MUSIC_ROOT plex_music_root the music root
Pause between album refreshes, in seconds --plex-pace PLYRIX_PLEX_PACE plex_pace 1
Lidarr path map none PLYRIX_LIDARR_PATH_MAP, as a JSON list lidarr_path_map none
Lidarr spool folder none PLYRIX_LIDARR_SPOOL lidarr_spool lidarr-spool beside the state database
Lidarr hook time budget, in seconds none PLYRIX_LIDARR_BUDGET lidarr_budget 60

A flag beats a variable, a variable beats a secret file, and a secret file beats the config file. An unknown PLYRIX_ variable gets a warning, and a mistake in a setting stops the run with exit code 2.

  • LRCLIB URL: it has to be your own server. plyrix refuses lrclib.net and its subdomains, and never falls back to an online source. This is a check on the name, so it can’t see a DNS alias or an IP address for the public server.
  • Run path: with no music root configured, PATH becomes the root. With one configured, PATH has to be inside it and limits the run to that folder, so PLYRIX_MUSIC_ROOT=/srv/music uv run plyrix run /srv/music/Album runs one album. A PATH outside the root is refused. With a music root configured, --path DIR, repeatable, limits the run to those folders instead, for example uv run plyrix run --path /srv/music/A --path /srv/music/B. It can’t be combined with PATH, and a folder outside the root is refused.
  • Lidarr path map: only plyrix lidarr-hook uses it. Each entry is FROM=TO: a folder as Lidarr sees it, then the same folder as plyrix sees it, for example PLYRIX_LIDARR_PATH_MAP='["/music=/srv/music"]'. The longest matching FROM wins, matched on whole folder names, so /music doesn’t match /music2. Every TO has to be inside the music root.
  • Lidarr spool folder: where plyrix lidarr-hook queues an album it couldn’t finish, one file per album, for plyrix drain. It has to be outside the library, like the state database, and can’t be the state database’s folder or a folder above it, as Lidarr can write it.
  • Lidarr hook time budget: it bounds how long one Lidarr import waits on plyrix. Lidarr runs the hook inside its import and waits for it, so when the budget runs out the rest of the album is queued. It has to be a number above zero.
  • Excludes: patterns are relative to the music root and case-sensitive, for example PLYRIX_EXCLUDES='["Podcasts/*"]'. A pattern that matches a folder leaves out everything in it, and * also matches /. A pattern that could never match is refused: an empty one, or one with an absolute path or a ., .. or empty segment.
  • State database: it has to be outside the library, and a path inside it is refused. It belongs on a local fast disk, since a commit there cost about 96 ms on the tested ZFS pool.
  • Dump id: name the LRCLIB dump you loaded, ideally by its filename, up to 255 characters on one line. A track with no match, plain lyrics only or marked instrumental is then asked about again only when the dump, its tags or plyrix’s matching changes. With no id, plyrix can’t tell whether the dump changed, so it warns and asks about those tracks on every run.
  • Plain-only lyrics: write puts them in a .txt, and skip writes nothing and records the track, which comes due again when the setting goes back to write. A .lrc with no timestamps shows nothing in Plex, so plain text is never written as one.
  • Load limit: it caps the tracks per second that read tags or ask LRCLIB, for a run that shares a disk or a server, and 0.5 means one track every two seconds. A track with nothing to do costs no wait, so a re-run over a settled library stays fast. The limit covers tracks, not requests, as one track can make several requests to LRCLIB. It has to be above zero, and anything below 0.000001 is refused.
  • How sidecars are created: auto gives the finished file its name with a hard link, so the name never holds anything less than complete contents. plain makes no hard link: it holds the name with an empty file, then renames the finished file over it. Neither ever replaces a file already at the name. The known limit of plain is that a kill between those two steps leaves an empty .lrc or .txt until the next run, which removes it and writes the sidecar. A mount with no hard links takes this path anyway under auto, so choose plain only for a filesystem that misbehaves with them.
  • A .txt already there: one plyrix can’t prove it wrote stays as it is, and a synced match still writes the .lrc beside it. A plain match counts as blocked_foreign instead. A .txt plyrix did write is replaced by a .lrc once a synced version exists, as long as the file still matches what it wrote. One it only adopted, because its text equals LRCLIB’s, stays beside the .lrc.
  • Plex URL: it has to be your own Plex Media Server, for example http://localhost:32400, and only plyrix plex-refresh uses it. plyrix refuses plex.tv and its subdomains by name, and never follows a redirect, so the token can’t be carried to another host. A *.plex.direct address works, as it names your own server, but routers with DNS-rebinding protection often block plex.direct names, so use the server’s LAN address then.
  • Plex library section: the key of your music library in Plex, for example 1.
  • Plex token: it has no flag, because command-line arguments are visible in the process list. It comes from PLYRIX_PLEX_TOKEN, from a file named plyrix_plex_token in /run/secrets or in systemd’s credentials directory, or from the config file. An empty value counts as unset.
  • Music root as Plex sees it: set it when Plex sees the library under another path, such as inside a container. It has to be absolute.
  • JSON report: see Reading the counts. It has to be outside the library, and a path inside it is refused.
  • Relative paths: a path from a variable or the config file can start with ~ but must otherwise be absolute, so the same setting means the same place whichever folder plyrix runs from. Only PATH, --state-db and --report can be relative.
  • Config file: TOML, read from $XDG_CONFIG_HOME/plyrix/config.toml, or from the file you name with --config. TOML can’t hold a path that isn’t valid UTF-8, so give such a path through a variable or as PATH.
music_root = "/srv/music"
lrclib_url = "http://localhost:3300/api"
excludes = ["Podcasts/*"]

A run prints one name=value line per count. Neither the counts nor the report ever hold lyric text.

Group Counts What they say
Coverage synced, plain, plain_skipped, instrumental, no_match, blocked_foreign, untagged What each track has. A re-run still reports these. plain_skipped is plain lyrics left out by --plain skip, and blocked_foreign is a file plyrix can’t prove it wrote holding the name it needs.
Problems unavailable, unreadable, read_failed, folder_unreadable, fs_no_atomic_publish, stem_collision, symlink, too_long, write_failed What stopped a track or a folder being looked at. Each walked item adds one to exactly one coverage or problem count.
Actions written_lrc, written_txt, upgraded, adopted, lrc_stale, skipped_unchanged, looked_up, lrc_few_lines, lrc_low_coverage What this run did. upgraded is a .txt replaced by a .lrc, adopted is an existing sidecar plyrix now tracks and never replaces, and lrc_stale is a .lrc that no longer fits its track. The last two flag a .lrc that was written but has few timed lines, or whose timing stops well before the track ends.
Reasons no_match_not_found, no_match_rejected, no_match_doubtful_artist, no_match_doubtful_title, no_match_doubtful_duration, no_match_doubtful_version, no_match_timing_rejected Why a track has no match. These add up to no_match. A doubtful reason means LRCLIB answered, but that field didn’t agree with the track’s tags.

--report FILE writes the same counts to a JSON file, for a scheduler to read:

{
"report_version": 1,
"plyrix_version": "0.1.0",
"dry_run": false,
"dump_id": "",
"started_at": "2026-11-05T03:00:00+00:00",
"finished_at": "2026-11-05T04:00:00+00:00",
"end_reason": "finished",
"counts": {"synced": 0}
}

It holds no paths or tags. counts holds every count above, and end_reason is finished or lrclib_unavailable. It is written when a run finishes or stops on LRCLIB, with zero counts if the check before the run stopped it, and a dry run writes one too. A run that couldn’t start, such as one with a wrong setting or an empty library, writes none. The file is replaced whole, so a reader never sees part of one.

Code Meaning
0 The run finished, no write, file read or LRCLIB lookup failed, and every folder could be listed. Tracks with no lyrics, a corrupt file or a sidecar that isn’t plyrix’s are still counted.
1 The check before the run found LRCLIB down, still rebuilding its search index or empty, so nothing was recorded. Or the run stopped early, after 5 failed LRCLIB lookups with no successful search between them.
2 A setting or the state database is wrong, or the library is missing, empty or holds no audio files.
3 The run finished, but write_failed, fs_no_atomic_publish, unavailable, read_failed or folder_unreadable is above zero, or the report file couldn’t be written. fs_no_atomic_publish means the filesystem refused to publish a sidecar atomically, and read_failed means permissions or I/O stopped plyrix reading a file. The next run tries those again.
70 The write tripwire stopped the run.
75 Another plyrix run is using the state database.

plyrix doctor checks a setup before a run, with the same settings and flags, and changes nothing. It prints one line per check, starting with ok, warning or problem:

  • the config loads
  • music_root exists and this user can write in it
  • the state database is on a local disk, not a network or FUSE filesystem, where SQLite’s locking can fail, tmpfs, which a reboot empties, or a container’s overlay layer, which is lost with the container
  • LRCLIB answers, its search index is ready and it holds tracks
  • when plex_url is set, the server answers, plex_section is a music library, and one of its folders matches plex_music_root
Terminal window
uv run plyrix doctor

Plex answers many requests without checking the token, so a token can only be proved by a refresh. doctor reports the server as answering, with its token not checked, and the first plex-refresh names plex_token if Plex refuses it. A server that doesn’t answer is only a warning, as Plex is optional for a run. Lines name settings, never their values, so doctor’s output never holds plex_url or the token.

plyrix doctor --lrclib-data DIR checks only LRCLIB’s data folder, and needs no settings: that it exists, whether it can be written from here, its filesystem, and whether a first dump load fits. A first load needs about 320 GB, the 319.8 GB peak measured 2026-11-11 on one install, rounded up, with the download kept until LRCLIB is ready; ZFS with lz4 held that peak in 129.6 GB on disk. What is already downloaded in DIR/dl of the dump named by --dump NAME comes off that need, counting for no more than about 49 GB. Without --dump, nothing downloaded counts. The LRCLIB setup script runs this with its dump’s name before it downloads anything.

Code Meaning
0 Every check passed or only warned.
1 LRCLIB is down, still building its search index or empty, or --lrclib-data found too little free space.
2 A setting is wrong, music_root is missing or can’t be written, plex_section isn’t a music library, or the --lrclib-data folder is missing. This wins over 1.

The lyrics come from LRCLIB and its contributors. LRCLIBis MIT licensed; plyrix never bundles or mirrors the dump.

plyrix is an independent project, not affiliated with or endorsed by Plex, Inc.