Skip to content

Command reference

Every retropi command, flag and helper script, grouped into setup, content and maintenance, plus the global flags and make targets.

Every command takes --help. Global flags work on either side of the subcommand: retropi -v doctor and retropi doctor -v are the same.

Global flag Effect
-n, --dry-run print what would happen, change nothing
-v, --verbose debug output
-y, --yes assume yes for prompts (required in CI)
--no-color disable coloured output
--version print the version

A literal -- stops flag interpretation, so retropi roms find -- -v searches for the text -v.

Setup

doctor

Checks the machine and reports what is missing. Changes nothing, and ends with the exact commands to fix what it found. Run it first on any new machine, and again whenever something breaks.

--strict          exit non-zero on warnings as well as failures
--systems <ids>   limit system checks to a comma separated list
--no-bios         skip the BIOS audit

Exits non-zero when it finds failures, so it works as a CI gate.

install

Installs the emulator stack: ES-DE (the main ROM frontend), RetroArch, libretro cores for the enabled systems, then generates configuration. A frontend failure does not skip cores or configuration, but the command still exits non-zero and prints the manual-install or emulator-only next step.

(no options)      ES-DE + RetroArch + cores + build
--all             same as the default full stack
--retroarch       RetroArch only
--cores           cores only
--frontend        frontend only
--no-frontend     skip the frontend
--no-cores        skip cores
--no-build        skip config generation

On macOS this installs the upstream universal build rather than the Homebrew cask — see macos.md for why that matters.

build

Regenerates everything downstream of the manifests: the ROM directory tree, es_systems.xml, per-system gamelists, and RetroArch paths. Run it after any configuration change.

--systems <ids>    build only these systems (comma separated)
--no-install       write to build/ only, do not touch the frontend
--no-dirs          do not create the ROM directory tree
--no-gamelists     do not write gamelist.xml
--no-retroarch     skip RetroArch path configuration
--apply-retroarch  merge the generated keys into your real retroarch.cfg

Output lands in build/ and is installed into the frontend's config directory. Existing files are backed up first.

--systems is a filter, not a preference: building with it leaves every other system out of the generated frontend config until the next full build.

ES-DE defaults to exclusive loading of the generated systems, so disabled systems cannot reappear through its bundled definitions. Set frontend.load_exclusive: false to retain ES-DE's bundled systems alongside managed overrides. The <loadExclusive/> directive is an ES-DE-specific top-level sibling of <systemList>; generic single-root XML parsers need to wrap these elements when inspecting that output. Legacy EmulationStation receives a plain <systemList> document.

config

config init             create config/local.yaml for this machine
config show [--raw]     print the fully merged configuration
config get <key>        read one value (dotted, e.g. paths.roms)
config set <key> <val>  write a value into config/local.yaml
config path             print the config file locations
config edit             open config/local.yaml in $EDITOR
config validate         parse every config file and manifest

Precedence runs defaults < config/local.yaml < RETROPI_* environment variables. See configuration.md.

Content

systems

systems list [--all]     enabled systems (--all: every manifest)
systems show <id>        full detail, including the generated launch command
systems enable <id>...   add to config/local.yaml
systems disable <id>...  remove from config/local.yaml

show accepts aliases, so systems show genesis finds megadrive. Its last line is the exact command the frontend will run — the fastest way to debug a game that will not start.

roms

roms scan                 count games per system, write build/inventory.tsv
roms list [system]        list games
roms import <archive|dir> import a collection laid out one folder per console
    --dry-run             show the plan, change nothing
    --overwrite           replace games already present
    --map "Folder=id"     force a folder to a system (repeatable)
  directories only:
    --copy                copy instead of linking in place
    --metadata <csv>      titles, ratings, year, genre, credits for the gamelist
    --all-folders         include "_" holding folders
roms add <file>...        file individual games
    --system <id>         force the target system
    --move                move instead of copy
roms checksum             record SHA-1 for every game
roms verify               re-check against the recorded checksums
roms find <text>          search by name

add resolves the system from the file extension and refuses to guess when the extension is ambiguous — .zip and .bin belong to a dozen systems each. import uses the archive's folder names instead, which is the only reliable signal for a bulk collection.

Given a directory (an external drive, a share), import links each game into roms/<system>/ and leaves the collection exactly as it is; re-running it is a sync that follows moved games and prunes links to removed ones. The details are in getting-started.md.

verify exits non-zero when anything is corrupt or missing, so it works in a cron job.

bios

bios check [--all]   report required and optional BIOS per system
bios where           print the BIOS directory

Distinguishes missing-and-required from missing-and-optional, and verifies the MD5 of files you supply, so a wrong-region dump is reported rather than silently failing at boot. retro-pi never downloads BIOS images — see legal.md.

cores

cores list                    every core the enabled systems need
cores install                 all missing cores
cores install <core>...       specific cores
cores install --system <id>   the cores for one system
cores install --all           cores for every available system
cores install --force         re-download even if present
cores update                  re-download every installed core
cores remove <core>...        delete cores
cores dir                     print the core directory

Cores must match the RetroArch binary, not the CPU — they are dlopen()ed into it. list marks any core built for the wrong architecture, and install --force rebuilds them.

frontend

frontend status            what is installed, where, and what is wired up
frontend install [--force] download and install ES-DE for this platform
frontend launch            start the frontend
frontend session start     run the frontend on this machine's own monitor (Linux/X11),
                           applying display.rotate and display.region; works over SSH
frontend session stop|status
frontend gamelist          write gamelist.xml so games show real titles
    --systems <ids>        limit to these systems
    --dry-run              report what would change
frontend themes list|install <git-url>|dir
frontend settings [--apply]  merge managed keys into es_settings.xml
frontend collections       custom collections across consoles, one per definition file
    --list                 show the definitions and where each comes from
    --dry-run              list the collections, write nothing
frontend dirs              print every managed path

See emulationstation.md.

frontend collections reads the per-system metadata roms import --metadata keeps and writes one ES-DE custom collection per definition, listing ROM paths across every console. Each collection is a YAML file, read from config/collections/ (shipped), then packages/*/collections/ (extension packs), then config/collections.local/ (yours, gitignored); a later file with the same name replaces an earlier one, and enabled: false turns a shipped one off. Shipped: Top Rated, Classics, Genre - <genre>, Decade - <1980s>, Series - <franchise>, Multiplayer, Co-op, Family, Betas & Hacks, and Unidentified Dumps. The definition format (match conditions, group_by, min) is documented at the top of lib/collections_gen.py; a minimal one:

# config/collections.local/mario.yaml
name: "Mario Everything"
match: {field: name, regex: "mario"}

The collections are enabled in es_settings.xml after any collections you made yourself; those, and any file of yours with the same name, are never touched. Quit ES-DE first: it rewrites its settings on exit.

settings --apply and collections merge into ES-DE's settings file in its own format (a bare list of elements, not one XML document), keeping every key they do not manage.

audio

audio list            outputs the sound server offers (* = current default)
audio set <name>      make the output matching <name> the default now
audio apply           apply audio.output from your config

RetroArch and the frontend play to the system's default output, so this is how sound reaches speakers on an HDMI monitor. Names match case-insensitively (retropi audio set hdmi). Linux with PipeWire; the choice persists across restarts, and frontend session start applies audio.output too.

Maintenance

sync

sync targets                 list configured targets
sync push <target> [sets]    send content to the target
sync pull <target> [sets]    bring content back
    --dry-run / -n           show what rsync would transfer
    --delete                 remove destination files that are gone locally

Content sets: config, roms, bios, saves, themes. Defaults to the target's include list.

Always --dry-run first. Saves are usually pulled rather than pushed: retropi sync pull pi saves.

provision

Write retro-pi onto a mounted Raspberry Pi OS boot partition (the FAT bootfs). The next boot unpacks the framework to /opt/retro-pi, installs RetroArch, cores and ES-DE, and autostarts the frontend.

provision [bootfs]         default: /Volumes/bootfs, then /boot/firmware
--user <name>              account to create (default: this machine's user)
--password <pass>          login password (default: generated)
--pubkey <file>            SSH authorized_keys to install
--no-ssh                   do not enable sshd
--no-autostart             do not autostart the frontend after install

Does not copy ROMs or BIOS images. See raspberry-pi.md.

package

--with-roms      include the ROM library (can be very large)
--with-bios      include BIOS files
--name <name>    archive base name
--out <dir>      output directory (default: dist/)

Produces a small archive of the tooling and configuration — enough to rebuild an identical setup anywhere. Content is opt-in, so the default archive is safe to share.

extend

extend system <id>     scaffold config/systems/<id>.yaml
    --name "..."       full display name
    --core <core>      libretro core name
    --ext ".a26,.bin"  comma separated extensions
    --year / --manufacturer
extend pack <name>     scaffold an extension pack in packages/
extend list            list installed extension packs

See adding-systems.md.

test and clean

test [pattern] [-v]   run the test suite, optionally filtered
clean [--all]         remove generated files (--all: also cached downloads)

clean never touches ROMs, BIOS files or saves.

Development

dev

dev run <system> [rom] | <rom>   a game under the dev profile (windowed, logged,
    --emulator <id> --fullscreen --frames <n>    command port + Network RetroPad)
    --speed <n> --mute
dev frontend [args]              ES-DE windowed with --debug logging
dev logs                         follow the RetroArch and ES-DE logs
dev status | pause | resume | step [n] | ff | mute   drive the running game
dev peek <addr> [len] | poke <addr> <byte>... | watch <addr> [len]
dev press <btn+btn> [frames] | hold <btns> | release
dev screenshot | reset | save-state | load-state | msg <text> | send <CMD> | repl
dev headless <system> [rom] [--emulator <id>] [--frames n] [--press ...]
    [--peek ADDR:LEN] [--png f] [--bench] [--procs n]
dev check                        what the harness needs, and what is missing

The run/debug harness, with two seams into a game: the live one drives the RetroArch that dev run started (its network command port and Network RetroPad), and the headless one runs the same libretro core with no window, as fast as it can. Inside a Flatpak editor (VS Code on SteamOS) every dev command re-runs itself on the host. The full guide is development.md.

ml

ml setup [--rocm|--cuda]   create packages/ml/.venv (CPU PyTorch by default)
ml check [game]            validate a game definition: API, random rollout, speed
ml games                   list game definitions (packages/ml/games/*.yaml)
ml train [options]         PPO on a game (default smb-1-1)
ml eval <model.zip>|--random [--episodes n] [--gif f]
ml board                   TensorBoard over packages/ml/runs
ml report [run]            the run's evidence as one HTML page (curves, videos)
ml python <args>           the pack's Python, for your own scripts

Dispatches into the optional pack in packages/ml/, whose stack lives in its own virtualenv; without it every subcommand but setup says how to install it. The core never imports it.

Helper scripts

These sit outside the CLI because they are development and launch aids rather than part of the managed workflow.

Script Purpose
tools/run-rom.sh <system> [rom] launch a game using the same emulator resolution the frontend uses; --print shows the command, --fullscreen and --log <file> also available. --frames <n> quits after n frames, --screenshot <file> keeps the last one, --headless runs inside Xvfb — together they prove video works on a machine with no display
tools/validate-vscode.py [--run] check .vscode/ run and debug configuration; --run executes every launch configuration
platforms/macos/bootstrap.sh install macOS prerequisites
platforms/raspberrypi/bootstrap.sh install Raspberry Pi prerequisites (runs the Debian bootstrap, then adds board advice)
platforms/raspberrypi/firstrun.sh early first-boot hook copied onto bootfs by retropi provision
platforms/raspberrypi/firstboot.sh after-network install of RetroArch, cores and ES-DE
platforms/debian/bootstrap.sh [--headless] install Debian/Ubuntu prerequisites; --headless adds Xvfb
tests/fixtures/make_test_rom.py generate an original NES test cartridge for verifying a setup

Make targets

make help lists them. The ones worth knowing:

Target What it does
make check everything CI runs: lint, config validation, .vscode validation, tests
make test the test suite
make test-linux the suite in Debian bookworm and trixie containers — the Raspberry Pi and Debian code paths
make lint shellcheck every script
make setup install, build, doctor