# Repository Briefing: browser-use/windows-harness
> Source: https://repoforai.com/repo/browser-use/windows-harness (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/browser-use/windows-harness
- **Category**: Agents & Frameworks (智能体与框架)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: A (84/100 · Maintenance 35/35 · Adoption 12/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v0.2.2 (2026-08-25) — https://github.com/browser-use/windows-harness/releases
- **Review Snapshot**: 2026-11-30
- **Deployment / Stack Signals**: CLI
- **Momentum**: 85 ★ total (+0 24h / +0 7d) · 10 forks
- **When to Use**: Best for: Developer-led agent workflows that need to move between Windows apps, local files, PowerShell, and a signed-in browser on an interactive desktop. Skip if: You need Session 0 execution, guaranteed background input across apps, or a stable browser-only workflow that Playwright can cover on its own.

## Overview
```text
### Architecture & Core Mechanics
Windows Harness is a Python CLI execution layer for an external agent. A single persistent Python process exposes three paths: `win` for the Windows desktop, the lazily resolved `browser` object for Browser Harness, and ordinary `Path` and `subprocess` access for files and shell processes. An agent can inspect a window, keep the result in session state, and write the next operation in Python rather than depend on an application-specific tool catalog.

The desktop layer combines PrintWindow capture, UI Automation, and an input delivery matrix. The browser layer is separate from desktop input: Browser Harness uses Playwright and browser-use with the actual Chrome session. Packaging uses Hatchling (`hatchling>=1.27`) and declares Python 3.11 or newer. The extension point is ordinary Python in the running session: this is an execution layer, not a model runtime or a workflow engine.

### Key Capabilities & Differentiators
The desktop API combines window screenshots, keyboard and pointer input, clipboard paste, UI Automation lookup, and PowerShell through `win.script`. Capture targets background, occluded, and minimized windows without raising them. Input is a separate choice: the default foreground mode raises the target, uses SendInput first, and can fall back to pen or message delivery when SendInput is filtered. The target stays foreground until `win.release()` so focus-sensitive menus, suggestion popups, and IME candidates can survive a sequence of actions.

Opt-in background input never raises the target and uses synthetic pen events or PostMessage. It is not equivalent to foreground input: the compatibility matrix uses window class names and locally observed event drops to reject known incompatible cases with `BackgroundUnavailable`. Native, Electron, and UWP apps are in scope, but reliable capture does not establish that a given app accepts background input; CEF and XAML focus requirements are concrete reasons to test both paths.

### Trade-offs & Limitations
Compared with Playwright alone, the harness is useful when a task crosses from a web page into native dialogs, desktop apps, files, or PowerShell. A browser-only workflow does not need the added focus and input-delivery concerns. Compared with a fixed Windows automation script, an agent that writes Python at runtime can handle tasks that were not scripted in advance, but makes execution paths and failure recovery less predictable.

The foreground default favors actual input delivery over sharing the desktop unobtrusively. Background input is worth using only after testing the target app and workflow. The more consequential boundary is access: one process can operate the signed-in browser, touch files, and start subprocesses under its Windows identity. For production pilots, use a dedicated desktop session and narrowly scoped accounts. Validate focus handoff, elevated-window behavior, and recovery from partial actions before giving the agent access to business data.

### Hardware & Deployment Guide
Run it locally on Windows 10 1809 or later or Windows 11, with Python 3.11 or later and a logged-in, interactive desktop. A Session 0 service is not a substitute. The PyPI installation path supports `uv`, with Python 3.12 used in the onboarding example. `windows-harness install-skill` registers the skill for agent clients; `--target <dir>` confines installation to one skills directory. Run `windows-harness doctor`, then verify a background capture against an already open window before testing input separately.

Routine use does not require administrator rights, but Windows UIPI restricts injection into higher-integrity applications. Anonymous CLI telemetry is on by default and can be disabled with `windows-harness telemetry disable`. No GPU requirement is specified for the harness itself; size the host for its desktop apps and browser, and account separately for any model runtime. The package is MIT-licensed and marked alpha; v0.2.2 is the first public release.
```

## Key Capabilities
```text
- Execution: One persistent Python process exposes desktop, browser, filesystem, and subprocess operations.
- Capture and inspection: PrintWindow targets windows without raising them; UI Automation supports element lookup at screen coordinates.
- Foreground input: SendInput is the primary transport, with pen or message fallbacks; focus is held until `win.release()`.
- Background input: Synthetic pen events or PostMessage never raise the window; known incompatible targets return `BackgroundUnavailable`.
- Browser integration: The lazy `browser` object connects Browser Harness to the existing signed-in browser session.
- Operational checks: `windows-harness doctor` checks runtime requirements, including an interactive desktop and Python dependencies.
```

## Quick Start / Clone
```bash
windows-harness <<'PY'
frame = win.see("Notepad")
win.key("ctrl+h", app="Notepad")
win.type("Alessia Cara", app="Notepad")
win.click(640, 420, app="Notepad")

item = win.ax.at(640, 420, app="Notepad")
win.script("(Get-Process notepad).Count")

print(list(Path.home().iterdir()))
print(browser.page_info())
PY
```
