plex2jellyfin
Reference

CLI Reference

Commands for migration, repair, audit, and daemon control.

plex2jellyfin --help shows the primary workflows. Several maintenance and integration commands exist but stay hidden from the root --help output to keep it short — they're documented here. Every command also accepts --help for its own flag list.

Primary

Root --help shows these. See the Migration Guide for recommended order after setup.

CommandDescription
plex2jellyfin setupInteractive first-run wizard (CLI).
plex2jellyfin scanIndex libraries into media.db.
plex2jellyfin statusDatabase statistics and deployment health.
plex2jellyfin duplicates generateFind duplicate media.
plex2jellyfin duplicates dry-runPreview the deletion plan.
plex2jellyfin duplicates executeKeep the best copy, remove the rest.
plex2jellyfin consolidate generateFind TV series scattered across drives.
plex2jellyfin consolidate dry-runPreview consolidation moves.
plex2jellyfin consolidate executeMerge scattered series into a single library path.
plex2jellyfin configManage configuration (see below).
plex2jellyfin pluginInstall / verify the companion Jellyfin plugin.
plex2jellyfin trace [fragment]Show what the daemon did to a file, step by step.
plex2jellyfin versionPrint version (dev unless built with release ldflags).

trace

Human-readable per-file pipeline journeys, newest first: when a file was detected, how it was parsed (and what release noise was stripped), where it was moved, and whether Jellyfin confirmed it. With no argument it shows the most recent files; pass a filename fragment to filter, --limit N for more.

plex2jellyfin trace                 # recent activity
plex2jellyfin trace "Show Name"     # one show's files

The web UI's Trace page renders the same data.

scan flags

FlagDefaultDescription
--path <dir>Scan a specific file or directory under a configured library root instead of everything
--sonarrfalseAlso sync from Sonarr
--radarrfalseAlso sync from Radarr
--filesystemtrueScan the filesystem
--statstrueShow database stats after scan
--rebuild-movies-from-filesfalseRebuild movie rows from indexed movie media files
--analyzefalseAfter scanning, analyze duplicates and scattered media
--jsonfalseEmit a machine-readable JSON summary

AI audit

Reviews files with low parse confidence and proposes renames via the configured LLM (see [ai]):

plex2jellyfin audit --generate            # identify low-confidence files
plex2jellyfin audit --generate --dry-run  # preview AI rename suggestions
plex2jellyfin audit --execute             # apply approved fixes
FlagDefaultDescription
--generatefalseGenerate AI suggestions for low-confidence files
--dry-runfalsePreview changes without executing
--executefalseExecute the generated audit plan
--threshold <float>0.8Confidence threshold below which a file is audited
--limit <n>0Maximum number of files to audit (0 = uncapped)

The audit sends library kind (Movies vs TV), folder path, and current parse as context — never raw file contents.

Advanced (hidden from root --help)

plex2jellyfin organize /downloads/file.mkv   # Organize a single file
plex2jellyfin organize-folder /downloads/X   # Organize a directory tree
plex2jellyfin watch /downloads               # Foreground watcher
plex2jellyfin validate <path>                # Check library against Jellyfin naming rules
plex2jellyfin cleanup {cruft|empty}          # Remove cruft files or empty dirs
plex2jellyfin monitor                        # Tail daemon activity log
plex2jellyfin daemon {status|reload|stop}    # Control the systemd-managed daemon
plex2jellyfin repair series-dedupe           # Repair duplicate series rows
plex2jellyfin repair unknown-seasons         # Repair "Season Unknown" placements
plex2jellyfin postmortem collect --since 96h # Generate an evidence bundle for review
plex2jellyfin sonarr ...                     # Sonarr integration commands
plex2jellyfin radarr ...                     # Radarr integration commands
plex2jellyfin health                         # Verify *arr setup is compatible
plex2jellyfin orphans                        # Detect / remediate orphaned Jellyfin episodes
plex2jellyfin migrate                        # Migrate path mismatches between database and Sonarr/Radarr
plex2jellyfin parses                         # Query and manage parse decisions
plex2jellyfin fix                            # Interactive wizard to clean up your media library
plex2jellyfin database ...                   # Database management commands
plex2jellyfin serve                          # Start the API server (used internally by plex2jellyfin-web)

cleanup

SubcommandDescription
cleanup cruftDelete sample files, .nfo, .txt, and other non-media cruft
cleanup emptyDelete empty directories

daemon

Controls the running daemon over its control socket rather than starting/stopping it directly — use systemctl for that (see Daemon & Services).

SubcommandDescription
daemon statusShow daemon status
daemon reloadReload daemon config without restarting the process
daemon stopStop the daemon

database

SubcommandDescription
database initInitialize a fresh database
database resetDelete and reinitialize the database
database pathShow the database file path
database cleanup-housekeepingCollapse duplicate housekeeping manual-review failures

repair

SubcommandDescription
repair series-dedupeMerge duplicate series rows that share the same canonical path
repair unknown-seasonsRepair files/rows stuck under "Season Unknown"

postmortem

plex2jellyfin postmortem collect --since 96h

Generates an evidence bundle (parse decisions, repair events, housekeeping state, suspicious items) for manual review or handing to an LLM. Runs automatically every 4 days via the plex2jellyfin-postmortem.timer user unit — see Daemon & Services.

Sonarr / Radarr integration

plex2jellyfin sonarr status                  # Check Sonarr connection status
plex2jellyfin sonarr queue                   # List Sonarr download queue
plex2jellyfin sonarr clear-stuck             # Clear stuck items from Sonarr queue
plex2jellyfin sonarr import <path>           # Trigger Sonarr import scan for a path

plex2jellyfin radarr status                  # Check Radarr connection status
plex2jellyfin radarr queue                   # List Radarr download queue
plex2jellyfin radarr clear-stuck             # Clear stuck items from Radarr queue
plex2jellyfin radarr import <path>           # Trigger Radarr import scan for a path
plex2jellyfin radarr movies                  # List movies in Radarr library

Requires [sonarr]/[radarr] configured with a valid url and api_key — see Configuration.

config

plex2jellyfin config init          # Create default configuration file
plex2jellyfin config show          # Display current configuration
plex2jellyfin config test          # Test configuration and connections
plex2jellyfin config path          # Show config file path

config init --force overwrites an existing config file; without --force it refuses to clobber one.

health

plex2jellyfin health

Verifies your Sonarr/Radarr setup is compatible with Plex2Jellyfin's expectations (root folder layout, naming settings, etc.) before you rely on the integration.

orphans

plex2jellyfin orphans

Detects Jellyfin library items that no longer correspond to a file the daemon knows about (deleted, moved outside the tool, etc.) and offers remediation.

version

plex2jellyfin version

Prints version information.

On this page