File size: 6,006 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 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | # Instances
Instances are running Chrome processes managed by PinchTab. Each managed instance has:
- an instance ID
- a profile
- a port
- a mode (`headless` or `headed`)
- an execution status
One profile can have at most one active managed instance at a time.
## List Instances
```bash
curl http://localhost:9867/instances
# CLI Alternative
pinchtab instances
# Response
[
{
"id": "inst_0a89a5bb",
"profileId": "prof_278be873",
"profileName": "work",
"port": "9868",
"headless": true,
"status": "running",
"startTime": "2026-03-01T05:21:38.27432Z"
}
]
```
`pinchtab instances` is the simplest way to inspect the current fleet from the CLI.
## Start An Instance
### Primary: Start by profileId and mode
```bash
curl -X POST http://localhost:9867/instances/start \
-H "Content-Type: application/json" \
-d '{"profileId":"prof_278be873","mode":"headed","port":"9999"}'
# CLI Alternative
pinchtab instance start --profileId prof_278be873 --mode headed --port 9999
# Response
{
"id": "inst_ea2e747f",
"profileId": "prof_278be873",
"profileName": "work",
"port": "9999",
"headless": false,
"status": "starting",
"startTime": "2026-03-01T05:21:38.27432Z"
}
```
Notes:
- if `profileId` is omitted, PinchTab creates an auto-generated temporary profile such as `instance-...`
- if `port` is omitted, PinchTab allocates one from the configured instance port range
### Alternative: Start by profile name
You can also start an instance using a profile name and headless flag:
```bash
curl -X POST http://localhost:9867/instances/launch \
-H "Content-Type: application/json" \
-d '{"name":"work","headless":false}'
# Response
{
"id": "inst_ea2e747f",
"profileId": "prof_278be873",
"profileName": "work",
"port": "9999",
"headless": false,
"status": "starting",
"startTime": "2026-03-01T05:21:38.27432Z"
}
```
The `POST /instances/launch` endpoint takes:
- `name` — profile name (required)
- `headless` — true for headless mode, false for headed mode (optional, defaults to true)
Port is automatically allocated from the configured instance port range.
## Get One Instance
```bash
curl http://localhost:9867/instances/inst_ea2e747f
# Response
{
"id": "inst_ea2e747f",
"profileId": "prof_278be873",
"profileName": "work",
"port": "9999",
"headless": false,
"status": "running",
"startTime": "2026-03-01T05:21:38.27432Z"
}
```
Common status values:
- `starting`
- `running`
- `stopping`
- `stopped`
- `error`
## Get Instance Logs
```bash
curl http://localhost:9867/instances/inst_ea2e747f/logs
# CLI Alternative
pinchtab instance logs inst_ea2e747f
```
Response is plain text.
## Stop An Instance
```bash
curl -X POST http://localhost:9867/instances/inst_ea2e747f/stop
# CLI Alternative
pinchtab instance stop inst_ea2e747f
# Response
{
"id": "inst_ea2e747f",
"status": "stopped"
}
```
Stopping an instance preserves the profile unless it was a temporary auto-generated profile.
## Start By Profile
You can also start an instance from a profile-oriented route:
```bash
curl -X POST http://localhost:9867/profiles/prof_278be873/start \
-H "Content-Type: application/json" \
-d '{"headless":false,"port":"9999"}'
# Response
{
"id": "inst_ea2e747f",
"profileId": "prof_278be873",
"profileName": "work",
"port": "9999",
"headless": false,
"status": "starting"
}
```
This route accepts a profile ID or profile name in the path. Its request body uses `headless` rather than `mode`.
## Open A Tab In An Instance
```bash
curl -X POST http://localhost:9867/instances/inst_ea2e747f/tabs/open \
-H "Content-Type: application/json" \
-d '{"url":"https://pinchtab.com"}'
# Response
{
"tabId": "8f9c7d4e1234567890abcdef12345678",
"url": "https://pinchtab.com",
"title": "PinchTab"
}
```
There is no dedicated instance-scoped `tab open` CLI command today. The CLI shortcut is:
```bash
pinchtab instance navigate inst_ea2e747f https://pinchtab.com
```
That command opens a tab for the instance and then navigates it.
## List Tabs For One Instance
```bash
curl http://localhost:9867/instances/inst_ea2e747f/tabs
# Response
[
{
"id": "8f9c7d4e1234567890abcdef12345678",
"instanceId": "inst_ea2e747f",
"url": "https://pinchtab.com",
"title": "PinchTab"
}
]
```
## List All Tabs Across Running Instances
```bash
curl http://localhost:9867/instances/tabs
```
This is the fleet-wide tab listing endpoint. It is different from `GET /tabs`, which is shorthand/bridge-style and not a fleet-wide inventory.
## List Metrics Across Instances
```bash
curl http://localhost:9867/instances/metrics
```
Use this when you want per-instance memory metrics across all running instances.
## Attach An Existing Chrome
```bash
curl -X POST http://localhost:9867/instances/attach \
-H "Content-Type: application/json" \
-d '{"name":"shared-chrome","cdpUrl":"ws://127.0.0.1:9222/devtools/browser/..."}'
# Response
{
"id": "inst_0a89a5bb",
"profileId": "prof_278be873",
"profileName": "shared-chrome",
"status": "running",
"attached": true,
"cdpUrl": "ws://127.0.0.1:9222/devtools/browser/..."
}
```
Notes:
- there is no CLI attach command
- attach is allowed only when enabled in config under `security.attach`
## Attach An Existing Bridge
```bash
curl -X POST http://localhost:9867/instances/attach-bridge \
-H "Content-Type: application/json" \
-d '{
"name":"shared-bridge",
"baseUrl":"http://10.0.12.24:9868",
"token":"bridge-secret-token"
}'
# Response
{
"id": "inst_0a89a5bb",
"profileId": "prof_278be873",
"profileName": "shared-bridge",
"port": "",
"url": "http://10.0.12.24:9868",
"status": "running",
"attached": true,
"attachType": "bridge"
}
```
Notes:
- `baseUrl` must point at a running PinchTab bridge
- the orchestrator performs a health check before registering it
- `security.attach.allowHosts` must allow the bridge host
- `security.attach.allowSchemes` must include `http` or `https` for bridge attachment
|