Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

cli-anything-browser — Claude Code skill: features and setup

This skill maps Chrome's Accessibility Tree to a virtual filesystem. Agents navigate pages, inspect elements, and click buttons with standard terminal commands.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add HKUDS/CLI-Anything --skill cli-anything-browser -a claude-code
Open on GitHub

What cli-anything-browser does

The tool bridges command-line interaction with the DOMShell MCP server. Web accessibility trees turn into virtual directories and files. The agent traverses page structure with fs ls and fs cd, reads text with fs cat, and searches strings via fs grep. Page interactions run through the act group, handling clicks and typing into inputs via element paths like /main/button[0].

Cold starts add 1 to 3 seconds to each standalone command. To avoid this overhead during multi-step runs, the CLI provides a daemon mode via session daemon-start. It maintains a persistent MCP connection across calls. The --json flag formats output into clean JSON objects for agent parsing.

Running Chrome with the DOMShell extension active is mandatory before issuing commands. If Chrome is closed or the extension is missing, MCP calls fail immediately. Your environment also requires Node.js, npx, and Python 3.10+.

What it helps with

  • inspect web page accessibility trees using filesystem commands
  • click buttons and fill input forms using element paths
  • extract structured accessibility trees in JSON format for language models
  • remove cold start latency across multi-step browser tasks

Example prompts for the agent

  • Open the target page with cli-anything-browser page open <url> and find the button using fs grep
  • Run cli-anything-browser session daemon-start and fill the login form with act type
  • Inspect the page structure in JSON format using cli-anything-browser --json fs ls /

How to install cli-anything-browser

1Skills CLI (Vercel)

npx skills add HKUDS/CLI-Anything --skill cli-anything-browser -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-anything-browser/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-anything-browser/

From the same set18

The whole set →
cli-hub-meta-skill HKUDS A skill that gives agents a catalog of professional command-line tools built for AI. Search, install, and run CLIs for video, design, AI, and development without leaving your editor. Claude Code CX Codex Cursor +1 5,300installs cli-anything HKUDS Builds a Python harness with Click commands for any GUI application or repository. Generates REPL, tests, and docs following the CLI-Anything methodology. Claude Code CX Codex Cursor +1 2,100installs cli-anything-blender HKUDS A skill that adds a stateful command-line interface for editing Blender 3D scenes. Use it when an agent needs to assemble a scene, assign materials, or render a frame without manual clicking. Claude Code CX Codex Cursor +1 941installs cli-anything-obsidian HKUDS Manage an Obsidian vault from the terminal: read, create, search, and update notes or run editor commands. It suits agents that need to work without the GUI. Claude Code CX Codex Cursor +1 917installs cli-anything-notebooklm HKUDS Experimental harness to manage Google NotebookLM through a local CLI. It lets agents list notebooks, query sources, generate artifacts, and download files. Claude Code CX Codex Cursor +1 801installs cli-anything-libreoffice HKUDS Skill for creating and editing Writer, Calc, and Impress documents from the CLI without a GUI. Produces real ODF files (ZIP with XML) — useful when an AI agent needs to assemble a report, spreadsheet, or presentation programmatically. Claude Code CX Codex Cursor +1 669installs cli-anything-drawio HKUDS A command-line harness over Draw.io: the skill hands your agent commands to build a diagram step by step and export it to PNG, PDF or SVG. Claude Code CX Codex Cursor +1 666installs cli-anything-freecad HKUDS Turns FreeCAD into a scriptable CLI for your agent: 258 commands for primitives, sketches, PartDesign features and headless export. Claude Code CX Codex Cursor +1 643installs

Similar

browser-form-fill ruvnet Fills web forms using a structured JSON field map and saved selector templates. It automates data entry and form submission directly in browser sessions. Claude Code CX Codex Cursor +1 717installs browser-extract ruvnet Pulls text, tables and attribute values off a rendered page as structured JSON, with PII and prompt-injection checks running before anything reaches the model. Claude Code CX Codex Cursor +1 697installs browser-auth-flow ruvnet Drives your login flow once, then probes it for redirect leaks, missing CSRF tokens, weak session cookies and OAuth mistakes. Writes a findings.md with a verdict. Claude Code CX Codex Cursor +1 689installs browser ruvnet Automates web browsers using agent-browser and accessibility snapshots. It cuts LLM context size by 93% using element references instead of full DOM trees. Claude Code CX Codex Cursor +1 674installs tavily-dynamic-search tavily-ai Tavily search skill with context isolation. Saves large web payloads to local disk and filters them before sending snippets into the agent context. Claude Code CX Codex Cursor +1 13,400installs firecrawl-research-papers firecrawl Discovers and synthesizes academic literature using Firecrawl Research. Builds structured reviews from PubMed, bioRxiv, medRxiv, and arXiv papers. Claude Code CX Codex Cursor +1 33,800installs agent-browser vercel-labs A CLI skill for browser control: it opens pages, fills forms, clicks buttons, and tests web apps. Use it when an agent needs to act inside a website. Claude Code CX Codex Cursor +1 1,200,000installs webapp-testing official anthropics This skill tests local web apps with Playwright, helping agents debug UI behavior, capture screenshots, and inspect browser logs. Claude Code Claude.ai 186,758installs

Questions about cli-anything-browser

How do I install cli-anything-browser in Claude Code?

Run npx skills add HKUDS/CLI-Anything --skill cli-anything-browser -a claude-code. Ensure Node.js, npx, and Python 3.10+ are installed.

What does cli-anything-browser do?

It maps Chrome's accessibility tree to a virtual filesystem. Agents browse page elements with cd and ls, inspect nodes with cat, and trigger interactions using click and type.

Why do commands fail with an MCP connection error?

Calls fail if Chrome is not running or lacks the DOMShell extension. Chrome must be open with the extension enabled before executing CLI commands.

Source text

SKILL.md · Apache-2.0
---
name: "cli-anything-browser"
description: "Browser automation CLI using DOMShell MCP server. Maps Chrome's Accessibility Tree to a virtual filesystem for agent-native navigation."
---

# cli-anything-browser

A command-line interface for browser automation using [DOMShell](https://github.com/apireno/DOMShell)'s MCP server. Navigate web pages using filesystem commands: `ls`, `cd`, `cat`, `grep`, `click`.

## Installation

### Prerequisites

1. **Node.js and npx** (for DOMShell MCP server):
   ```bash
   # Install Node.js from https://nodejs.org/
   npx --version
   ```

2. **Chrome/Chromium** with [DOMShell extension](https://chromewebstore.google.com/detail/domshell-browser-filesy/okcliheamhmijccjknkkplploacoidnp):
   - Install extension in Chrome
   - Ensure Chrome is running before using CLI

3. **Python 3.10+**

### Install CLI

```bash
cd browser/agent-harness
pip install -e .
```

## Command Groups

### `page` — Page Navigation

- `page open <url>` — Navigate to URL
- `page reload` — Reload current page
- `page back` — Navigate back in history
- `page forward` — Navigate forward in history
- `page info` — Show current page info

### `fs` — Filesystem Commands (Accessibility Tree)

- `fs ls [path]` — List elements at path
- `fs cd <path>` — Change directory
- `fs cat [path]` — Read element content
- `fs grep <pattern> [path]` — Search for text pattern
- `fs pwd` — Print working directory

### `act` — Action Commands

- `act click <path>` — Click an element
- `act type <path> <text>` — Type text into input

### `session` — Session Management

- `session status` — Show session state
- `session daemon-start` — Start persistent daemon mode
- `session daemon-stop` — Stop daemon mode

## Usage Examples

### Basic Navigation

```bash
# Open a page
cli-anything-browser page open https://example.com

# Explore structure
cli-anything-browser fs ls /
cli-anything-browser fs cd /main
cli-anything-browser fs ls

# Go back to root
cli-anything-browser fs cd /
```

### Search and Click

```bash
cli-anything-browser fs grep "Login"
cli-anything-browser act click /main/button[0]
```

### Form Fill

```bash
cli-anything-browser act type /main/input[0] "[email protected]"
cli-anything-browser act click /main/button[0]
```

### JSON Output

```bash
cli-anything-browser --json fs ls /
```

### Daemon Mode (Faster Interactive Use)

```bash
# Start persistent connection
cli-anything-browser session daemon-start

# Run commands (uses persistent connection)
cli-anything-browser fs ls /
cli-anything-browser fs cd /main

# Stop daemon when done
cli-anything-browser session daemon-stop
```

### Interactive REPL

```bash
cli-anything-browser
```

## Path Syntax

DOMShell uses a filesystem-like path for the Accessibility Tree:

```
/                           — Root (document)
/main                       — Main landmark
/main/div[0]                — First div in main
/main/div[0]/button[2]      — Third button in first div
```

- Array indices are **0-based**: `button[0]` is the first button
- Use `..` to go up one level
- Use `/` for root

## Agent-Specific Guidance

### JSON Output for Parsing

All commands support `--json` flag for machine-readable output:

```bash
cli-anything-browser --json fs ls /
```

Returns:
```json
{
  "path": "/",
  "entries": [
    {"name": "main", "role": "landmark", "path": "/main"}
  ]
}
```

### Error Handling

The CLI provides clear error messages for common issues:

- **npx not found**: Install Node.js from https://nodejs.org/
- **DOMShell not found**: Run `npx @apireno/domshell --version`
- **MCP call failed**: Install DOMShell Chrome extension

Check `is_available()` return value before running commands.

### Daemon Mode for Efficiency

For agent workflows with multiple commands, use daemon mode:

1. Start daemon: `cli-anything-browser session daemon-start`
2. Run commands: Each command reuses the MCP connection
3. Stop daemon: `cli-anything-browser session daemon-stop`

This avoids the 1-3 second cold start overhead for each command.

## Links

- [DOMShell GitHub](https://github.com/apireno/DOMShell)
- [CLI-Anything](https://github.com/HKUDS/CLI-Anything)
- [Issue #90](https://github.com/HKUDS/CLI-Anything/issues/90)

## Security Considerations

**IMPORTANT**: When using this CLI with AI agents, be aware of the following security considerations:

### URL Restrictions
The browser harness validates all URLs before navigation:
- **Explicit scheme required**: URLs must include `http://` or `https://` scheme (scheme-less URLs like `example.com` are rejected)
- **Blocked schemes**: `file://`, `javascript://`, `data://`, `vbscript://`, `about://`, `chrome://`, and browser-internal schemes
- **Allowed schemes**: `http://` and `https://` only (configurable via `CLI_ANYTHING_BROWSER_ALLOWED_SCHEMES`)
- **Private network blocking**: Optional via `CLI_ANYTHING_BROWSER_BLOCK_PRIVATE=true` (disabled by default)

### DOM Content Risks
The Accessibility Tree includes all visible and hidden elements on a page. Malicious websites could:
- Use aria-hidden elements to inject content not visible to users
- Create confusing DOM structures that mislead navigation

**Mitigation**: When interacting with untrusted websites, consider:
1. Using the `--json` flag for structured output that's easier to parse safely
2. Sanitizing or filtering DOM content before including it in prompts
3. Limiting navigation to trusted domains

### Private Network Access
By default, the browser can access localhost and private networks (192.168.x.x, 10.x.x.x, etc.). To block:
```bash
export CLI_ANYTHING_BROWSER_BLOCK_PRIVATE=true
cli-anything-browser page open http://localhost:8080  # Will be blocked
```

### Session Isolation
Multiple browser sessions share the same Chrome instance. Cookies and authentication state may persist across sessions. For sensitive operations, consider:
1. Using Chrome's guest mode or incognito
2. Clearing cookies between sessions
3. Using separate Chrome profiles for different security contexts

© HKUDS · Apache-2.0 · HKUDS/CLI-Anything

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor