Can I load a saved state through command line (CLI)?

I learnt how to launch a certain core and game (https://docs.libretro.com/guides/cli-intro/), and now I wonder if there’s an additional flag to also set a save state, so I can directly play from where I left directly from my frontend.

Got a reply here: https://www.reddit.com/r/RetroArch/comments/9l99xl/can_i_load_a_save_state_from_command_line/e768dar

"As far as I know it’s not possible directly, BUT…

The way I’ve done this on RetroPie is as follows:

enable the setting to “auto-load save-state” (in Settings / Saving, I think. Might need advanced settings to be enabled: Settings / User interface/ Show advanced settings)

copy the desired savestate file to <Name_of_ROM>.auto

then start RetroArch

I do not know if this works on other versions of RetroArch, though"

This sounds like a great idea, I’ll go make a feature request in the issue tracker.

edit: Done, made the issue: https://github.com/libretro/RetroArch/issues/7398

There’s also the Auto-Load setting…

Yes, that’s what I quoted in my previous post. The trick is to enable “auto load state”, then, in your frontend, if you have a state selected, before launching the game, clone the state file and rename it to “.state.auto”, so it’s loaded when Retroarch loads the game.

Anyway, a direct CLI option to set the save state file when loading a game would be very handy.