File size: 5,269 Bytes
548366e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
## Instalation Plan
Below is a **pragmatic “one-click” install strategy** you can ship this week and polish later.

---
### 0 What a user need on laptop
| Component                         | Why                                            |
| --------------------------------- | ---------------------------------------------- |
| **Python ≥ 3.10**                 | run `host.py` (pure-Python, 150 LOC)           |
| **`aiohttp`**                     | do the HTTPS POST / long-poll to your HF Space |
| **Native-Messaging manifest**     | let Chrome spawn the host automatically        |
| **(Optional) Playwright package** | only if you picked the CDP replay option       |

### 1 Distribute two thin wrapper scripts

| For…              | User runs| What it does under the hood|  |
| ----------------- | ------------ | ------------------- | ----------- |
| **macOS / Linux** | `bash<br>/bin/bash -c "$(curl -fsSL https://rebr.ws/install.sh)"`                  | • Checks for Python ≥ 3.10 & `pipx`  <br>• Installs both if missing  <br>`pipx install rebrowse-host` (wheel hosted on GitHub/LFS)  <br>• Runs `rebrowse-install --extension-id=<your-ID>` to write the Native-Messaging manifest |                                                                                                                                          |
| **Windows**       | \`\`\`powershell<br>irm [https://rebr.ws/install.ps1](https://rebr.ws/install.ps1) | iex\`\`\`                                                                                                                                                                                                                           | • Winget-installs Python if missing  <br>• Installs `pipx`  <br>`pipx install rebrowse-host`  <br>• Adds registry key for the manifest |

> **Why not an .exe/.pkg yet?**
> `pipx` isolates dependencies, bundles its own venv, and is <10 s download.
> You avoid shipping Python yourself (huge) and stay cross-platform with two tiny scripts.

---

### 1-a `install.sh`  (macOS / Linux)

```bash
#!/usr/bin/env bash
set -e

EXT_ID="___________"   # 👈 fill with your Chrome-Web-Store ID

# 1) Ensure Python 3.10+
command -v python3 >/dev/null 2>&1 || {
  echo "❌ Python 3 not found. Install Xcode Command Line Tools or brew python."
  exit 1
}

# 2) Install pipx if missing
if ! command -v pipx >/dev/null; then
  python3 -m pip install --user --upgrade pipx
  python3 -m pipx ensurepath
  export PATH="$HOME/.local/bin:$PATH"
fi

# 3) Install rebrowse-host
pipx install --upgrade "rebrowse-host==0.*"  # version pin

# 4) Register native-messaging manifest
rebrowse-install --extension-id="$EXT_ID"

echo "✅ Rebrowse host installed!  Open Chrome and start recording."
```

**Make it downloadable**

```bash
chmod +x install.sh
aws s3 cp install.sh s3://rebrowse-public/install.sh --acl public-read  # or GitHub raw
```

---

### 1-b `install.ps1`  (Windows)

```powershell
$ErrorActionPreference = "Stop"
$extId = "___________"   # Chrome Web Store ID

# 1) Ensure Python
if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
    Write-Host "Installing Python via winget..."
    winget install --id Python.Python.3.11 -e --source winget
}

# 2) pipx
python -m pip install --user --upgrade pipx
$env:PATH += ";$HOME\AppData\Roaming\Python\Scripts"
pipx ensurepath

# 3) rebrowse-host
pipx install --upgrade "rebrowse-host==0.*"

# 4) Register native host
rebrowse-install --extension-id $extId

Write-Host "✅ Rebrowse host installed! Restart Chrome and record."
```

Host these two scripts at short URLs (`https://rebr.ws/install.sh`, `…/install.ps1`) so users can copy-paste.

---

### 2 Package `rebrowse-host` for `pipx`

Inside **`native_host/`**:

1. add a minimal `setup.cfg` / `pyproject.toml`
2. build once and upload to GitHub Releases *(or TestPyPI)*:

```bash
python -m build -w
gh release create v0.1 dist/rebrowse_host-0.1-py3-none-any.whl
```

`pipx install "https://github.com/zk1tty/rebrowse-app/releases/download/v0.1/rebrowse_host-0.1-py3-none-any.whl"`

*(You can move to PyPI later.)*

---

### 3 What the user experiences

1. **Runs one command** → gets progress messages (“Installing Python…”, “Registering host…”)
2. Chrome extension already shipped **in the Web Store**; once installed it immediately finds the native host.
3. They browse, stop recording → trace auto-uploads to the Space.
4. They open your Space URL, click **Replay**, and watch the browser act.

Zero manual Python, zero PATH fiddling, \~30 s total on a fresh machine.

---

## 4 Future-proof upgrades

* **Auto-update**: `pipx upgrade rebrowse-host` can be called by the extension weekly.
* **Standalone binary**: later wrap with **PyInstaller** + **Inno Setup** / **pkgbuild** for true one-file installers; reuse the manifest step.
* **Signed**: macOS notarization & Windows Authenticode once you move beyond hackathon scope.

---

### TL;DR for non-tech testers

```bash
# macOS / Linux
/bin/bash -c "$(curl -fsSL https://rebr.ws/install.sh)"
```

```powershell
# Windows 10/11
irm https://rebr.ws/install.ps1 | iex
```

That single line gives them everything required to record and replay workflows through your Hugging Face Space.