git clone https://github.com/pinchtab/pinchtab.git
cd pinchtab
# Build
go build -o pinchtab ./cmd/pinchtab
# Run (headed — Chrome window opens)
./pinchtab
# Run headless
BRIDGE_HEADLESS=true ./pinchtab
# Enable pre-commit hook
git config core.hooksPath .githooksRequires Go 1.25+ and Google Chrome.
- Make your changes
- Format:
gofmt -w . - Test:
go test ./... -count=1 - Lint:
golangci-lint run ./... - Commit — pre-commit hook runs checks automatically
- Push:
git pull --rebase && git push
Important: When creating a PR, please keep the "Allow edits from maintainers" checkbox enabled (it's on by default). This lets us:
- Apply small fixes directly
- Resolve merge conflicts automatically
- Rebase and update your branch without asking
This significantly speeds up the merge process. Thank you! 🙏
# All unit tests
go test ./... -count=1 -v
# With coverage
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.outMost tests use a mockBridge and do not require a running Chrome instance.
Integration tests require Chrome and test the full stack:
# Run integration tests
go test -tags integration ./tests/integration -v
# With retries for stability (recommended)
PINCHTAB_TEST_RETRY=true go test -tags integration ./tests/integration -v
# In CI or slow environments
CI=true go test -tags integration ./tests/integration -v -p 1 -timeout 5m
# Skip flaky tests
go test -tags integration ./tests/integration -v -shortTips for stable integration tests:
- Run with
-p 1to avoid Chrome resource contention - Set
CI=truefor longer timeouts in CI environments - Use
-timeout 5mto allow for Chrome startup - Tests will automatically retry failed requests when
PINCHTAB_TEST_RETRY=true
The project follows the standard Go internal/ pattern to ensure encapsulation and clean boundaries:
cmd/pinchtab/— Application entry points and CLI commands.internal/bridge/— Core CDP logic, tab management, and state logic.internal/handlers/— HTTP API handlers and middleware.internal/orchestrator/— Multi-instance lifecycle and process management.internal/profiles/— Chrome profile management and user identity discovery.internal/dashboard/— Backend logic and static assets for the web UI.internal/assets/— Centralized embedded files (stealth scripts, CSS).internal/human/— Human-like interaction simulation (Bezier mouse paths, natural typing).internal/web/— Shared HTTP and JSON utilities.
gofmtenforced (CI + pre-commit)- Adhere to SOLID principles, specifically using interfaces for dependency inversion.
- Handle all error returns explicitly.
- Lowercase error strings, wrap with
%w. - Tests should live in the same package as the source code.
- No new dependencies without significant technical justification.
See AGENTS.md for detailed conventions and patterns when contributing via an agentic workflow.
To prevent formatting issues, run this after cloning:
git config core.hooksPath .githooksThis enforces gofmt, go vet, and tests before each commit.