|
agent-browser for local Open Design preview validation: inspect rendered
state, click/type when requested, and capture one screenshot when visual evidence
matters. Keep the browser local-first unless the user explicitly asks for
external browsing.browser tab URL/title as the target. Treat user phrases like "this page",
"the current browser", "right-side tab", "extract the logo", "get the palette",
"take an element screenshot", or "check OG/a11y" as requests about that selected
tab unless the user names another target.command -v agent-browser
npm i -g agent-browser
agent-browser install
AGENT_BROWSER_CORE="${TMPDIR:-/tmp}/agent-browser-core.$$.md"
agent-browser skills get core > "$AGENT_BROWSER_CORE"
rg -n "cdp|connect|snapshot|screenshot|click|type|wait|get title|get url" "$AGENT_BROWSER_CORE"
agent-browser skills get core --full only when needed, and redirect it to
a temp file the same way.agent-browser get title and agent-browser get url.agent-browser snapshot before any extraction or click.agent-browser must attach to an existing CDP endpoint. Never run
agent-browser open before agent-browser connect; doing so can make the CLI
auto-launch Chrome and re-enter the crash path.od browser snapshot, daemon-cli.mjs browser snapshot, or
$OD_NODE_BIN $OD_BIN browser snapshot are not valid browser tools; they can be
misinterpreted as daemon startup and open an internal 127.0.0.1:<port> service
in the system browser. Use the external agent-browser CLI attached to CDP
instead.if ! curl -fsS http://127.0.0.1:9223/json/version | rg -q webSocketDebuggerUrl; then
open -na "Google Chrome" --args \
--remote-debugging-port=9223 \
--user-data-dir=/tmp/od-agent-browser-chrome \
--no-first-run \
--no-default-browser-check
for i in {1..20}; do
if curl -fsS http://127.0.0.1:9223/json/version | rg -q webSocketDebuggerUrl; then
break
fi
sleep 0.5
done
fi
curl -fsS http://127.0.0.1:9223/json/version | rg webSocketDebuggerUrl
agent-browser connect http://127.0.0.1:9223
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--remote-debugging-port=9223 \
--user-data-dir=/tmp/od-agent-browser-chrome \
--no-first-run \
--no-default-browser-check
DevToolsActivePort, report:
"Chrome crashed before CDP became available; start Chrome manually with
--remote-debugging-port and retry attach."--engine lightpanda unless
command -v lightpanda succeeds.export HOME=/tmp/agent-browser-home
export AGENT_BROWSER_SESSION=od-local-preview
CHROME_USER_DATA_DIR=/tmp/od-agent-browser-chrome
cleanup_agent_browser() {
pkill -f -- "--user-data-dir=${CHROME_USER_DATA_DIR}" 2>/dev/null || true
}
trap cleanup_agent_browser EXIT INT TERM
if ! curl -fsS http://127.0.0.1:9223/json/version | rg -q webSocketDebuggerUrl; then
open -na "Google Chrome" --args \
--remote-debugging-port=9223 \
--user-data-dir="$CHROME_USER_DATA_DIR" \
--no-first-run \
--no-default-browser-check
for i in {1..20}; do
if curl -fsS http://127.0.0.1:9223/json/version | rg -q webSocketDebuggerUrl; then
break
fi
sleep 0.5
done
fi
curl -fsS http://127.0.0.1:9223/json/version | rg webSocketDebuggerUrl
agent-browser connect http://127.0.0.1:9223
agent-browser open http://127.0.0.1:17573/
agent-browser get title
agent-browser get url
agent-browser snapshot
agent-browser screenshot /tmp/od-agent-browser.png
Open Design, current URL under 127.0.0.1:17573,
visible Open Design UI text in the snapshot, and a screenshot at
/tmp/od-agent-browser.png.agent-browser is installed.open -na if needed.agent-browser connect http://127.0.0.1:9223.agent-browser skills get electron > "${TMPDIR:-/tmp}/agent-browser-electron.$$.md"
agent-browser skills get slack > "${TMPDIR:-/tmp}/agent-browser-slack.$$.md"
agent-browser skills get dogfood > "${TMPDIR:-/tmp}/agent-browser-dogfood.$$.md"
agent-browser skills get vercel-sandbox > "${TMPDIR:-/tmp}/agent-browser-vercel-sandbox.$$.md"
agent-browser skills get agentcore > "${TMPDIR:-/tmp}/agent-browser-agentcore.$$.md"
agent-browser skills list