Skip to content

CLI Flags

PrepArr accepts CLI flags to override configuration from environment variables and config files. CLI flags have the highest priority in the configuration hierarchy.

  1. CLI arguments (highest)
  2. Environment variables
  3. Configuration file (JSON/YAML)
  4. Default values (lowest)
FlagDescription
--initRun in init mode: set up databases, generate config.xml, then exit
--help, -hShow help message and exit
--version, -vShow version information and exit
--generate-api-keyGenerate a new 32-character hex API key and exit
Terminal window
# Run as init container
docker run --rm ghcr.io/robbeverhelst/preparr:latest --init

Init mode performs one-time setup:

  1. Creates PostgreSQL databases and users
  2. Generates config.xml with API key and database connection
  3. Exits with code 0 on success
Terminal window
docker run --rm ghcr.io/robbeverhelst/preparr:latest --generate-api-key
# Output: 2bac5d00dca43258313c734821a15c4c

All flags support both --key=value and --key value syntax.

FlagEnvironment VariableDefaultDescription
--postgres-hostPOSTGRES_HOSTlocalhostDatabase host
--postgres-portPOSTGRES_PORT5432Database port
--postgres-userPOSTGRES_USERpostgresDatabase username
--postgres-usernamePOSTGRES_USERNAMEpostgresAlias for --postgres-user
--postgres-passwordPOSTGRES_PASSWORDDatabase password (required)
--postgres-dbPOSTGRES_DBservarrDatabase name
--postgres-databasePOSTGRES_DATABASEservarrAlias for --postgres-db
FlagEnvironment VariableDefaultDescription
--servarr-urlSERVARR_URLInstance URL (e.g., http://sonarr:8989)
--servarr-typeSERVARR_TYPEautoApp type: sonarr, radarr, lidarr, readarr, prowlarr, qbittorrent, auto
--servarr-api-keySERVARR_API_KEY32-character hex API key
--servarr-admin-userSERVARR_ADMIN_USERadminAdmin username
--servarr-admin-passwordSERVARR_ADMIN_PASSWORDAdmin password (required)
FlagEnvironment VariableDefaultDescription
--qbittorrent-urlQBITTORRENT_URLqBittorrent web UI URL
--qbittorrent-userQBITTORRENT_USERqBittorrent username
--qbittorrent-usernameQBITTORRENT_USERNAMEAlias for --qbittorrent-user
--qbittorrent-passwordQBITTORRENT_PASSWORDqBittorrent password
--prowlarr-urlPROWLARR_URLProwlarr URL
--prowlarr-api-keyPROWLARR_API_KEYProwlarr API key
FlagEnvironment VariableDefaultDescription
--app-api-keyAPP_API_KEYApplication API key
--app-prowlarr-syncAPP_PROWLARR_SYNCfalseEnable Prowlarr sync
--app-root-foldersAPP_ROOT_FOLDERS[]Root folders (JSON array or comma-separated)
--app-indexersAPP_INDEXERSIndexers (JSON array)
--app-download-clientsAPP_DOWNLOAD_CLIENTS[]Download clients (JSON array)
--app-quality-profilesAPP_QUALITY_PROFILES[]Quality profiles (JSON array)
--app-applicationsAPP_APPLICATIONS[]Applications (JSON array)
--app-qbittorrentAPP_QBITTORRENTqBittorrent config (JSON object)
FlagEnvironment VariableDefaultDescription
--health-portHEALTH_PORT9001Health endpoint port
--log-levelLOG_LEVELinfoLog verbosity: debug, info, warn, error
--log-formatLOG_FORMATprettyLog format: json, pretty
FlagEnvironment VariableDefaultDescription
--config-pathCONFIG_PATHPath to configuration file
--config-watchCONFIG_WATCHfalseWatch config file for changes
--config-reconcile-intervalCONFIG_RECONCILE_INTERVAL60Reconciliation interval in seconds
Terminal window
docker run ghcr.io/robbeverhelst/preparr:latest --log-level=debug
Terminal window
docker run ghcr.io/robbeverhelst/preparr:latest \
--servarr-url=http://sonarr:8989 \
--servarr-type=sonarr \
--servarr-admin-password=mypassword \
--postgres-host=postgres \
--postgres-password=dbpassword \
--app-root-folders='[{"path":"/tv"}]'
Terminal window
docker run --rm ghcr.io/robbeverhelst/preparr:latest \
--init \
--postgres-host=postgres \
--postgres-password=dbpassword \
--servarr-type=sonarr \
--servarr-admin-password=mypassword