pnpm add -D @putdotio/rokitrokit wraps Roku platform primitives for live-device proof loops. It does not
own app-specific journeys, content IDs, credentials, or product assertions.
Create .rokit/.env or export environment variables in the app repo:
ROKIT_TARGET=<roku-ip>
ROKIT_PASSWORD=<developer-mode-password>Then run:
pnpm exec rokit check
pnpm exec rokit launch dev
pnpm exec rokit press Down Select
pnpm exec rokit press --delay-ms 250 Right Select
pnpm exec rokit query /query/active-app
pnpm exec rokit wait-node videoPlayerScreen visible
pnpm exec rokit screenshot artifacts/live/player.png
pnpm exec rokit --json active-appApp-specific scenario scripts can also import the generic helpers:
import {
assertNamedNodeState,
assertNamedNodeTranslation,
assertSceneGraphNode,
pressKey,
querySceneGraph,
waitForSceneGraphAssertion,
type RokuContext,
} from "@putdotio/rokit";
const target = process.env.ROKIT_TARGET;
if (!target) {
throw new Error("ROKIT_TARGET is not set");
}
const context: RokuContext = {
target,
timeoutMs: 10_000,
username: "rokudev",
};
await pressKey(context, "Info");
const xml = await querySceneGraph(context, { attempts: 3 });
await assertSceneGraphNode(context, "videoPlayerScreen", { state: "visible" });
assertNamedNodeTranslation(xml, "videoPlayerScreen", 0, 0);
await waitForSceneGraphAssertion(context, "expected player", (xml) => {
assertNamedNodeState(xml, "videoPlayerScreen", "visible");
});rokit check
rokit device-info
rokit active-app
rokit wait-active <app-id> [--timeout-ms <ms>]
rokit launch <app-id> [--param key=value]
rokit press [--delay-ms <ms>] <key> [key...]
rokit query <ecp-path>
rokit sgnodes
rokit assert-node <node-name> <visible|hidden|absent|text|attr> [value]
rokit wait-node <node-name> <visible|hidden|absent|text|attr> [value] [--timeout-ms <ms>]
rokit screenshot <output-path>
rokit install <zip-path>
rokit --versionGlobal options:
rokit --json <command>
rokit --output json <command>JSON mode wraps command output as { "status": "ok", "command": "...", ... }
and reports failures as { "status": "failed", "error": { "message": "..." } }.
checkconfirms the Roku ECP endpoint responds and the developer installer is reachable.device-infoprints enhanced Roku device metadata as JSON.active-appprints the foreground app.wait-activewaits until the requested app is foregrounded and tolerates transient ECP read failures while polling.launchopens an app and waits until it is active. Use repeated--paramvalues for deeplink parameters. Roku launch responses can race app startup, so launch accepts transient timeout/fetch failures and then verifies foreground state.presssends Roku remote keys through ECP. Use--delay-msfor navigation sequences that need a stable gap between keys.queryprints a raw ECP response such as/query/sgnodes/all.sgnodesprints the raw SceneGraph tree from/query/sgnodes/all. Library callers can pass retry options toquerySceneGraph.assert-nodechecks a named SceneGraph node once.wait-nodepolls SceneGraph until a named node condition matches.screenshotsaves a developer screenshot. It requiresROKIT_PASSWORD.installpublishes an existing ZIP throughroku-deploy. It requiresROKIT_PASSWORD.
ROKIT_TARGET=<roku-ip>
ROKIT_PASSWORD=<developer-mode-password>
ROKIT_USERNAME=rokudev
ROKIT_TIMEOUT_MS=10000ROKU_DEV_TARGET and ROKU_DEV_PASSWORD are accepted as fallbacks for app
repos that already use Roku dev naming.
Keep .rokit/ local. Device IPs, Developer Mode passwords, signing keys, user
tokens, and app-specific media identifiers do not belong in git.
rokit is the generic Roku harness layer:
- device info
- install/publish
- launch and deeplink parameters
- remote keypresses
- raw ECP queries
- SceneGraph state queries and named-node assertions
- SceneGraph attribute, numeric geometry, bounds, and translation readers
- SceneGraph geometry assertions, status/failure readers, and custom assertion wait loops
- screenshots
App repositories should keep their own scenario commands for product behavior, such as opening a specific route, asserting playback state, generating review HTML, or checking app-specific UI nodes.
