| name | electron-inspect |
| description | Inspect and interact with the running GameLord Electron app using agent-browser |
Electron App Inspection with agent-browser
GameLord's dev server exposes Chrome DevTools Protocol on port 9222 by default (configurable via CDP_PORT env var). Use agent-browser to connect, take screenshots, inspect the DOM, interact with UI elements, and record videos — all without leaving the terminal.
Prerequisites
agent-browser installed (brew install agent-browser && agent-browser install)
- GameLord dev server running (
pnpm dev from repo root)
Quick Start
agent-browser connect 9222
agent-browser tab list
agent-browser tab 2
agent-browser snapshot -i
agent-browser screenshot /tmp/gamelord-screenshot.png
Core Workflow
Inspect UI State
agent-browser snapshot -i
agent-browser get text "@e5"
agent-browser get styles "@e5"
agent-browser get box "@e5"
Interact with the App
agent-browser click "@e5"
agent-browser fill "@e3" "Super Mario Bros"
agent-browser press "Enter"
agent-browser scroll down 500
agent-browser hover "@e5"
Screenshots
agent-browser screenshot /tmp/gamelord.png
agent-browser screenshot /tmp/gamelord-after.png
agent-browser diff screenshot --baseline /tmp/gamelord.png
Video Recording
agent-browser record start /tmp/gamelord-demo.webm
agent-browser record stop
Window Management
GameLord has multiple Electron windows (library, game). Each appears as a separate tab target:
agent-browser tab list
agent-browser tab 1
agent-browser tab 2
Evaluate JavaScript in the Renderer
agent-browser eval "document.title"
agent-browser eval "window.gamelord"
Network and Console
agent-browser console
agent-browser errors
agent-browser network requests
Tips
- Always
snapshot -i first to get element refs before clicking/typing.
- Re-snapshot after interactions — refs change when the DOM updates.
- Use
agent-browser tab list when the app has multiple windows open — the game window is a separate target.
- Screenshots go to
/tmp/ to keep the repo clean. Use descriptive filenames.
- CDP port defaults to 9222 — override with
CDP_PORT=9223 pnpm dev when running multiple instances.
- For PR screenshots, capture specific component states and include them in the PR body.