Skip to content
Agentmart
Submit a tool

browser4-cli

Browser automation CLI for AI agents — Chrome/Chromium via CDP with accessibility-tree snapshots.

Skill by awaku7

IndexedApache-2.0★ 12
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/awaku7-browser4-cli

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Browser automation CLI for AI agents — Chrome/Chromium via CDP with accessibility-tree snapshots. Navigate, interact, extract, crawl, swarm, and loop. Covers every CLI command with decision trees and copy-paste templates.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/browser4-cli

Tools it pre-approves 1

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash(browser4-cli:*)

What's inside

Skill name
browser4-cli
Description
Browser automation CLI for AI agents — Chrome/Chromium via CDP with accessibility-tree snapshots. Navigate, interact, extract, crawl, swarm, and loop. Covers every CLI command with decision trees and copy-paste templates.
License
Apache-2.0
Allowed tools
Bash(browser4-cli:*)
Instructions
563 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Agent Skills spec issues

  • body: 563 lines (spec recommends under 500)

Files (5)

  • SKILL.md
  • agent.md · references/
  • crawl.md · references/
  • htmlsnapshot.md · references/
  • x-sql.md · references/

SKILL.md (first lines)

# Browser Automation with browser4-cli

Browser4 CLI is a **coroutine-safe, high-performance browser automation engine** for AI agents.
It uses Chrome DevTools Protocol (CDP) with accessibility-tree snapshots for element interaction
and raw HTML snapshots for data extraction.

- **Session management**: auto-open/reconnect browsers, named sessions, attach to existing Chrome
- **Element interaction**: click, fill, type, press, select, check, uncheck, drag — all via accessibility refs
- **Data extraction**: CSS selectors, X-SQL queries, regex grep, LLM-powered extraction
- **Bulk processing**: recursive crawl, parallel swarm, repeated loop
- **Output modes**: human-readable, JSON (`--json`), quiet (`--quiet`)

## Quick Reference: Command Families

| Family | Purpose | Key commands |
|--------|---------|-------------|
| Session | Start/stop/reuse browser sessions | `open`, `goto`, `close`, `close-all`, `kill-all`, `attach`, `list`, `status` |
| Navigation | Move between pages | `goto <url>`, `go-back`, `go-forward`, `reload` |
| Snapshot | Capture page structure (accessibility tree) | `snapshot [-v N] [--auto-diff]`, `snapshot grep <pattern>` |
| Interaction | Click, type, fill forms | `click <ref>`, `fill <ref> <value>`, `type <ref> <text>`, `press <key>`, `select`, `check`, `uncheck`, `drag` |
| Extract (CSS) | Extract data via CSS selectors | `htmlsnapshot`, `htmlsnapshot get text/html/attr <selector>`, `get all`, `grep`, `inspect` |
| Extract (X-SQL) | Structured multi-field extraction | `htmlsnapshot query --sql "SELECT ..."` |
| Extract (AI) | Natural-language extraction | `extract "..."`, `summarize`, `agent run "..."` |
| Bulk | Multi-page traversal | `crawl`, `swarm`, `loop` |
| Storage | Cookies, localStorage, sessionStorage | `state-save`, `state-load`, `cookie-get`, `cookie-set`, `local-storage-*`, `session-storage-*` |
| Visual | Screenshots, viewport control | `screenshot [--filename f.png]`, `scroll`, `wait`, `resize`, `tab-*` |
| Script | Execute JS in page | `eval "JS code" [--json]` |

---

## 1. Core Loop (Copy-Paste Template)

Every browser4-cli session follows this pattern:

```bash
# 1. NAVIGATE — auto-opens/reconnects session
browser4-cli goto "https://example.com"

# 2. SNAPSHOT — capture accessibility tree with refs
browser4-cli snapshot -v 0

# 3. INTERACT — use refs from snapshot
browser4-cli fill <ref> "<value>"
browser4-cli press Enter

# 4. RE-SNAPSHOT — verify changes
browser4-cli wait --load networkidle
browser4-cli snapshot -v 0 --auto-diff

# 5. EXTRACT — get data
browser4-cli htmlsnapshot get text "<css-selector>" --all
```

---

## 2. Session & Lifecycle

### Named Sessions

Isolate browser state (cookies, localStorage, tabs) with `-s <name>`:

```bash
browser4-cli -s mysession goto "https://example.com"
browser4-cli -s mysession snapshot
browser4-cli -s mysession close
```

`goto` auto-opens/reconnects — you rarely need to manage sessions manually.

### Session Commands

```bash
# Open a new session (optionally with URL)
browser4-cli open [url] [--headed|--headless] [--profile <path>] [--profile-mode <mode>]

# Navigate — auto-opens if no session exists
browser4-cli goto <url>

# Attach to an existing Chrome/Edge via CDP
browser4-cli attach --cdp chrome                # by channel name
browser4-cli attach --cdp http://localhost:9222   # by CDP URL
browser4-cli attach --cdp 9222                    # by port

# Close
browser4-cli close                                 # current session
browser4-cli close-all                              # all sessions (keep backend)
browser4-cli kill-all                               # stop backend + kill all processes

# Status & list
browser4-cli status                                 # server health, version
browser4-cli list [--all]                           # session list with reuse/refresh status
browser4-cli stop                                   # gracefully stop server
browser4-cli delete-data                            # delete session data
```

### Browser Profile Management

```bash
# Create a profile (e.g., for persistent login)
browser4-cli open --profile /path/to/profile --profile-mode persistent
```

---

## 3. Navigation

```bash
browser4-cli goto <url>          # Navigate — auto-opens session
browser4-cli go-back             # Previous page
browser4-cli go-forward          # Next page
browser4-cli reload              # Reload current page
```

---

## 4. Snapshot (Accessibility Tree)

Captures a YAML accessibility tree with element refs for interaction.

From awaku7/agentcli, Apache-2.0.

More from awaku7/agentcli

Signals

Stars
12
Forks
2
Open issues
1
Last commit (this folder)
Aug 6, 2026 (2 months ago)
Last release
Oct 24, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from awaku7

Cite this page

browser4-cli skill. Agent Mart. https://agentmart.dev/skills/awaku7-browser4-cli (last updated 2026-10-24)