RetroArch Network Control Interface¶
RetroArch exposes a UDP-based Network Control Interface (NCI) that allows remote control of a running instance. Commands can be sent from the command line, scripts, or any program capable of sending UDP packets.
Enabling the Interface¶
Enable the NCI through RetroArch settings:
network_cmd_enable- Set totrueto enable the network command interfacenetwork_cmd_port- UDP port to listen on (default:55355)
These can be set in retroarch.cfg:
Or via the menu: Settings > Network > Network Commands.
Sending Commands¶
Use the --command CLI flag to send a command to a running RetroArch instance:
HOSTandPORTare optionalretroarch --command "COMMAND;HOST"uses the default port (55355)retroarch --command "COMMAND"useslocalhostand the default port
Since the interface uses plain UDP packets, you can also send commands with nc (netcat), which is available on both Linux and macOS:
The -w1 flag tells nc to wait up to 1 second, which is enough time to receive a response from commands that return one. The response is sent back to the sender's address automatically.
Action Commands¶
Action commands accept arguments and may return responses over UDP.
VERSION¶
Returns the RetroArch version string.
- Arguments: None
- Response: Version string (e.g.,
1.19.1)
GET_STATUS¶
Returns the current emulation status.
- Arguments: None
- Response:
GET_STATUS PAUSED|PLAYING system_id,game_basename,crc32=XXXXXXXXwhen content is loaded, orGET_STATUS CONTENTLESSwhen no content is running
GET_CONFIG_PARAM¶
Queries a configuration parameter value.
- Arguments:
<param name> - Response:
GET_CONFIG_PARAM <param name> <value> - Supported parameters:
video_fullscreen- Whether fullscreen is active (true/false)savefile_directory- Save file directory pathsavestate_directory- Save state directory pathruntime_log_directory- Runtime log directory pathlog_dir- Log directory pathcache_directory- Cache directory pathsystem_directory- System/BIOS directory pathnetplay_nickname- Current netplay usernameactive_replay- Active replay info asidentifier flags frame_counter(requires BSV movie support)
SHOW_MSG¶
Displays an on-screen display (OSD) message.
- Arguments:
<message text>
SET_SHADER¶
Loads a shader preset by file path. Requires shader support (CG, GLSL, Slang, or HLSL).
- Arguments:
<shader path>
READ_CORE_RAM¶
Reads bytes from core memory using achievement addresses. Requires achievements (CHEEVOS) support. Prefer READ_CORE_MEMORY for system addresses.
- Arguments:
<address> <number of bytes>(address in hexadecimal) - Response:
READ_CORE_RAM <address> <byte1> <byte2> ...(bytes as hex), orREAD_CORE_RAM <address> -1on failure
WRITE_CORE_RAM¶
Writes bytes to core memory using achievement addresses. Requires achievements (CHEEVOS) support. Disables achievements hardcore mode. Prefer WRITE_CORE_MEMORY for system addresses.
- Arguments:
<address> <byte1> <byte2> ...(address and bytes in hexadecimal)
READ_CORE_MEMORY¶
Reads bytes from core memory using the system memory map.
- Arguments:
<address> <number of bytes>(address in hexadecimal) - Response:
READ_CORE_MEMORY <address> <byte1> <byte2> ...(bytes as hex), orREAD_CORE_MEMORY <address> -1 <error message>on failure - Error messages:
no memory map defined,no descriptor for address,no data for descriptor
WRITE_CORE_MEMORY¶
Writes bytes to core memory using the system memory map. Disables achievements hardcore mode if active.
- Arguments:
<address> <byte1> <byte2> ...(address and bytes in hexadecimal) - Response:
WRITE_CORE_MEMORY <address> <bytes written>on success, orWRITE_CORE_MEMORY <address> -1 <error message>on failure - Error messages:
no memory map defined,no descriptor for address,no data for descriptor,descriptor data is readonly
LOAD_STATE_SLOT¶
Loads a save state from a specific slot number.
- Arguments:
<slot number> - Response:
LOAD_STATE_SLOT <slot number>
PLAY_REPLAY_SLOT¶
Starts playback of a replay from a specific slot. Requires BSV movie support.
- Arguments:
<slot number> - Response:
PLAY_REPLAY_SLOT <identifier>
SEEK_REPLAY¶
Seeks to a specific frame in the currently active replay. Requires BSV movie support. Disabled during achievements hardcore mode.
- Arguments:
<frame number> - Response:
OK <target frame>on success, orNOon failure
SAVE_FILES¶
Saves all save files (SRAM) to disk.
- Arguments: None
- Response:
OKon success,NOon failure
LOAD_FILES¶
Loads all save files (SRAM) from disk.
- Arguments: None
- Response:
OKon success,NOon failure
LOAD_CORE¶
Loads a libretro core from a file path.
- Arguments:
<core path>
State/Button Commands¶
State commands simulate input presses and take no arguments. They trigger the same actions as pressing the corresponding hotkey.
Menu Navigation¶
Navigate the RetroArch menu remotely.
MENU_TOGGLE¶
Open or close the menu.
- Arguments: None
MENU_UP¶
Navigate up in the menu.
- Arguments: None
MENU_DOWN¶
Navigate down in the menu.
- Arguments: None
MENU_LEFT¶
Navigate left in the menu.
- Arguments: None
MENU_RIGHT¶
Navigate right in the menu.
- Arguments: None
MENU_A¶
Menu confirm/accept.
- Arguments: None
MENU_B¶
Menu back/cancel.
- Arguments: None
Game Control¶
Control game execution state.
QUIT¶
Quit RetroArch.
- Arguments: None
CLOSE_CONTENT¶
Close the currently running content.
- Arguments: None
RESET¶
Reset the current game.
- Arguments: None
PAUSE_TOGGLE¶
Toggle pause.
- Arguments: None
FRAMEADVANCE¶
Advance one frame while paused.
- Arguments: None
Speed Control¶
Adjust emulation speed.
FAST_FORWARD¶
Toggle fast forward.
- Arguments: None
FAST_FORWARD_HOLD¶
Hold fast forward (active while held).
- Arguments: None
SLOWMOTION¶
Toggle slow motion.
- Arguments: None
SLOWMOTION_HOLD¶
Hold slow motion (active while held).
- Arguments: None
REWIND¶
Rewind gameplay.
- Arguments: None
Audio¶
Control audio settings.
MUTE¶
Toggle audio mute.
- Arguments: None
VOLUME_UP¶
Increase audio volume.
- Arguments: None
VOLUME_DOWN¶
Decrease audio volume.
- Arguments: None
Save States¶
Manage save states via hotkey simulation.
LOAD_STATE¶
Load save state from the current slot.
- Arguments: None
SAVE_STATE¶
Save state to the current slot.
- Arguments: None
STATE_SLOT_PLUS¶
Increment the save state slot.
- Arguments: None
STATE_SLOT_MINUS¶
Decrement the save state slot.
- Arguments: None
Replays¶
Control replay recording and playback.
PLAY_REPLAY¶
Start replay playback.
- Arguments: None
RECORD_REPLAY¶
Start replay recording.
- Arguments: None
HALT_REPLAY¶
Stop the current replay.
- Arguments: None
SAVE_REPLAY_CHECKPOINT¶
Save a checkpoint during replay.
- Arguments: None
PREV_REPLAY_CHECKPOINT¶
Go to the previous replay checkpoint.
- Arguments: None
NEXT_REPLAY_CHECKPOINT¶
Go to the next replay checkpoint.
- Arguments: None
REPLAY_SLOT_PLUS¶
Increment the replay slot.
- Arguments: None
REPLAY_SLOT_MINUS¶
Decrement the replay slot.
- Arguments: None
Disk Control¶
Manage multi-disk games.
DISK_EJECT_TOGGLE¶
Toggle disk tray eject.
- Arguments: None
DISK_NEXT¶
Switch to next disk.
- Arguments: None
DISK_PREV¶
Switch to previous disk.
- Arguments: None
Shaders¶
Control shader settings.
SHADER_TOGGLE¶
Toggle shaders on/off.
- Arguments: None
SHADER_HOLD¶
Hold shader (active while held).
- Arguments: None
SHADER_NEXT¶
Switch to next shader preset.
- Arguments: None
SHADER_PREV¶
Switch to previous shader preset.
- Arguments: None
Cheats¶
Manage cheat codes.
CHEAT_TOGGLE¶
Toggle the current cheat on/off.
- Arguments: None
CHEAT_INDEX_PLUS¶
Select the next cheat.
- Arguments: None
CHEAT_INDEX_MINUS¶
Select the previous cheat.
- Arguments: None
Recording and Screenshots¶
Capture gameplay.
SCREENSHOT¶
Take a screenshot.
- Arguments: None
RECORDING_TOGGLE¶
Toggle video recording.
- Arguments: None
STREAMING_TOGGLE¶
Toggle video streaming.
- Arguments: None
Display and UI¶
Control display and interface settings.
TURBO_FIRE_TOGGLE¶
Toggle turbo fire mode.
- Arguments: None
GRAB_MOUSE_TOGGLE¶
Toggle mouse grab.
- Arguments: None
GAME_FOCUS_TOGGLE¶
Toggle game focus mode.
- Arguments: None
FULLSCREEN_TOGGLE¶
Toggle fullscreen mode.
- Arguments: None
UI_COMPANION_TOGGLE¶
Toggle the UI companion window.
- Arguments: None
Performance¶
Toggle performance-related features.
VRR_RUNLOOP_TOGGLE¶
Toggle variable refresh rate runloop.
- Arguments: None
RUNAHEAD_TOGGLE¶
Toggle run-ahead latency reduction.
- Arguments: None
PREEMPT_TOGGLE¶
Toggle preemptive frames.
- Arguments: None
FPS_TOGGLE¶
Toggle FPS display.
- Arguments: None
STATISTICS_TOGGLE¶
Toggle onscreen statistics.
- Arguments: None
AI_SERVICE¶
Trigger the AI service.
- Arguments: None
Netplay¶
Control netplay features.
NETPLAY_PING_TOGGLE¶
Toggle netplay ping display.
- Arguments: None
NETPLAY_HOST_TOGGLE¶
Toggle netplay hosting.
- Arguments: None
NETPLAY_GAME_WATCH¶
Toggle between playing and spectating.
- Arguments: None
NETPLAY_PLAYER_CHAT¶
Open the netplay chat.
- Arguments: None
NETPLAY_FADE_CHAT_TOGGLE¶
Toggle chat fade behavior.
- Arguments: None
Overlay¶
Control on-screen overlays.
OVERLAY_NEXT¶
Switch to the next overlay.
- Arguments: None
OSK¶
Toggle the on-screen keyboard.
- Arguments: None