Documentation Index Fetch the complete documentation index at: https://mintlify.com/pinchtab/pinchtab/llms.txt
Use this file to discover all available pages before exploring further.
PinchTab CLI
The PinchTab CLI provides a powerful command-line interface for controlling Chrome browsers programmatically. Itβs designed for AI agents, automation scripts, and developers who need reliable browser control from the terminal.
Quick Start
Start the server
The server starts on port 9867 by default.
Navigate to a website
pinchtab nav https://example.com
Get page structure
Returns interactive elements in a compact, token-efficient format.
Interact with elements
pinchtab click e5
pinchtab type e12 "hello world"
pinchtab press Enter
Installation
PinchTab is distributed as a single binary. Download the latest release for your platform:
macOS (Intel)
macOS (Apple Silicon)
Linux
curl -L https://github.com/pinchtab/pinchtab/releases/latest/download/pinchtab-darwin-amd64 -o pinchtab
chmod +x pinchtab
sudo mv pinchtab /usr/local/bin/
Architecture
PinchTab operates in two main modes:
Dashboard Mode (Default)
When you run pinchtab without arguments, it starts a dashboard server that:
Manages multiple browser instances (profiles)
Provides a web UI at http://localhost:9867/dashboard
Exposes HTTP and WebSocket APIs
Orchestrates instance lifecycle
pinchtab
# Server starts on :9867
# Dashboard: http://localhost:9867/dashboard
CLI Mode
CLI commands communicate with the running dashboard server:
pinchtab nav https://github.com
pinchtab snap -i -c
pinchtab click e5
The CLI requires a running server. If no server is running, youβll see: β Pinchtab server is not running on http://127.0.0.1:9867
To start the server:
pinchtab # Run in foreground
pinchtab & # Run in background
Common Workflows
Basic Navigation and Interaction
# Terminal 1: Start server
pinchtab
# Terminal 2: Use CLI
pinchtab nav https://github.com/pinchtab/pinchtab
pinchtab snap -i -c | jq '.elements[] | select(.role=="link")'
pinchtab click e5
pinchtab screenshot -o screenshot.png
Multi-Instance Workflow
# Launch a headed instance
INST = $( pinchtab instance launch --mode headed | jq -r .id )
echo "Instance: $INST "
# Use the instance
pinchtab --instance $INST nav https://example.com
pinchtab --instance $INST snap -i
# Stop when done
pinchtab instance stop $INST
Profile Management
# List available profiles
pinchtab profiles
# Connect to a profile (get its URL)
pinchtab connect my-profile
# Returns: http://localhost:9868
# Use profile instance
URL = $( pinchtab connect my-profile --json | jq -r .url )
curl $URL /snapshot
All commands output JSON by default:
{
"format" : "compact" ,
"filter" : "interactive" ,
"elements" : [
{ "ref" : "e1" , "role" : "button" , "name" : "Sign in" },
{ "ref" : "e2" , "role" : "link" , "name" : "Documentation" },
{ "ref" : "e3" , "role" : "textbox" , "name" : "Search" }
]
}
Pipe through jq for filtering:
# Get all button references
pinchtab snap -i | jq -r '.elements[] | select(.role=="button") | .ref'
# Count interactive elements
pinchtab snap -i | jq '.elements | length'
# Find element by name
pinchtab snap -i | jq '.elements[] | select(.name | contains("Sign in"))'
Error Handling
The CLI uses standard exit codes:
Command completed successfully
Bad arguments, missing required parameters, or file not found
Server returned 500, connection refused, or network error
Request exceeded timeout limit
Instance, tab, or resource not found
Example error handling in scripts:
if ! pinchtab nav https://example.com ; then
echo "Navigation failed"
exit 1
fi
# Check exit code explicitly
pinchtab click e5
if [ $? -eq 4 ]; then
echo "Element not found"
fi
Help and Version
# Show help
pinchtab help
pinchtab --help
pinchtab -h
# Show version
pinchtab --version
pinchtab -v
Next Steps
Configuration Environment variables and config file setup
Server Commands Starting and managing the PinchTab server
Navigation Navigate to URLs and manage page loading
Snapshots Capture accessibility tree snapshots