Metadata-Version: 2.4
Name: gptree-pentestgpt-bridge
Version: 0.2.0
Summary: WebSocket bridge connecting local PentestGPT to GPTree
Author-email: GPTree <hello@gp-tree.com>
License-Expression: MIT
Project-URL: Homepage, https://gp-tree.com
Project-URL: PentestGPT, https://github.com/GreyDGL/PentestGPT
Project-URL: Documentation, https://gp-tree.com/settings/pentestgpt
Keywords: pentesting,security,gptree,pentestgpt,websocket,bridge
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: websockets>=13.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0
Provides-Extra: pentestgpt
Requires-Dist: pentestgpt; extra == "pentestgpt"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Dynamic: license-file

# GPTree PentestGPT Bridge

WebSocket bridge that connects your local [PentestGPT](https://pentestgpt.com/) installation to [GPTree](https://gp-tree.com). The bridge runs on your machine and connects outbound only. No exposed ports, no inbound firewall rules.

## Quick Start

### 1. Generate a token

Go to **GPTree > Settings > PentestGPT** and click **Generate Token**.

### 2. Install

```bash
pip install gptree-pentestgpt-bridge
```

### 3. Run

```bash
export GPTREE_TOKEN=pt_your_token_here

pentestgpt-bridge
```

The bridge auto-fetches connection details from GPTree using your token. No additional configuration is needed.

## Optional: Install PentestGPT SDK

Without the PentestGPT SDK, the bridge runs in **stub mode** (returns sample responses so you can verify the connection works). Install the SDK for real pentesting:

```bash
pip install pentestgpt
```

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `GPTREE_URL` | `https://gp-tree.com` | GPTree server URL (only change for self-hosted instances) |
| `GPTREE_TOKEN` | *(required)* | Bridge token from GPTree settings |
| `PENTESTGPT_MAX_ITERATIONS` | `300` | Max agent iterations per request |
| `PENTESTGPT_WORKSPACE` | `./workspace` | Working directory for tool output |

## How It Works

1. The bridge authenticates with GPTree using your token
2. GPTree returns WebSocket connection details automatically
3. The bridge subscribes to your private channel via WebSocket
4. When you send a message in GPTree using a PentestGPT model, the bridge receives the work
5. PentestGPT runs locally, streaming results back to GPTree in real time
6. Findings (vulnerabilities, open ports, etc.) are cataloged automatically

## Requirements

- Python 3.10 or later
- A GPTree account with PentestGPT enabled
- (Optional) PentestGPT SDK for real scanning capabilities
