A Windows-focused utility that lets a user pick any open window, take a screenshot, and process it locally with OCR. The GUI now runs in a browser via a Flask web server so you can drive it remotely. This phase ships with a single Windows PowerShell launcher, agent.ps1, that installs everything in-place, keeps itself updated, and always starts the latest version of the app.
- Window selection: lists current top-level windows on Windows using
pygetwindow. - Capture & preview: Capture grabs the selected window and shows it in a browser preview.
- Crop & OCR: Drag on the preview to set a crop (or leave unset) and run OCR via
pytesseract.
- Windows 10/11
- Python 3.10+
- Tesseract OCR installed locally (https://github.com/tesseract-ocr/tesseract). Note the installation path (e.g.,
C:\\Program Files\\Tesseract-OCR\\tesseract.exe). - Dependencies listed in
requirements.txt.
Download only agent.ps1 to the folder where you want the app to live, then double-click it (or run it from PowerShell). Everything happens automatically in subfolders next to the script—no prompts or extra tools required:
- Private Python runtime at
.\\.python. - Virtual environment and dependencies in
.venv. - Local Tesseract OCR install at
.\\.tesseract(a system Tesseract install is reused if already present). - Project source checked out in
ai_agent\\source.
Behavior:
- First run: downloads the latest code (via Git if available, otherwise a zip), installs Python, creates the virtual environment, installs dependencies, provisions Tesseract, and launches the app.
- Subsequent runs: checks for updates first. If new code is found, it updates the source, refreshes the launcher if needed, restarts itself, revalidates dependencies, and then opens the app so you always use the newest version.
Everything stays self-contained in the folder beside agent.ps1, making the launcher the only entry point you need.
Install dependencies:
python -m pip install -r requirements.txtFrom the repository root:
python app/main.pyThe web UI binds to 0.0.0.0:6000 so you can open it locally or from another machine on the network. Navigate to http://<host>:6000/ to use it.
- Click Refresh to list open windows, then pick one.
- Click Capture to grab that window. The preview updates in the browser.
- Drag on the preview to set a crop (or skip to use the full image).
- Click Run OCR to process locally with Tesseract. Results show in the OCR output panel.
- Use Save settings to provide the
tesseract.exepath if it is not onPATH.
- On startup the app tries to install missing dependencies automatically using
requirements.txt. - Screen capture first uses Win32's
PrintWindowviapywin32for compatibility with hardware-accelerated windows. If that fails, it falls back topyautoguiand requires the window to be visible and not minimized. - OCR accuracy depends on your Tesseract installation and language packs.