# Electron App Automation

Drives a local OmniRush Electron app over CDP for UI smoke tests.

- Repository: https://github.com/omnirush-ai/omnirush-gui (4595 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add omnirush-ai/omnirush-gui --skill browser-automation -g -a claude-code -y`
Codex: `npx skills add omnirush-ai/omnirush-gui --skill browser-automation -g -a codex -y`
Cursor: `npx skills add omnirush-ai/omnirush-gui --skill browser-automation -g -a cursor -y`
Gemini CLI: `npx skills add omnirush-ai/omnirush-gui --skill browser-automation -g -a gemini-cli -y`

## Description

Local OmniRush.ai Electron browser automation with CDP. Use when driving a local Electron dev app, browser_list, browser_snapshot, browser_eval, composer automation, or local UI smoke tests.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Browser Automation

For verdicts, do not drive CDP by hand, write or run an `evals/specs` test (`write-a-spec`, `run-tests`). This skill is for exploration and debugging only.

## What I Do

- Attach OpenCode browser tools to the OmniRush.ai Electron app during local development.
- Drive the app UI through Electron's Chrome DevTools Protocol endpoint.
- Send a task/session from the composer and confirm the response in the UI.

## Local Dev Setup

`pnpm dev` enables Electron CDP by default:

```sh
OMNIRUSH_ELECTRON_REMOTE_DEBUG_PORT=${OMNIRUSH_ELECTRON_REMOTE_DEBUG_PORT:-9823}
```

The default browser URL for OpenCode browser tools is:

```text
http://127.0.0.1:9823
```

The app UI normally loads at:

```text
http://localhost:5173/
```

To use a different CDP port, launch with an override:

```sh
OMNIRUSH_ELECTRON_REMOTE_DEBUG_PORT=9830 pnpm dev
```

To disable Electron CDP for a run:

```sh
OMNIRUSH_ELECTRON_REMOTE_DEBUG_PORT=0 pnpm dev
```

## Background Launch

Use a detached launch when the user wants the app running in the background:

```sh
nohup pnpm dev > /tmp/omnirush-dev.log 2>&1 &
```

Then wait for the CDP port:

```sh
lsof -nP -iTCP:9823 -sTCP:LISTEN
```

## Browser Tool Flow

1. List targets with `browser_list` using `browser_url: "http://127.0.0.1:9823"`.
2. Select the `OmniRush.ai` target ID.
3. Read state with `browser_eval` or `browser_snapshot`.
4. Fill the Lexical composer by targeting `[contenteditable="true"][data-lexical-editor="true"]`.
5. Click the `Run task` button.
6. Confirm the session response by checking `document.body.innerText` or the current URL.

## Send A Session

Use this `browser_eval` pattern after selecting the OmniRush.ai target:

```js
(() => {
  const editor = document.querySelector('[contenteditable="true"][data-lexical-editor="true"]');
  if (!editor) return { ok: false, reason: 'editor not found' };

The rest: https://github.com/omnirush-ai/omnirush-gui/blob/HEAD/.opencode/skills/browser-automation/SKILL.md
