100 lines of code. Everything else is Markdown. AFK gives any CLI agent eyes to see and hands to control web games β autonomously.
AFK is not a bot. It's a skill layer for your existing AI CLI agent.
- Eye β reads game state from the DOM (no screenshots needed)
- Hand β controls the game via keyboard/mouse events
- Brain β that's your CLI: Cursor, Claude Code, or Codex
You don't build a new AI. You give your existing AI agent a new pair of eyes and hands.
graph TB
subgraph Brain["π§ Your CLI Agent (= Brain)"]
direction LR
Eye["π Eye\nDOM / CDP"]
Hand["β Hand\nkeys / clicks"]
GAME["π GAME.md\nstrategy cache"]
end
Browser["π Web Game"]
Eye -->|read state| Browser
Hand -->|key / click| Browser
# Chrome 136+: --remote-debugging-port must be used with --user-data-dir
# Windows (PowerShell)
$chrome=(Get-Command chrome.exe -ErrorAction SilentlyContinue).Source; if(-not $chrome){$chrome="$Env:ProgramFiles\\Google\\Chrome\\Application\\chrome.exe"}; & $chrome --remote-debugging-port=9222 --user-data-dir="$Env:TEMP\\afk-chrome-profile"
# macOS (zsh/bash)
CHROME_BIN="$(command -v google-chrome || command -v chromium || echo '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')"; "$CHROME_BIN" --remote-debugging-port=9222 --user-data-dir="${TMPDIR:-/tmp}/afk-chrome-profile"
# Linux (bash)
CHROME_BIN="$(command -v google-chrome || command -v chromium || command -v chromium-browser || command -v chrome)"; "$CHROME_BIN" --remote-debugging-port=9222 --user-data-dir=/tmp/afk-chrome-profileIf CHROME_BIN is empty, install Chrome/Chromium or set the absolute browser path manually.
Then verify: open http://localhost:9222/json/version and confirm JSON is returned.
# .cursor/rules/afk.mdc is auto-loaded
# Just tell Cursor:
"2048 λμ νλ μ΄ν΄μ€"
"play minesweeper for me"
"afk:play 2048"
# SKILL.md and CLAUDE.md are auto-loaded
claude "afk:play 2048"
claude "afk:coach minesweeper"# AGENTS.md is auto-loaded
opencode "afk:play 2048"Play (afk:play <game>) β AI reads the board, decides the move, presses the key. Repeats.
Coach (afk:coach <game>) β AI reads the board, suggests the best move. You play.
| Game | URL | Status |
|---|---|---|
| 2048 | play2048.co | β Ready |
| Minesweeper | minesweeperonline.com | β Ready |
| Any web game | your URL | π Auto-discover |
Auto-discovery: Point AFK at any web game. It reads the DOM, searches for a strategy guide, creates a GAME.md, and starts playing. No code changes needed.
For visual overlay (Play badge + Coach panel):
node server.js # WebSocket bridge on ws://localhost:38377
# chrome://extensions β Load unpacked β select chrome-extension/| Traditional Approach | AFK |
|---|---|
| Build your own Brain | CLI is the Brain |
| Build your own web search | CLI has web search built-in |
| Build your own planner | CLI plans natively |
| ~700 lines of architecture | ~100 lines + Markdown |
| One game hardcoded | Any game via GAME.md |
10Γ simpler. 10Γ faster to build. Same result.
The best contribution is a new GAME.md.
cp games/_template.md games/your-game.md
# fill in strategy + DOM selectors + Eye/Hand scripts
# submit a PR β your GAME.md becomes a plugin for everyoneEvery GAME.md is a plugin. The more games the community adds, the smarter AFK gets.
- MVP (now): Web games via DOM + CDP. Cursor / Claude Code / Codex.
- Phase 1: Community GAME.md ecosystem. npm package.
- Phase 2: Desktop games via screen capture (OpenCV).
- Phase 3: Distributed GAME.md β agents share learned strategies.
Built at Eureka Cursor Seoul Hackathon 2026
"You go AFK. AI opens its eyes, grabs your mouse."