File size: 3,352 Bytes
6a7089a | 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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | # Getting Started
Get PinchTab running in a few minutes, from zero to browser automation.
---
## Installation
### Option 1: one-liner
**macOS / Linux**
```bash
curl -fsSL https://pinchtab.com/install.sh | bash
```
Then verify:
```bash
pinchtab --version
```
### Option 2: npm
**Requires:** Node.js 18+
```bash
npm install -g pinchtab
pinchtab --version
```
### Option 3: Docker
**Requires:** Docker
```bash
docker run -d -p 9867:9867 pinchtab/pinchtab
curl http://localhost:9867/health
```
### Option 4: build from source
**Requires:** Go 1.25+, Git, Chrome/Chromium
```bash
git clone https://github.com/pinchtab/pinchtab.git
cd pinchtab
./dev doctor
go build -o pinchtab ./cmd/pinchtab
./pinchtab --version
```
**[Full build guide ->](architecture/building.md)**
## Shell Completion
After installation, you can generate shell completions from the CLI:
```bash
# Generate and install zsh completions
pinchtab completion zsh > "${fpath[1]}/_pinchtab"
# Generate bash completions
pinchtab completion bash > /etc/bash_completion.d/pinchtab
# Generate fish completions
pinchtab completion fish > ~/.config/fish/completions/pinchtab.fish
```
---
## Quick start
The normal flow is:
1. start the server
2. start an instance
3. navigate
4. inspect or act
### Step 1: start the server
```bash
pinchtab
# Response
🦀 PinchTab port=9867
dashboard ready url=http://localhost:9867
```
The server runs on `http://127.0.0.1:9867`.
You can open the dashboard at `http://127.0.0.1:9867` or `http://127.0.0.1:9867/dashboard`.
### Step 2: start your first instance
```bash
curl -s -X POST http://127.0.0.1:9867/instances/start \
-H "Content-Type: application/json" \
-d '{"mode":"headless"}' | jq .
# CLI Alternative
pinchtab instance start
# Response
{
"id": "inst_0a89a5bb",
"profileId": "prof_278be873",
"profileName": "instance-1741400000000000000",
"port": "9868",
"headless": true,
"status": "starting"
}
```
### Step 3: navigate
```bash
curl -s -X POST http://127.0.0.1:9867/navigate \
-H "Content-Type: application/json" \
-d '{"url":"https://github.com/pinchtab/pinchtab"}' | jq .
# CLI Alternative
pinchtab nav https://github.com/pinchtab/pinchtab
# Response
{
"tabId": "CDP_TARGET_ID",
"title": "GitHub - pinchtab/pinchtab",
"url": "https://github.com/pinchtab/pinchtab"
}
```
### Step 4: inspect the page
```bash
curl -s "http://127.0.0.1:9867/snapshot?filter=interactive" | jq .
# CLI Alternative
pinchtab snap -i -c
# Response
{
"nodes": [
{ "ref": "e0", "role": "link", "name": "Skip to content" },
{ "ref": "e14", "role": "button", "name": "Search or jump to…" }
]
}
```
You now have a working PinchTab server, a running browser instance, and a navigated tab.
---
## Troubleshooting
### Connection refused
```bash
curl http://localhost:9867/health
```
If that fails, start the server:
```bash
pinchtab
```
### Port already in use
```bash
pinchtab config set server.port 9868
pinchtab
```
### Chrome not found
```bash
# macOS
brew install chromium
# Linux (Ubuntu/Debian)
sudo apt install chromium-browser
# Custom Chrome binary (set in config)
pinchtab config set browser.chromeBinary /path/to/chrome
```
---
## Getting help
- [GitHub Issues](https://github.com/pinchtab/pinchtab/issues)
- [GitHub Discussions](https://github.com/pinchtab/pinchtab/discussions)
|