Skip to content

Commit 2abb9e7

Browse files
authored
Enable Browser testing (#319)
- Add agent-browser npm package (replaces aqua install in mise.toml) - Update mise.toml to expose node_modules/.bin on PATH - Add .agents/skills/agent-browser/SKILL.md for browser automation" - Add better bun dev scripts.
1 parent 59e8537 commit 2abb9e7

18 files changed

Lines changed: 1616 additions & 85 deletions
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: agent-browser
3+
description: Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
4+
allowed-tools: Bash(agent-browser:*), Bash(bunx agent-browser:*)
5+
hidden: true
6+
---
7+
8+
# agent-browser
9+
10+
Fast browser automation CLI for AI agents. Chrome/Chromium via CDP with
11+
accessibility-tree snapshots and compact `@eN` element refs.
12+
13+
## Start here
14+
15+
This file is a discovery stub, not the usage guide. Before running any
16+
`agent-browser` command, load the actual workflow content from the CLI:
17+
18+
```bash
19+
agent-browser skills get core # start here — workflows, common patterns, troubleshooting
20+
agent-browser skills get core --full # include full command reference and templates
21+
```
22+
23+
The CLI serves skill content that always matches the installed version,
24+
so instructions never go stale. The content in this stub cannot change
25+
between releases, which is why it just points at `skills get core`.
26+
27+
## Specialized skills
28+
29+
Load a specialized skill when the task falls outside browser web pages:
30+
31+
```bash
32+
agent-browser skills get electron # Electron desktop apps (VS Code, Slack, Discord, Figma, ...)
33+
agent-browser skills get slack # Slack workspace automation
34+
agent-browser skills get dogfood # Exploratory testing / QA / bug hunts
35+
agent-browser skills get vercel-sandbox # agent-browser inside Vercel Sandbox microVMs
36+
agent-browser skills get agentcore # AWS Bedrock AgentCore cloud browsers
37+
```
38+
39+
Run `agent-browser skills list` to see everything available on the
40+
installed version.
41+
42+
## Why agent-browser
43+
44+
- Fast native Rust CLI, not a Node.js wrapper
45+
- Works with any AI agent (Cursor, Claude Code, Codex, Continue, Windsurf, etc.)
46+
- Chrome/Chromium via CDP with no Playwright or Puppeteer dependency
47+
- Accessibility-tree snapshots with element refs for reliable interaction
48+
- Sessions, authentication vault, state persistence, video recording
49+
- Specialized skills for Electron apps, Slack, exploratory testing, cloud providers

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
3838
config/plexus.yaml
3939
config/*.db
4040
config/*.sqlite
41+
42+
# Local dev populate overrides (may contain real API keys)
43+
scripts/user-populate.json
4144
config/*.db*
4245

4346
CLIProxyApi/

CONTRIBUTING.md

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,85 @@ The pre-commit hook runs backend tests automatically.
7878

7979
## Development
8080

81+
### Starting the dev server
82+
8183
```bash
82-
# Start both backend and frontend in watch mode
8384
bun run dev
8485
```
8586

86-
The backend runs on port 4000 by default.
87+
This starts the backend (with file watching) and the frontend builder in parallel.
88+
89+
The port is derived automatically from the worktree directory name, so two
90+
worktrees can run simultaneously without collision. The port is printed at
91+
startup:
92+
93+
```
94+
Starting Plexus Dev Stack...
95+
PORT: 14641
96+
DATABASE_URL: sqlite:///tmp/plexus-browsertesting.db
97+
ADMIN_KEY: password
98+
```
99+
100+
Override any of these with environment variables:
101+
102+
```bash
103+
PORT=4000 ADMIN_KEY=mysecret bun run dev
104+
```
105+
106+
### Seeding baseline data
107+
108+
After starting the dev server, seed it with a realistic baseline configuration
109+
(providers, model aliases, quota definitions, and API keys) that exercises the
110+
full feature set without requiring any real external credentials:
111+
112+
```bash
113+
bun run populate-dev
114+
```
115+
116+
This is idempotent — safe to re-run at any time. It uses `PUT` throughout, so
117+
existing resources are replaced rather than duplicated.
118+
119+
#### What gets seeded
120+
121+
| Category | Count | Notes |
122+
|---|---|---|
123+
| Providers | 7 | Local (Ollama, LM Studio, llama.cpp) + mock cloud (OpenAI, Anthropic, Gemini, OpenRouter) |
124+
| Quotas | 7 | Rolling, daily, weekly windows; requests and token limits |
125+
| Model aliases | 16 | chat, embeddings, speech, transcriptions, image types; multi-target failover aliases |
126+
| API keys | 14 | Unrestricted, quota-enforced, provider-restricted, model-restricted |
127+
128+
All provider URLs point at `localhost` — no real API keys are needed by default.
129+
130+
#### Adding your own data
131+
132+
Create `scripts/user-populate.json` (git-ignored — see `scripts/user-populate.example.json`
133+
for the format). Anything in that file is merged over the defaults when you run
134+
`bun run populate-dev`, so you can add real provider keys or personal aliases
135+
without touching committed files and without risk of accidentally leaking secrets.
136+
137+
#### Environment variables
138+
139+
| Variable | Default | Purpose |
140+
|---|---|---|
141+
| `PLEXUS_URL` | `http://localhost` | Base URL of the target instance |
142+
| `PLEXUS_PORT` | derived from cwd | Port (matches `bun run dev` automatically) |
143+
| `PLEXUS_ADMIN_KEY` | `password` | Admin key |
144+
145+
### Resetting to a clean state
146+
147+
To wipe the database and restart the backend in one step:
148+
149+
```bash
150+
bun run clear-dev
151+
```
152+
153+
This deletes the SQLite file from `/tmp` and sends `SIGHUP` to the running dev
154+
server, which gracefully shuts down the backend and immediately relaunches it
155+
against the empty database. The frontend is unaffected. The whole cycle takes
156+
about two seconds.
157+
158+
After clearing, re-run `bun run populate-dev` to restore the baseline config.
159+
160+
> **Note:** `clear-dev` relies on a PID file written by `bun run dev` to
161+
> `/tmp/plexus-<worktree>.pid`. If the server is not running, it will delete
162+
> the database file and exit cleanly without error.

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)