Skip to content

Command Line Interface

Chris Dock edited this page Oct 31, 2026 · 5 revisions

Command Line Interface

Everything Steam ROM Manager does from Add Games can be done from a terminal: add and remove games, turn parsers on and off, and create, change, inspect and delete parsers. It uses the same parsers, settings and exceptions as the app, so you can set things up in the app and automate them from the command line, or the other way around.

Getting the command line

There are two ways to run it. Both have the same commands.

The standalone command line (recommended for scripts)

Every release has a standalone command line next to the app downloads: srm-cli-<version>-<os>-<arch>.

System File Run it as
Windows (x64, arm64) srm-cli-<version>-win-<arch>.exe srm-cli-….exe list (rename it srm.exe if you like)
Linux (x64, arm64) srm-cli-<version>-linux-<arch>.tar.gz, holding srm ./srm list
macOS (x64, arm64) srm-cli-<version>-mac-<arch>.tar.gz, holding srm ./srm list

It's a single file with nothing to install, and it doesn't need the app. It works on machines without a desktop, such as a server or over SSH.

The app itself

The installed app also takes commands. Give it a command and it runs it and exits, without opening a window:

  • Windows: "C:\Program Files\Steam ROM Manager\Steam ROM Manager.exe" list
  • Linux (AppImage): ./Steam-ROM-Manager-<version>.AppImage list
  • macOS: "/Applications/Steam ROM Manager.app/Contents/MacOS/Steam ROM Manager" list

Which data it uses

The command line uses your SRM data: parsers, settings, exceptions and artwork choices.

  1. SRM_USER_DATA_DIR: if this environment variable is set, the folder it names.
  2. Portable: a userData folder next to the executable, if there is one.
  3. Otherwise: the installed app's data folder:
    • Windows: %APPDATA%\steam-rom-manager\userData
    • Linux: ~/.config/steam-rom-manager/userData
    • macOS: ~/Library/Application Support/steam-rom-manager/userData

The command line doesn't need an internet connection to start. It uses the data SRM has already downloaded, such as custom variables and the fuzzy title list, and only downloads what it has never downloaded. Adding games still contacts SteamGridDB for artwork.

Before you add or remove games

Close Steam completely first (Steam > Exit, not just the window). If Steam is running, games are still added or removed, but collections aren't updated, and Steam may overwrite other changes when it exits. If SRM's "kill Steam" / "restart Steam" settings are on, SRM closes and restarts Steam for you, as in the app.

Naming parsers

Wherever a command takes parsers, you can use either:

  • the parser's id, e.g. 177215253108737528 (srm list shows them); or
  • its name, e.g. "Snes9x (SNES)". Emoji and letter case are ignored, so "snes9x (snes)" matches "Snes9x (SNES) 📺".

Put names with spaces in quotes. If any parser you name isn't found, the command changes nothing, says which one wasn't found and exits with code 1.

Commands

srm --help lists the commands. srm <command> --help explains one.

Command What it does
list Every parser: name, id, enabled or disabled
enable <parsers…> / enable --all Enable parsers
disable <parsers…> / disable --all Disable parsers
add Run the enabled parsers and add their games to Steam
add --only <parsers…> Run just these parsers (enabled or not)
remove Remove the enabled parsers' games from Steam
remove --only <parsers…> Remove just these parsers' games
nuke Remove everything SRM has ever added, from every parser
create Create a parser
edit <parser> Change some of a parser's settings
view <parser> Show a parser's settings (also show)
delete <parsers…> Delete parsers

list

srm list
Parser Title (w/o emoji) | Parser ID          | Status
Snes9x (SNES)            | 172347820938476123 | Enabled
Dolphin (GameCube)       | 177215253108737528 | Disabled

enable / disable

srm enable "Snes9x (SNES)" "Dolphin (GameCube)"
srm disable --all

add / remove

srm add                                  # every enabled parser
srm add --only "Snes9x (SNES)"           # just this one, even if it's disabled
srm remove --only 177215253108737528

--only doesn't change which parsers are enabled. When you add with --only, other parsers' games stay in Steam, even with "delete disabled shortcuts" on.

Your exceptions (excluded games, renames, Fix match) apply, just as on Add Games. For each game, the artwork SRM picks is the one you chose in the app if you did, otherwise the first result.

nuke

srm nuke

Removes every shortcut, artwork, collection entry and controller setting SRM has added, from every parser, enabled or not. This is the app's Remove all.

create

srm create --ptype Glob --name "My SNES" \
  --rom-directory "D:/ROMs/SNES" --glob '${title}.@(sfc|smc)' \
  --executable "C:/RetroArch/retroarch.exe" \
  --executable-args '-L cores/snes9x_libretro.dll "${filePath}"' \
  --steam-categories "SNES" "Retro"

Every setting in the parser editor is an option. The command checks everything the editor checks:

  • The required settings for the parser type must be there (e.g. Missing --rom-directory (ROMs directory)).
  • Values must be allowed (e.g. --ptype must be one of: …) and valid.
  • Settings must apply to the type.

Settings you leave out get the editor's defaults. Choice names are matched loosely: glob, Glob, SteamGridDB and sgdb all work.

To see every setting, grouped as in the editor with the required ones marked:

srm create --help                 # all settings
srm create --help --ptype Glob    # just a Glob parser's settings, required ones first

How to give values:

  • Lists take several values: --steam-categories "Puzzle" "Fun", --image-providers sgdb steamCDN.
  • Switches are on when given, and turned off with --no- in front: --drm-protect, --no-drm-protect.
  • Variables like ${title} need single quotes in bash and PowerShell, so the shell doesn't replace them itself: --glob '${title}.sfc'.

--ptype (also --parser-type) is the parser type: Glob, Glob-regex, Manual, Amazon Games, Epic, Legendary, GOG Galaxy, itch.io, Steam, UPlay, UWP, EA Desktop, Battle.net, Non-SRM Shortcuts, GitHub Launcher or Quiver Launcher. (It isn't --type: Electron reserves that switch for itself.)

edit

srm edit "My SNES" --steam-categories "Nintendo" "SNES"
srm edit "My SNES" --no-drm-protect --title-modifier '${fuzzyTitle}'

Only the options you give change, and only to valid values. If anything is invalid, nothing changes. Changing --ptype checks the parser as a whole for its new type. srm edit --help lists every option.

view

srm view "My SNES"                          # every setting that applies to this parser
srm view "My SNES" --ptype --rom-directory  # just these, in this order
srm view "My SNES" --glob                   # one setting: just its value

With a single setting, only its value is printed, one item per line for lists. That makes it easy to use in scripts:

dir=$(srm view "My SNES" --rom-directory)

delete

srm delete "My SNES" "Old Parser"

Deletes all the named parsers, or none if one isn't found.

Exit codes

Code Meaning
0 Done
1 Something failed or was refused: a parser not found, an invalid setting, or a problem reading or saving. The reason is printed.

Messages go to the error stream (stderr), so they don't mix with output you're capturing from list or view.

For older scripts

  • --names isn't needed any more: ids and names both work everywhere. Scripts that still pass it keep working.
  • Settings files with problems: if SRM can't read your userConfigurations.json, commands that change parsers refuse to run. Running them would only seem to work, since nothing could be saved. Fix or restore the file first (the error says what's wrong).
⌂ 换网址