Skip to main content

๐Ÿš€ 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.

License: MIT Python 3.9+ Platform: Windows API: REST & WebSocket


๐Ÿ’ก 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

  1. Open ChatGPT -> Create a GPT -> Configure -> Add Action.
  2. Set Server URL to your tunnel address (https://xxxx.trycloudflare.com).
  3. Set Authentication to API Key (Bearer token) if configured.
  4. Import endpoints from AGENT_PROTOCOL.md to 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 by hwnd.
  • 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

agent2win-1.0.9.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent2win-1.0.9-py3-none-any.whl (52.6 kB view details)

Uploaded Python 3

File details

Details for the file agent2win-1.0.9.tar.gz.

File metadata

  • Download URL: agent2win-1.0.9.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for agent2win-1.0.9.tar.gz
Algorithm Hash digest
SHA256 dd85f5ec89aa65b0cf8d4630f30101ae288713c894aaba965fc042e915f66c6c
MD5 ed6b879ba15d76546b204e55c4525f00
BLAKE2b-256 41b09ec1832659f41c6e4e4dbf6653f6f02b5c012e346e8aaeb63a9cb3edf8a6

See more details on using hashes here.

File details

Details for the file agent2win-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: agent2win-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 52.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for agent2win-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 ad9e4f2d8accac3e2834aeba4dca5c16b1e3fcd85753786f3c390855a1ca755f
MD5 c23949cfd85b45789d49fa4a0590425e
BLAKE2b-256 49fe7f89a2c27f67de76932ffe9b9834a42e041f17c1e8acf119cb6e7f8f19f9

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.11

2 files

1.0.10

2 files

This release

1.0.9 This release

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page