LinuxCommandLibrary

kodi-send

Send commands to Kodi

TLDR

Quit Kodi

$ kodi-send [[-a|--action]] Quit
copy

Reboot the system
$ kodi-send [[-a|--action]] Reboot
copy

Send an action to a remote host
$ kodi-send --host [192.168.0.1] --port [9777] [[-a|--action]] [Quit]
copy

SYNOPSIS

kodi-send [-h --host=HOST] [-p --port=PORT] [-a --action=ACTION] [-j --jsonrpc=JSON] [--user=USER] [--pass=PASS] [-H --help]

PARAMETERS

-h, --host=HOST
    Target Kodi host (IP or hostname; default: 127.0.0.1)

-p, --port=PORT
    Webserver port (default: 8080)

-a, --action=ACTION
    Built-in action to send, e.g., 'PlayerControl(play)', 'Down', 'GUI.ShowNotification(message)'

-j, --jsonrpc=JSON
    Full JSON-RPC 2.0 request as string, e.g., '{"jsonrpc":"2.0","method":"Player.PlayPause","id":1}'

--user=USER
    Username for HTTP authentication (if enabled in Kodi)

--pass=PASS
    Password for HTTP authentication

-H, --help
    Display usage help

DESCRIPTION

kodi-send is a command-line utility included with Kodi, the open-source media center application. It enables users to remotely control a running Kodi instance by sending built-in actions or full JSON-RPC requests over the network. This is particularly useful for automation scripts, integrating Kodi with other tools, or performing quick operations without launching the GUI.

Key features include specifying the target host and port (defaults to localhost:8080), authentication support, and two primary modes: simple actions like 'Play', 'Pause', or 'GUI.ActivateWindow(Home)', and arbitrary JSON-RPC calls for advanced control such as querying playlists, navigating menus, or controlling playback. It communicates via HTTP to Kodi's webserver interface, which must be enabled in Kodi settings.

Common use cases involve home automation (e.g., triggering playback from scripts), monitoring media status, or simulating keypresses. It's lightweight, requires no additional dependencies beyond Kodi installation, and supports both IPv4 and IPv6 addresses.

CAVEATS

Kodi webserver must be enabled (Settings > Services > Control > Allow remote control via HTTP). Default port 8080 assumes standard config; JSON-RPC requires correct formatting or it fails silently. No SSL support; use only on trusted networks.

EXAMPLES

Play media: kodi-send --action='PlayMedia(/path/to/video.mkv)'
JSON-RPC notification: kodi-send -j '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Alert","message":"Hello Kodi!"},"id":1}'
Remote host: kodi-send -h 192.168.1.100 -p 8080 --action='PlayerControl(play)'

JSON-RPC DOCS

Refer to Kodi JSON-RPC API for methods/params. Actions mirror built-in Kodi keymaps.

HISTORY

Introduced in Kodi 14 (Helix) as 'xbmc-send', renamed to kodi-send in Kodi 15 (Isengard). Enhanced in Kodi 18 (Leia) with better JSON-RPC support and authentication. Actively maintained in current Kodi 20+ (Nexus) releases.

SEE ALSO

kodi(1), curl(1), nc(1)

Copied to clipboard