CLI Commands
Without arguments, the binary starts the MCP server. With a subcommand, it runs as a standalone CLI tool for batch operations.
# MCP server mode (default, launched by your MCP host)reklawdbox
# CLI modereklawdbox <command> [options]CLI commands load env vars from .mcp.json automatically — same config as the MCP server.
Command overview
Section titled “Command overview”| Command | Description |
|---|---|
analyze |
Batch audio analysis |
backup |
Manage Rekordbox library backups |
cues |
Inspect cues and verify manual memory point removal |
health |
Inspect library health and duplicates |
hydrate |
Batch enrichment and audio analysis |
read-tags |
Read native audio-file metadata |
write-tags |
Write native audio-file metadata |
extract-art |
Extract embedded cover art |
embed-art |
Embed cover art into audio files |
setup |
Install Essentia or configure a custom broker |
disconnect-broker |
Clear the stored Discogs broker session |
All three commands print JSON. Omit --track-id for the full collection.
reklawdbox cues list --comment 'CUE(Auto)' --memory-points-onlyreklawdbox cues preview-removal --track-id 42 --comment 'CUE(Auto)'reklawdbox cues verify-removal --track-id 42 --comment 'CUE(Auto)' --fingerprint "$fingerprint"List accepts --limit (default 50, capped at 200) and --offset (default 0). A zero limit returns just the totals and an empty row list.
Save the preview’s verification_fingerprint as fingerprint before making manual edits in Rekordbox. Preview and verify require a nonblank, case-sensitive comment.
A successful verification requires zero remaining matching memory points and the same active track identities and protected cue rows. A mismatch prints verified: false and exits nonzero. See the Cues skill for a per-track workflow.
health
Section titled “health”reklawdbox health roots reports the track count and music folders from the library database.
Choose a folder using its absolute path as recorded by Rekordbox, or pass --all for every discovered folder.
reklawdbox health quick --root "/Volumes/Music/DJ"reklawdbox health exact --root "/Volumes/Music/DJ" --limit 10 --offset 0Quick reports broken links, orphan files, tracks outside playlists, and metadata-duplicate groups.
Exact reads candidate files to find byte-identical groups. Both print JSON. Use --limit to change the number of examples (default 10, maximum 200).
For duplicates, page.total counts all groups. Each exact page rehashes the scope. Review scan or hash errors alongside totals. Exact counts unavailable files and links resolving outside the chosen folders in unavailable_count. Broken links include paths the process cannot access.
backup
Section titled “backup”Manage Rekordbox library backups. Creates compressed archives of your database files in ~/Music/rekordbox-backups/.
reklawdbox backup [options]| Flag | Type | Description |
|---|---|---|
--db-only |
flag | Database files only (~50MB, fast) |
--list |
flag | List existing backups |
--restore |
path | Restore from a backup archive |
With no flags, creates a full backup (~1GB compressed) of the entire Rekordbox data directory. When REKORDBOX_DB_PATH is configured, manual database-only and full backups use its parent directory rather than the standard install path. The configured value must be a direct regular file named master.db; symlinks are rejected. Close Rekordbox first for the strongest backup consistency.
New full archives always contain one canonical top-level rekordbox/ directory, even when the configured source directory has a different name. Full restore maps that root into the configured target directory. A database restore can recreate a missing master.db when its configured parent directory already exists; if any related allowlisted file remains there, a successful pre-restore safety archive is still mandatory. --list does not require a live source database.
A database-only backup also runs automatically before every write_xml export — you don’t need to run this manually for that. The built-in export path must create and move its archive successfully before XML creation. A configured custom script receives --pre-op first plus the effective path in its child REKORDBOX_DB_PATH; its zero exit is trusted as the operator’s success attestation. A missing or failed custom script blocks the export, while staged changes remain available for retry. This command is for manual backups and restores; neither database-only nor full archives include your audio files.
hydrate
Section titled “hydrate”Batch Discogs enrichment and audio analysis. Use it to warm these caches for workflows that consume them.
reklawdbox hydrate [options]| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--providers |
list | discogs,analysis |
Comma-separated provider list: discogs, analysis |
|
--playlist |
string | Filter by playlist ID | ||
--artist |
string | Filter by artist (partial match) | ||
--genre |
string | Filter by genre (partial match) | ||
--bpm-min |
number | Minimum BPM | ||
--bpm-max |
number | Maximum BPM | ||
--key |
string | Filter by musical key | ||
--label |
string | Filter by label (partial match) | ||
--path |
string | Filter by file path (partial match) | ||
--query |
string | Search query matching title or artist | ||
--added-after |
date | ISO date — tracks added on or after | ||
--added-before |
date | ISO date — tracks added on or before | ||
--rating-min |
1-5 | Minimum star rating | ||
--max-tracks |
integer | unlimited | Cap number of tracks to process | |
--no-retry-errors |
flag | Don’t retry previously-errored enrichments | ||
--cpu |
preset | background |
CPU scheduling: background (~50% cores, niced) or overnight (cores - 2) |
|
--concurrency |
-j |
integer | 4 |
Discogs enrichment concurrency (min 1, max 16) |
--yes |
-y |
flag | Skip confirmation prompt |
Discovers tracks, shows a summary with cache/pending/error counts, prompts for confirmation, then runs the selected providers concurrently with progress bars and graceful Ctrl+C. If Discogs auth is needed, it opens the browser flow automatically.
The analysis provider runs built-in Stratum analysis and Essentia when its
optional Python environment is available. Bandcamp and MusicBrainz are not CLI
hydrate providers; use their targeted MCP lookup and backfill paths instead.
The command drains and prints its final summary before exiting. A new provider, analysis, cache-write, or worker failure exits nonzero, as does Ctrl+C or any incomplete selected work. An all-cached/no-work run and declining the confirmation prompt remain successful.
Examples
Section titled “Examples”# Hydrate everything (Discogs + audio analysis)reklawdbox hydrate
# Just audio analysisreklawdbox hydrate --providers analysis
# Hydrate a specific playlist, skip confirmationreklawdbox hydrate --playlist "Weekend Set" -y
# Only Discogs, only tracks added this yearreklawdbox hydrate --providers discogs --added-after 2026-01-01
# Only Discogs for a specific genrereklawdbox hydrate --providers discogs --genre "Techno"
# Overnight run — max CPU, skip confirmationreklawdbox hydrate --cpu overnight -yanalyze
Section titled “analyze”Batch audio analysis. A focused alternative to hydrate --providers analysis with additional backend control.
reklawdbox analyze [options]| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--playlist |
string | Filter by playlist ID | ||
--artist |
string | Filter by artist (partial match) | ||
--genre |
string | Filter by genre (partial match) | ||
--bpm-min |
number | Minimum BPM | ||
--bpm-max |
number | Maximum BPM | ||
--key |
string | Filter by musical key | ||
--label |
string | Filter by label (partial match) | ||
--path |
string | Filter by file path (partial match) | ||
--query |
string | Search query matching title or artist | ||
--added-after |
date | ISO date | ||
--added-before |
date | ISO date | ||
--rating-min |
1-5 | Minimum star rating | ||
--max-tracks |
integer | 200 |
Max tracks to process | |
--no-skip-cached |
flag | Re-analyze already-cached tracks | ||
--stratum-only |
flag | Skip Essentia, run stratum-dsp only | ||
--cpu |
preset | background |
CPU scheduling: background (~50% cores, niced) or overnight (cores - 2) |
|
--concurrency |
-j |
integer | auto | Override analysis concurrency (overrides --cpu preset, min 1, max 16) |
Concurrency set by --cpu preset: background (~50% cores, nice 10), overnight (cores - 2). Cached analysis is validated against the analysis schema plus the canonical audio file identity (path, size, and modification time). Stratum additionally fingerprints the Rekordbox beat grid used for analysis, or a versioned no-grid fallback, so grid changes invalidate and recompute Stratum without invalidating Essentia.
The command drains and prints its final summary before exiting. A new analysis, cache-write, or worker failure exits nonzero, as does Ctrl+C or any incomplete selected work. No matching tracks and all-cached/no-work runs remain successful.
Example
Section titled “Example”# Analyze all techno tracks, stratum-dsp only, 4 concurrentreklawdbox analyze --genre Techno --stratum-only -j 4
# Overnight run — max CPUreklawdbox analyze --cpu overnightread-tags
Section titled “read-tags”Read native metadata tags from audio files.
reklawdbox read-tags <paths...> [options]| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
<paths> |
string[] | required | Audio files or directories | |
--fields |
list | all | Comma-separated field filter | |
--recursive |
-r |
flag | Recursively scan directories for audio files | |
--cover-art |
flag | Include cover art metadata | ||
--json |
flag | Output as JSON (JSONL for multiple files) |
Without --recursive, directories are scanned one level deep. WAV files show both ID3v2 and RIFF INFO layers.
Example
Section titled “Example”# Read all tags from a filereklawdbox read-tags ~/Music/track.flac
# JSON output, only artist and titlereklawdbox read-tags ~/Music/*.flac --fields artist,title --jsonwrite-tags
Section titled “write-tags”Write or delete metadata tags on audio files.
reklawdbox write-tags <path> [options]| Flag | Type | Default | Description |
|---|---|---|---|
<path> |
string | required | Audio file to write to |
--artist |
string | Set artist | |
--title |
string | Set title | |
--album |
string | Set album | |
--album-artist |
string | Set album artist | |
--genre |
string | Set genre | |
--year |
string | Set year | |
--track |
string | Set track number | |
--disc |
string | Set disc number | |
--comment |
string | Set comment | |
--publisher |
string | Set publisher | |
--bpm |
string | Set BPM | |
--key |
string | Set musical key | |
--composer |
string | Set composer | |
--remixer |
string | Set remixer | |
--dry-run |
flag | Preview changes without writing; WAV output is grouped by tag layer | |
--wav-targets |
list | both | WAV targets: id3v2, riff_info |
--json-input |
flag | Read tags from stdin as JSON | |
--json |
flag | Output as JSON |
Set a field to "" to delete it. Use --dry-run to preview. For WAV files,
human-readable previews show separate ID3v2 and RIFF INFO headings for the
requested targets, including an indented No changes. when a layer is already
up to date.
Examples
Section titled “Examples”# Set genre and previewreklawdbox write-tags track.flac --genre "Techno" --dry-run
# Delete the comment fieldreklawdbox write-tags track.flac --comment ""
# Batch update via JSON stdinecho '{"artist": "Artist", "genre": "House"}' | reklawdbox write-tags track.flac --json-input
# Write to specific WAV layersreklawdbox write-tags track.wav --artist "Artist" --wav-targets riff_infoextract-art
Section titled “extract-art”Extract embedded cover art from an audio file.
reklawdbox extract-art <path> [options]| Flag | Type | Default | Description |
|---|---|---|---|
<path> |
string | required | Audio file |
--output |
string | cover.{ext} |
Output path |
--picture-type |
string | front_cover |
Exact accepted picture type; unknown values are rejected |
--json |
flag | Output as JSON |
Example
Section titled “Example”reklawdbox extract-art track.flac --output artwork.jpgAccepted cover-art picture types
Section titled “Accepted cover-art picture types”Both cover-art commands accept these exact, case-sensitive, untrimmed values: other, icon, other_icon, front_cover, cover_front, back_cover, cover_back, leaflet, media, lead_artist, artist, conductor, band, composer, lyricist, recording_location, during_recording, during_performance, screen_capture, bright_fish, illustration, band_logo, and publisher_logo. cover_front and cover_back are compatibility aliases for the canonical front_cover and back_cover names. Unknown values are rejected. When a valid requested extraction type is absent, extraction falls back to the first embedded picture.
embed-art
Section titled “embed-art”Embed cover art into one or more audio files.
reklawdbox embed-art <image> <targets...> [options]| Flag | Type | Default | Description |
|---|---|---|---|
<image> |
string | required | Image file (JPEG or PNG) |
<targets> |
string[] | required | Audio files to embed into |
--picture-type |
string | front_cover |
Exact accepted picture type; unknown values are rejected |
--json |
flag | Output as JSON |
Example
Section titled “Example”# Embed cover art into multiple filesreklawdbox embed-art cover.jpg track1.flac track2.flac track3.flacWith no valid expert override, installs the optional Essentia audio-analysis runtime at the stable managed path ~/.local/share/reklawdbox/essentia-venv/bin/python. Setup requires CPython 3.14 and validates the complete wheel-only manifest: Essentia 2.1b6.dev1438, NumPy 2.5.1, PyYAML 6.0.3, and six 1.17.0. Internal immutable generations are selected atomically and are not a path to configure manually. A valid CRATE_DIG_ESSENTIA_PYTHON is reused only when it matches that manifest. Essentia is external AGPL-3.0-only software, not bundled with Reklawdbox; the core server and Stratum analysis remain available without Python.
reklawdbox setup [options]| Flag | Short | Description |
|---|---|---|
--broker |
Configure a custom Discogs broker URL and token (self-hosted brokers only) | |
--yes |
-y |
Accept defaults without prompting (only applies to --broker) |
The --broker flag opens an interactive prompt for custom Discogs broker configuration, writing settings to ~/Library/Application Support/reklawdbox/config.toml. The default broker is preconfigured and needs no setup.
disconnect-broker
Section titled “disconnect-broker”Clear the current Discogs broker session, forcing a fresh OAuth device auth
flow on the next lookup_discogs call. The command removes that broker’s
credential from macOS Keychain and its matching metadata from the internal
state database selected by CRATE_DIG_STORE_PATH. It preserves unrelated
enrichment and analysis caches, audit history and resolutions, saved presets,
and calibration/profile statistics. The operation is targeted and idempotent,
so it is safe to run when no matching session exists.
reklawdbox disconnect-broker