Token-efficient Selenium for AI agents & humans
A short-lived CLI + long-lived daemon. Chrome, Edge, Firefox — aria snapshots keep token cost low.
npm install -g @browsers-cli/se-cliWhy 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.
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.
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.
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
100+ unit tests and 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.
Install
npm install -g @browsers-cli/se-cliOpen & snapshot
se-cli open https://example.com
se-cli snapshot
# - document:
# - heading "Example Domain" [level=1]
# - link "More information..." [ref=e1]Interact by ref
se-cli click e1
### Ran Selenium code
await driver.findElement(
By.css('[data-se-ref="e1"]')
).click();
se-cli closeEcosystem
Three packages that work together — pick the one that fits your workflow, or combine them all.
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-clise-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-mcpse-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 ExtensionsStart automating with fewer tokens
Install se-cli and let your agent drive any browser.