๐ agent2win
Universal Bridge Between Web / Cloud AI Agents & Windows OS
Control your Windows PC or Server directly from curl-enabled AI agents (e.g. Arena.ai), ChatGPT Actions, Claude, Grok, and autonomous LLMs.
๐ก Turn Any Web AI / curl-Capable Agent Into a Windows Operator:
Any AI platform or model with HTTP/curl or web browsing capabilities (Arena.ai, ChatGPT / Custom Actions, Grok, Claude, OpenAI Assistants, LangChain, CrewAI) can execute native curl requests to interact with and control your Windows machine remotely via secure REST / WebSocket endpoints.
๐ Overview
agent2win is a lightweight, high-performance middleware server for Windows. It exposes a unified REST & WebSocket API, instantly accessible over the public internet through automatic Cloudflare or ngrok tunnels with zero router configuration.
Whether you are using AI environments executing curl requests in their sandboxes (like Arena.ai), connecting Custom Actions via ChatGPT, or driving automation loops with Claude, agent2win gives external models complete programmatic control over your OS.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Web & Cloud AI Ecosystem โ
โ โข Arena.ai & curl-capable agents โข chatgpt.com (Actions) โ
โ โข grok.com / xAI โข claude.ai / Anthropic โ
โ โข Autonomous Frameworks (LangChain, CrewAI, AutoGen, AutoGPT) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTPS / WSS (API Key Auth)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Cloudflare / ngrok Public Tunnel (Zero Port-Forwarding) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ agent2win Server (:7770) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Screen & Window Capture โ โข Mouse & Keyboard Emulation โ
โ โข Shell & Command Runner โ โข Virtual Desktop Isolation โ
โ โข Filesystem & Registry โ โข Process & Service Manager โ
โ โข Clipboard & Audio Controls โ โข Security & Approval Layer โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ agent2win Server (:7770) โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ โข Screen & Window Capture โ โข Mouse & Keyboard Emulation โ โ โข Shell & Command Runner โ โข Virtual Desktop Isolation โ โ โข Filesystem & Registry โ โข Process & Service Manager โ โ โข Clipboard & Audio Controls โ โข Security & Approval Layer โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
---
## โจ Key Features
- ๐ **Web AI Compatibility**: Turn web-based models (**ChatGPT Actions**, **Gemini**, **Grok**, **Claude**) into remote operators for your Windows machines.
- โก **Zero-Config Public Tunnel**: Instant public HTTPS endpoint generated automatically using Cloudflare Tunnel (`cloudflared`) or `ngrok`. No static IP or port forwarding required.
- ๐ฅ๏ธ **Virtual Desktop Isolation**: Create dedicated hidden/secondary virtual desktops (`/api/desktops`). The agent works autonomously on Desktop 2 without interfering with your active tasks on Desktop 1.
- ๐ธ **Vision & Window Capture**: Full display screenshots or targeted window-handle (`hwnd`) captures in base64 format for visual reasoning.
- ๐ฑ๏ธ **Hardware Input Emulation**: Mouse click, drag, scroll, and keyboard typing with complete Unicode / international character support.
- ๐ป **OS & System Administration**: Run PowerShell/CMD scripts, manage filesystem (read/write/search), list/kill processes, inspect Windows Services, and edit Registry keys.
- ๐ **Comprehensive Security Layer**: Token authentication (`Bearer`), real-time desktop approval prompts for risky commands, system tray killswitch, and audit logging.
---
## โก Quick Start
### 1. Install
Clone repository and install dependencies:
```bash
git clone https://github.com/harikasinkaya/agent2win.git
cd agent2win
pip install -r requirements.txt
Or double-click install.bat on Windows.
2. Run Server
python main.py
Or double-click start.bat.
3. Connect Any AI Agent
The console displays your live public HTTPS tunnel:
๐ Tunnel: https://xxxx-xxxx-xxxx.trycloudflare.com
Connect your AI agent (e.g. ChatGPT Custom Action schema, LangChain tool, or web agent) using this URL.
๐ค Using With Web AIs & curl-Capable Platforms (Arena.ai, ChatGPT, Claude, Grok)
๐ Direct Prompt to Connect Any AI / Agent
Copy and paste this prompt directly into Arena.ai, ChatGPT, Claude, Grok, or any AI capable of web fetching or executing curl requests:
Read the official agent2win control protocol from this URL:
https://raw.githubusercontent.com/harikasinkaya/agent2win/refs/heads/main/AGENT_PROTOCOL.md
You are now an autonomous Windows controller agent.
My agent2win server URL is: <PASTE_YOUR_TUNNEL_URL_HERE>
My API key is: <PASTE_YOUR_API_KEY_OR_LEAVE_EMPTY>
Please inspect the system info, capture the screen, and follow my instructions to control my Windows machine.
โก Example curl Commands Executed by Agents (e.g. Arena.ai)
Agents running in terminal/bash environments can issue direct curl requests:
# 1. Get system info & active window
curl -X GET "https://xxxx.trycloudflare.com/api/info"
# 2. Capture desktop screen
curl -X GET "https://xxxx.trycloudflare.com/api/screen"
# 3. Click at screen coordinates
curl -X POST "https://xxxx.trycloudflare.com/api/mouse/click" \
-H "Content-Type: application/json" \
-d '{"x": 500, "y": 300, "button": "left"}'
# 4. Type text
curl -X POST "https://xxxx.trycloudflare.com/api/keyboard/type" \
-H "Content-Type: application/json" \
-d '{"text": "Hello from AI Agent", "unicode": true}'
# 5. Run shell command
curl -X POST "https://xxxx.trycloudflare.com/api/command" \
-H "Content-Type: application/json" \
-d '{"cmd": "dir C:\\"}'
ChatGPT Custom GPTs / Actions
- Open ChatGPT -> Create a GPT -> Configure -> Add Action.
- Set Server URL to your tunnel address (
https://xxxx.trycloudflare.com). - Set Authentication to API Key (Bearer token) if configured.
- Import endpoints from
AGENT_PROTOCOL.mdto let ChatGPT inspect your screen, run commands, and click UI elements.
๐ ๏ธ CLI Options
| Flag | Description |
|---|---|
--port <PORT> |
Server port (Default: 7770) |
--host <IP> |
Bind IP address (Default: 0.0.0.0) |
--key <SECRET> |
Set Bearer token for API authentication |
--unrestricted |
Disable action approval prompts (โ ๏ธ use carefully) |
--tunnel <PROVIDER> |
Tunnel provider (cloudflared or ngrok) |
--no-tunnel |
Local-only mode (disables tunnels) |
--no-tray |
Disable Windows system tray icon |
--settings |
Open graphical configuration GUI |
๐ก API Reference Overview
Full protocol specifications available in AGENT_PROTOCOL.md.
๐ฅ๏ธ Virtual Desktops (Background Mode)
POST /api/desktops/setupโ Create agent virtual desktop.POST /api/desktops/switch_agentโ Switch active view to agent desktop.POST /api/desktops/switch_userโ Switch active view back to user desktop.
๐ธ Screen & Windows
GET /api/screenโ Full desktop screenshot (Base64 JPEG).GET /api/windowsโ List active windows with handles (hwnd) and coordinates.POST /api/windows/screenshotโ Capture specific window byhwnd.POST /api/windows/focusโ Bring window to foreground.
๐ฑ๏ธ Mouse & Keyboard
POST /api/mouse/clickโ{"x": 500, "y": 300, "button": "left"}POST /api/mouse/scrollโ{"clicks": -5}POST /api/keyboard/typeโ{"text": "Hello World", "unicode": true}POST /api/keyboard/hotkeyโ{"keys": ["ctrl", "c"]}
๐ป Shell & Filesystem
POST /api/commandโ{"cmd": "dir C:\\", "timeout": 10}GET /api/fs/list?path=C:\โ List directory contents.POST /api/fs/readโ Read file contents.POST /api/fs/writeโ Write file contents.
๐ Security & Approvals
- Safe Mode (Default): Critical actions (destructive shell commands, file deletions, registry writes, system reboot/shutdown) trigger desktop approval prompts.
- Unrestricted Mode (
--unrestricted): Disables interactive confirmation for headless/autonomous agents. - Audit Logs: All executions recorded in
logs/audit.log. - Tray Killswitch: Pause or stop the server directly from the Windows taskbar.
๐ License
Distributed under the MIT License. See LICENSE for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent2win-1.0.8.tar.gz.
File metadata
- Download URL: agent2win-1.0.8.tar.gz
- Upload date:
- Size: 43.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e6a7b99907de153b51f87bb5158c698a8539dfeb285bab6c6cfabf9f175233f
|
|
| MD5 |
baaa6e1643995a341eb86724647fae93
|
|
| BLAKE2b-256 |
a8dd384944200acf45b83351bdec0b40326ccb046acb87d00add6d36f4bfe783
|
File details
Details for the file agent2win-1.0.8-py3-none-any.whl.
File metadata
- Download URL: agent2win-1.0.8-py3-none-any.whl
- Upload date:
- Size: 52.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cf1e1c5d56a4eb508d477884d871e7bead75c9e2b7db4c33a807ac38a414c67
|
|
| MD5 |
5f22faecc5e79a9cde162136190061d7
|
|
| BLAKE2b-256 |
c19acf5562a02631354beb5b8ab0022f327c56b5f8b18eb1f0dedd505f101df7
|