File size: 2,521 Bytes
25b930c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | # Pinchtab OpenClaw Plugin
Browser control for AI agents via [Pinchtab](https://pinchtab.com). Single-tool design β one `pinchtab` tool handles all browser operations. Minimal context bloat.
## Install
```bash
openclaw plugins install @pinchtab/pinchtab
openclaw gateway restart
```
## Prerequisites
```bash
# Start Pinchtab
pinchtab &
# With auth token (recommended)
PINCHTAB_TOKEN=my-secret pinchtab &
# Docker
docker run -d -p 9867:9867 ghcr.io/pinchtab/pinchtab:latest
```
## Configure
```json5
{
plugins: {
entries: {
pinchtab: {
enabled: true,
config: {
baseUrl: "http://localhost:9867",
token: "my-secret",
timeout: 30000,
},
},
},
},
agents: {
list: [{
id: "main",
tools: { allow: ["pinchtab"] },
}],
},
}
```
## Single Tool, All Actions
One tool definition, many actions β keeps context lean:
| Action | Description | Typical tokens |
|---|---|---|
| `navigate` | Go to URL | β |
| `snapshot` | Accessibility tree (refs for interactions) | ~3,600 (interactive) |
| `click/type/press/fill/hover/scroll/select/focus` | Act on element by ref | β |
| `text` | Extract readable text (cheapest) | ~800 |
| `tabs` | List/open/close tabs | β |
| `screenshot` | JPEG screenshot (vision fallback) | ~2K |
| `evaluate` | Run JavaScript in page | β |
| `pdf` | Export page as PDF | β |
| `health` | Check connectivity | β |
## Agent Usage Example
```
1. pinchtab({ action: "navigate", url: "https://pinchtab.com/search" })
2. pinchtab({ action: "snapshot", filter: "interactive", format: "compact" })
β Returns refs: e0, e5, e12...
3. pinchtab({ action: "click", ref: "e5" })
4. pinchtab({ action: "type", ref: "e5", text: "pinchtab" })
5. pinchtab({ action: "press", key: "Enter" })
6. pinchtab({ action: "snapshot", diff: true, format: "compact" })
β Only changes since last snapshot
7. pinchtab({ action: "text" })
β Readable results (~800 tokens)
```
**Token strategy:** `text` for reading, `snapshot` with `filter=interactive&format=compact` for interactions, `diff=true` on subsequent snapshots, `screenshot` only for visual verification.
## Security Notes
- **`evaluate`** executes arbitrary JavaScript in the page β restrict to trusted agents and domains
- Use `PINCHTAB_TOKEN` to gate API access; rotate regularly
- In production, run behind HTTPS reverse proxy (Caddy/nginx)
## Requirements
- Running Pinchtab instance (Go binary or Docker)
- OpenClaw Gateway
|