pinch / plugin /README.md
AUXteam's picture
Upload folder using huggingface_hub
25b930c verified
# 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