Loading...
Loading...
Browser automation for AI agents via PinchTab HTTP API and CLI — navigate, extract, fill forms, click, scrape, screenshot, export PDF.
npx skill4agent add hoangvantuan/claude-plugin pinchtab# Install (pick one)
curl -fsSL https://pinchtab.com/install.sh | bash
brew install pinchtab/tap/pinchtab
npm install -g pinchtab
# Start server (skip if already running)
pinchtab server &
curl -s http://localhost:9867/healthServer → Profile (prof_XXX) → Instance (inst_XXX) → Tab (tab_XXX) → Element Refs (e0, e1, e5)| Situation | Approach | Why |
|---|---|---|
| Hầu hết tasks | CLI | Đơn giản, không cần parse JSON, 1 lệnh = 1 hành động |
| Cần batch actions hoặc tích hợp script | HTTP API | Batch/macro endpoint giảm request overhead |
| Chỉ cần đọc nội dung trang | | Token-efficient nhất (~800 tokens) |
| Cần tương tác (click, fill) | | Compact interactive snapshot cho refs, rồi act |
| Sau khi thực hiện action | | Diff snapshot — chỉ lấy thay đổi, tiết kiệm token |
| Cần debug visual | | Token cost cao — chỉ dùng khi text/snap không đủ |
| Site có bot detection | Bật stealth trước | |
# 1. Navigate
pinchtab nav https://example.com
# 2. Read content (chọn 1)
pinchtab text # plain text — most efficient
pinchtab snap -ic # interactive elements only — for interaction
pinchtab quick <url> # navigate + snapshot in one command
# 3. Interact
pinchtab fill e3 "value" # fill field (clears first)
pinchtab click e5 # click element
pinchtab press Enter # keyboard key
# 4. Verify result
sleep 1 # wait for page update
pinchtab snap -d # diff snapshot — only changespinchtab tab new https://source.com # open new tab
pinchtab tab # list tabs with IDs
pinchtab tab tab_XXX # switch to tab
pinchtab tab close tab_XXX # close tabpinchtab config set security.allowUpload true # cho pinchtab upload
pinchtab config set security.allowDownload true # cho pinchtab download
pinchtab config set security.allowEvaluate true # cho pinchtab eval
pinchtab config set security.allowMacro true # cho POST /macro
pinchtab config set security.allowScreencast true # cho pinchtab screencastGET /api/configconfig.security.allowUploadsecurity.allowUploadpinchtab config setAction fail → re-snapshot (pinchtab snap -ic) → retry với ref mới| Lỗi | Xử lý |
|---|---|
| Element ref not found | Re-snapshot, dùng ref mới |
| Upload/Download/Eval fail | Bật security gate tương ứng (xem mục trên) |
| Server not running | |
| Instance won't start | Kiểm tra |
| Bot detection | |
| Variable | Purpose | Default |
|---|---|---|
| Server port | 9867 |
| API auth token (thêm | (none) |
| Headless mode | true |