Skip to content

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

fix: production-grade installer — permissions, cleanup, docs

Mariod075282e0c2a
diff --git a/README.md b/README.md
index aab00a88..128ad30b 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,58 @@ curl -X POST localhost:9867/action -d '{"kind":"click","ref":"e5"}'
- **Stealth mode** — bypasses bot detection on major sites
- **Persistent sessions** — log in once, stays logged in across restarts
+## Installation
+
+### One-liner (macOS/Linux)
+
+```bash
+curl -fsSL https://pinchtab.com/install.sh | bash
+```
+
+Then:
+```bash
+pinchtab # Start the server
+# In another terminal:
+pinchtab nav https://httpbin.org # Navigate
+pinchtab snap # Get snapshot
+```
+
+**Requirements:**
+- Node.js 18+ (for npm install)
+- macOS or Linux
+
+**Troubleshooting:**
+
+**Command not found / PATH issue:**
+```bash
+# npm -g may be in an unusual location
+npm config get prefix # Find where global packages go
+export PATH="$(npm config get prefix)/bin:$PATH"
+```
+
+**Permission denied (EACCES):**
+```bash
+# Option 1: Use nvm (recommended, fresh Node install)
+curl https://github.com/nvm-sh/nvm/raw/master/install.sh | bash
+nvm install node
+npm install -g pinchtab
+
+# Option 2: User prefix (no sudo)
+npm install -g --prefix ~/.local pinchtab
+export PATH="$HOME/.local/bin:$PATH" # Add to ~/.bashrc or ~/.zshrc
+
+# Option 3: Change npm prefix globally
+mkdir ~/.npm-global && npm config set prefix '~/.npm-global'
+export PATH=~/.npm-global/bin:$PATH # Add to ~/.bashrc or ~/.zshrc
+```
+
+### npm (manual)
+
+```bash
+npm install -g pinchtab
+pinchtab --version
+```
+
## Quick Start
### Docker (easiest)
diff --git a/install.sh b/install.sh
index 9d9d5fa3..72a40c50 100755
--- a/install.sh
+++ b/install.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -euo pipefail
# Pinchtab Installer for macOS and Linux
@@ -23,6 +23,8 @@ cleanup_tmpfiles() {
trap cleanup_tmpfiles EXIT
TMPFILES=()
+LOGFILE=""
+
mktempfile() {
local f
f="$(mktemp)"
@@ -30,6 +32,10 @@ mktempfile() {
echo "$f"
}
+setup_logfile() {
+ LOGFILE="$(mktempfile)"
+}
+
ui_info() {
local msg="$*"
echo -e "${MUTED}·${NC} ${msg}"
@@ -103,12 +109,36 @@ check_npm() {
install_pinchtab() {
ui_section "Installing Pinchtab"
- if npm install -g pinchtab 2>&1 | tee /tmp/pinchtab-install.log; then
+ if npm install -g pinchtab > "$LOGFILE" 2>&1; then
ui_success "Pinchtab installed successfully"
return 0
else
+ local exit_code=$?
ui_error "npm install failed"
- echo "Log: /tmp/pinchtab-install.log"
+ echo ""
+
+ # Check for permission error
+ if grep -q "EACCES\|permission denied" "$LOGFILE"; then
+ echo "This is a permission error. Try one of these:"
+ echo ""
+ echo " Option 1: Use nvm (recommended)"
+ echo " curl https://github.com/nvm-sh/nvm/raw/master/install.sh | bash"
+ echo " nvm install node"
+ echo " npm install -g pinchtab"
+ echo ""
+ echo " Option 2: Use user prefix (no sudo needed)"
+ echo " npm install -g --prefix \"\$HOME/.local\" pinchtab"
+ echo " export PATH=\"\$HOME/.local/bin:\$PATH\" # Add to ~/.bashrc or ~/.zshrc"
+ echo ""
+ echo " Option 3: Fix npm permissions globally"
+ echo " mkdir ~/.npm-global"
+ echo " npm config set prefix '~/.npm-global'"
+ echo " export PATH=~/.npm-global/bin:\$PATH # Add to ~/.bashrc or ~/.zshrc"
+ echo ""
+ else
+ echo "Install log:"
+ cat "$LOGFILE"
+ fi
exit 1
fi
}
@@ -136,7 +166,7 @@ show_next_steps() {
echo ""
echo " Or navigate & snapshot:"
echo -e " ${MUTED}pinchtab nav https://httpbin.org/html${NC}"
- echo -e " ${MUTED}pinchtab snap | jq .count${NC}"
+ echo -e " ${MUTED}pinchtab snap${NC} (pipe to 'jq .count' if you have jq installed)"
echo ""
echo " Documentation:"
echo -e " ${MUTED}https://pinchtab.com${NC}"
@@ -145,6 +175,7 @@ show_next_steps() {
main() {
print_banner
+ setup_logfile
detect_os
check_node