Skip to content

Repository files navigation

Computer Control Agent

A macOS computer-use agent: multimodal screen understanding, structured LLM planning, and native UI actuation — with a real-time chat UI, safety guardrails, and optional hardware relay for cross-machine control research.

Chat UI → Orchestrator → ActionPlanner (LLM) → Executor
↑ ↑
ScreenPerception SafetyGuard + kill switch
(capture, OCR, AX tree)

Highlights

  • Eyes → Brain → Hands architecture with an explicit FSM (IDLE → PLANNING → EXECUTING → VERIFYING)
  • Structured action plans (typed actions, not freeform shell)
  • WebSocket chat UI at http://127.0.0.1:8420
  • Safety: kill switch, confirmation gates, coordinate bounds, rate limits
  • 69 tests across foundation, perception, relay protocol, and comms
  • Optional hardware relay: Pico 2W BLE HID bridge — advertises to the target machine as Apple Wireless Keyboard (combined mouse + keyboard) for standard HID pairing (see usb-ble-mouse/)

Quick start

Requires Python 3.11+ and macOS 14+.

python3 -m venv venv &&source venv/bin/activate
pip install -e .[dev]
# API key (Keychain — never commit keys)
security add-generic-password -s computer-control-agent -a gemini-api-key -w 'YOUR_KEY'# Or Vertex AI: set project_id in configs/default.yaml and use gcloud ADC# Permissions: Accessibility + Screen Recording for Terminal
bash scripts/setup_permissions.sh
# Run (local macOS mode — edit configs/default.yaml: relay_mode: local, capture.method: screen)
agent-ctl
open http://127.0.0.1:8420

Kill switch: Cmd+Shift+Escape

Configuration

Copy the example config and customize:

cp configs/default.yaml.example configs/default.yaml

See ARCHITECTURE.md for subsystem details and CLAUDE.md for developer commands.

LLM providers

Gemini (default), Claude, and OpenAI are supported. Keys are read from macOS Keychain (agent/config.py).

Project structure

PathRole
agent/eyes/Screen capture, OCR, accessibility tree
agent/brain/Orchestrator, LLM client, action planner, safety
agent/hands/Mouse, keyboard, apps, executor
agent/chat/FastAPI + WebSocket UI
web/Chat frontend
usb-ble-mouse/Pico 2W BLE HID firmware + relay client

Tests

pytest
ruff check

Security

  • API keys in Keychain only
  • Web UI binds to 127.0.0.1
  • Screen data is sent to the configured cloud LLM for planning — review ARCHITECTURE.md before use on sensitive screens
  • Destructive actions require user confirmation in the chat UI

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages