This package provides a Go library for the Roku External Control Protocol
go get github.com/alexhowarth/go-roku
// search for a Roku device on the local network
roku.Search()
// build a client
client := roku.NewClient("http://192.168.0.21:8060")
// build a client, overriding the default http.Client
httpClient := &http.Client{} // customise as required
client := roku.NewClient("http://192.168.0.21:8060", WithHttpClient(httpClient))
// information about the device
info, err := client.DeviceInfo()
// the active app
app, err := client.ActiveApp()
// all apps on the device
apps, err := client.Apps()
// launch the YouTube app with arguments
youtube := "837"
err := client.Launch(youtube, "yk8yvt5lWVc", "")
This package contains the command line tool roku-cli
To install and use it:
$ go install ./roku-cli
$ roku-cli --help
There are also pre-built binaries for various architectures here.
To extract certain data from the output, you might use jq.
Documentation for the API can be found at https://developer.roku.com