Skip to main content

Control your Windows PC from WhatsApp with AI vision

Project description

GhostPC

Control your Windows PC from WhatsApp with AI vision.

GhostPC is a local-first AI desktop agent that gives you full control of your Windows PC through WhatsApp messages. Send a text, and the AI sees your screen, moves your mouse, types on your keyboard, runs commands, launches apps, and streams your screen live to your phone.

Features

  • AI Vision — Gemini Computer Use sees your screen and takes actions
  • Full Desktop Control — Mouse, keyboard, scroll, drag-and-drop
  • Terminal Commands — Run PowerShell/cmd from your phone
  • App Launching — "Open Chrome", "Open VS Code"
  • Live Screen Streaming — MJPEG stream viewable in any mobile browser
  • WhatsApp Integration — Baileys-powered, QR code pairing
  • Clipboard — Read/write system clipboard remotely
  • File Browsing — List, search, and read files on your PC
  • Emergency Stop — Ctrl+Alt+Q kills all agent activity instantly
  • System Tray — Status icon showing connection state

Quick Start

Prerequisites

  • Windows 10/11 (screen capture and input injection are Windows-only)
  • Python 3.12+ (auto-downloaded by uv)
  • Node.js 20+ (for the WhatsApp bridge)
  • Gemini API key from Google AI Studio

Install & Run

# Clone the repo
git clone https://github.com/yourusername/ghost-pc.git
cd ghost-pc

# Set your API key
export GEMINI_API_KEY=your-key-here

# Run (uv handles everything)
uv run ghost

That's it. Scan the QR code with WhatsApp, and start texting commands.

Quick Commands

Command What it does
Just type naturally AI processes and executes
screenshot / ss Send current screen as image
watch / live Get live screen stream URL
stop Cancel current action
reset Clear conversation history
help Show command list

Configuration

All settings are via environment variables. Create a .env file or export them:

# Required
GEMINI_API_KEY=your-gemini-api-key

# Optional
GHOST_SCREEN_FPS=10               # Live stream FPS (1-60)
GHOST_JPEG_QUALITY=70             # JPEG quality (1-100)
GHOST_CAPTURE_RESOLUTION=1280x720 # Capture resolution
GHOST_STREAM_PORT=8443            # Stream server port
GHOST_EMERGENCY_HOTKEY=ctrl+alt+q # Emergency stop hotkey
GHOST_ALLOWED_NUMBERS=+1234567890 # WhatsApp allowlist (comma-separated)
GHOST_LOG_LEVEL=INFO              # Logging level

Architecture

Python Agent (asyncio event loop)
├── Orchestrator — wires all subsystems together
├── ADK Agent — Gemini Computer Use model + tools
│   ├── ComputerUseToolset → DesktopComputer(BaseComputer)
│   │   ├── BetterCam screen capture → PNG for model
│   │   └── Win32 SendInput (mouse/keyboard/scroll)
│   └── Custom tools (terminal, apps, clipboard, files)
├── AgentRunner — manages sessions, tool callbacks
├── BaileysBridge — spawns Node.js, JSON-RPC over stdio
├── MJPEGServer — aiohttp, streams JPEG frames + WebSocket chat
└── GhostTray — pystray system tray icon

Node.js Bridge (subprocess)
├── Baileys socket — WhatsApp connection
├── stdin reader — JSON-RPC commands from Python
└── stdout writer — JSON-RPC events to Python

Security

Layer Protection
WhatsApp Access Phone number allowlist
Emergency Stop Ctrl+Alt+Q hotkey
Screen Data Only sent to Gemini API for analysis
Live Viewing Token-authenticated URLs
Terminal Command blocklist (no format, del /s, etc.)
Files Configurable allowed directories
Coordinates Clamped to screen dimensions

Development

# Install dev dependencies
uv sync --group dev

# Run tests
uv run pytest tests/ -v

# Lint
uv run ruff check src/

# Format
uv run ruff format src/

# Type check
uv run pyright src/

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghost_pc-0.2.18.tar.gz (137.0 kB view details)

Uploaded Source

Built Distribution

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

ghost_pc-0.2.18-py3-none-any.whl (167.5 kB view details)

Uploaded Python 3

File details

Details for the file ghost_pc-0.2.18.tar.gz.

File metadata

  • Download URL: ghost_pc-0.2.18.tar.gz
  • Upload date:
  • Size: 137.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ghost_pc-0.2.18.tar.gz
Algorithm Hash digest
SHA256 e8c610c9133a34d6d54c47bba83ee850b85a6106fc183a983112a47b6573d74a
MD5 8d43986fabd2156e85edb2d118a8d6c3
BLAKE2b-256 00c4eab15a9c08ad42ae569f9d2190a86000fd6ddec1b542a3b5316e671394e8

See more details on using hashes here.

File details

Details for the file ghost_pc-0.2.18-py3-none-any.whl.

File metadata

  • Download URL: ghost_pc-0.2.18-py3-none-any.whl
  • Upload date:
  • Size: 167.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ghost_pc-0.2.18-py3-none-any.whl
Algorithm Hash digest
SHA256 fffaedae72b2a3d3f7de564303077927e7b45b1e6b1f1f39102eadd2ac3147cd
MD5 7d52cb1df2b7614e09e48dff1dc617d1
BLAKE2b-256 24b87a0c1b94f6ccc43e831bbe2a65cffec987fce45c8607329411967f29c785

See more details on using hashes here.

Supported by

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