← Back to PRs

#11692: feat: add standalone browser CLI for Linux users

by shipitirl open 2026-02-08 05:19 View on GitHub →
stale
# PR: Add standalone browser CLI for Linux users ## Related Issue Fixes #11691 (Browser `act` actions timeout on Linux) ## Summary Adds a standalone browser CLI tool that uses playwright-core directly via CDP, bypassing the action handler timeout issues on Linux systems (tested on Ubuntu 22.04/24.04). ## Changes - Added `packages/browser-cli/` with standalone browser control tool - Direct CDP connection to Chrome (no relay dependency for basic operations) - Commands: navigate, click, type, press, snapshot, screenshot, eval, fill, wait, info ## Usage ```bash # Install globally (optional) npm install -g @openclaw/browser-cli # Or use directly npx @openclaw/browser-cli navigate "https://example.com" npx @openclaw/browser-cli click "text=Submit" npx @openclaw/browser-cli type "input[name=email]" "user@example.com" npx @openclaw/browser-cli snapshot ``` ## Why This Approach The existing browser tool's `act` actions timeout on Ubuntu due to pointer event interception detection issues. Rather than deep-diving into the complex action handler, this CLI: 1. Uses playwright-core directly (same underlying library) 2. Connects via CDP to user's Chrome instance 3. Executes actions without the problematic wrapper layer 4. Provides same functionality agents need ## Testing Tested on: - [x] Ubuntu 24.04 + Chrome 133 - [x] Ubuntu 22.04 + Chrome 131 - [ ] macOS (should work, needs verification) - [ ] Windows (should work, needs verification) ## Example Session ```bash # Start Chrome with debugging google-chrome --remote-debugging-port=18800 --user-data-dir=/tmp/chrome-debug # Navigate and interact browser navigate "https://zapier.com" browser snapshot browser click "text=Sign In" browser type "input[type=email]" "user@example.com" browser press Enter ``` ## Backwards Compatibility - Non-breaking addition - Existing browser tool unchanged - Users can choose which tool to use <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds a new standalone package (`packages/browser-cli/`) that provides a `browser`/`openclaw-browser` CLI for driving an existing Chrome instance via Playwright CDP, intended as a workaround for Linux `act` action timeouts. The tool exposes commands like `navigate`, `click`, `type`, `press`, `snapshot`, `screenshot`, `eval`, `fill`, `wait`, and `info`, and prints JSON responses for scripting. <h3>Confidence Score: 3/5</h3> - Reasonably safe to merge once the CLI correctness issues are fixed. - New package is isolated and doesn’t modify existing browser tooling, but there are a couple of definite runtime/behavior issues (`eval` implementation and `fill` argument handling) plus a packaging concern (`playwright-core` declared as both dependency and peerDependency) that should be resolved to avoid broken CLI behavior and dependency conflicts. - packages/browser-cli/index.js, packages/browser-cli/package.json <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs