Token-efficient Selenium
for AI agents & humans

A short-lived CLI + long-lived daemon. Chrome, Edge, Firefox — aria snapshots keep token cost low.

Get Started
$ npm install -g @browsers-cli/se-cli

Why se-cli?

Selenium MCP implementations burn tokens — heavy schemas, full accessibility dumps, no CLI. se-cli borrows the proven architecture from playwright-cli and ports it to the Selenium ecosystem.

The Problem

Selenium MCP loads ~5KB of schema per call. Full accessibility tree is returned every time. No CLI — agents are forced through verbose JSON-RPC envelopes.

The Solution

A short-lived CLI sends one JSON line to a long-lived daemon. Aria snapshots return compact YAML with element refs. Every action emits reusable Selenium code.

Token Efficiency

How much context does each approach burn per interaction? Real numbers from typical agent workflows.

Selenium MCP ~5,000 tokens / call
5,000
Raw WebDriver API ~2,000 tokens / call
2,000
se-cli ~400 tokens / call
400
12.5×
fewer tokens vs MCP
fewer tokens vs raw API
5KB
schema eliminated

Features

Everything you need to drive a browser from a shell or an AI agent.

10× fewer tokens

Compact aria snapshots with refs (e1, e2) instead of full accessibility tree dumps. Schemas never enter the agent's context.

🌐

Multi-browser

Chrome, Edge, and Firefox supported out of the box. One CLI, three browsers, single session or parallel named sessions.

🔄

Session persistence

The daemon holds the WebDriver across CLI calls. No browser restart per command. No driver reconnect overhead.

🏷️

Named sessions

Run multiple browsers in parallel with -s=name. Isolate contexts, switch between sessions, close them all at once.

🤖

Agent-agnostic

Works with any AI agent that runs shell commands — Claude Code, Cursor, Copilot CLI. Drop in SKILL.md and go.

📝

Code generation

Every action emits the equivalent Selenium code. Copy directly into your test files — no translation step.

🎯

Aria snapshots

YAML representation of the page following W3C ARIA roles. Interactive elements get refs you can act on by name.

🔌

CDP attach

Attach to a running Chrome via --cdp=<url>. Inspect real sessions, debug real state.

🧪

Tested & CI-ready

102 unit tests + 30 integration tests. GitHub Actions matrix across OS and browsers. npm publish on release.

Quick Start

Install, open a page, snapshot, interact — in under a minute.

1

Install

bash
npm install -g @browsers-cli/se-cli
2

Open & snapshot

bash
se-cli open https://example.com
se-cli snapshot
# - document:
#   - heading "Example Domain" [level=1]
#   - link "More information..." [ref=e1]
3

Interact by ref

bash
se-cli click e1

### Ran Selenium code
await driver.findElement(
  By.css('[data-se-ref="e1"]')
).click();

se-cli close

Explore

Documentation, roadmap, and live test pages — everything you need to go deeper.

Ecosystem

Three packages that work together — pick the one that fits your workflow, or combine them all.

npm v0.7.1

se-cli

The core CLI + daemon. Drives Chrome, Edge, and Firefox with aria snapshots and element refs. Works with any shell or AI agent.

npm i -g @browsers-cli/se-cli
npm v0.1.0

se-mcp

Thin MCP server wrapper. Exposes 50+ browser automation tools to VS Code, Claude Desktop, Cursor, and any MCP-aware client via stdio.

npx @browsers-cli/se-mcp
VS Code v0.1.3

se-extension-vscode

VS Code extension with a browser panel, status bar, one-click commands, and automatic MCP server registration for Copilot agents.

Search "se-cli" in Extensions

Start automating with fewer tokens

Install se-cli and let your agent drive any browser.