Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

feat: add help subcommand + update reference docs for CLI

Mario5205f45d052d
diff --git a/cmd/pinchtab/cmd_cli.go b/cmd/pinchtab/cmd_cli.go
index 30e6115d..b51a1c91 100644
--- a/cmd/pinchtab/cmd_cli.go
+++ b/cmd/pinchtab/cmd_cli.go
@@ -75,6 +75,7 @@ var cliCommands = map[string]bool{
"screenshot": true, "ss": true,
"eval": true, "evaluate": true,
"pdf": true, "health": true,
+ "help": true,
}
func isCLICommand(cmd string) bool {
@@ -116,9 +117,47 @@ func runCLI(cfg *config.RuntimeConfig) {
cliPDF(client, base, token, args)
case "health":
cliHealth(client, base, token)
+ case "help":
+ cliHelp()
}
}
+func cliHelp() {
+ fmt.Print(`Pinchtab CLI — browser control from the command line
+
+Usage: pinchtab <command> [args] [flags]
+
+Commands:
+ nav, navigate <url> Navigate to URL (--new-tab, --block-images)
+ snap, snapshot Accessibility tree snapshot (-i, -c, -d, --max-tokens N)
+ click <ref> Click element by ref
+ type <ref> <text> Type text into element
+ fill <ref> <text> Set input value (no key events)
+ press <key> Press a key (Enter, Tab, Escape, ...)
+ hover <ref> Hover over element
+ scroll <direction> Scroll page (up, down, left, right)
+ select <ref> <value> Select dropdown option
+ focus <ref> Focus element
+ text Extract page text (--raw for innerText)
+ tabs List open tabs
+ tabs new <url> Open new tab
+ tabs close <tabId> Close tab
+ ss, screenshot Take screenshot (-o file, -q quality)
+ eval <expression> Evaluate JavaScript
+ pdf Export page as PDF (-o file, --landscape, --scale N)
+ health Server health check
+ help Show this help
+
+Environment:
+ PINCHTAB_URL Server URL (default: http://localhost:9867)
+ PINCHTAB_TOKEN Auth token (sent as Bearer)
+
+Pipe with jq:
+ pinchtab snap -i | jq '.nodes[] | select(.role=="link")'
+`)
+ os.Exit(0)
+}
+
// --- navigate ---
func cliNavigate(client *http.Client, base, token string, args []string) {
diff --git a/skill/pinchtab/references/env.md b/skill/pinchtab/references/env.md
index 53b0d838..361bf6ed 100644
--- a/skill/pinchtab/references/env.md
+++ b/skill/pinchtab/references/env.md
@@ -27,6 +27,13 @@
| `CDP_URL` | (none) | Connect to existing Chrome DevTools |
| `BRIDGE_NO_DASHBOARD` | `false` | Disable dashboard endpoints on instance processes |
+## CLI client
+
+| Var | Default | Description |
+|---|---|---|
+| `PINCHTAB_URL` | `http://localhost:9867` | Pinchtab server URL for CLI commands |
+| `PINCHTAB_TOKEN` | (none) | Auth token for CLI (sent as `Authorization: Bearer`) |
+
## Dashboard mode (`pinchtab dashboard`)
| Var | Default | Description |
diff --git a/skill/pinchtab/references/profiles.md b/skill/pinchtab/references/profiles.md
index 86167df6..5d6920a6 100644
--- a/skill/pinchtab/references/profiles.md
+++ b/skill/pinchtab/references/profiles.md
@@ -54,6 +54,16 @@ curl -X POST http://localhost:9867/instances/launch \
-d '{"name": "work", "port": "9868"}'
```
+## CLI usage with profiles
+
+The CLI doesn't have profile subcommands yet — use `curl` for profile management.
+Once a profile instance is running, point the CLI at it:
+
+```bash
+# Get the instance port, then use CLI
+PINCHTAB_URL=http://localhost:9868 pinchtab snap -i
+```
+
## Typical agent flow
```bash