Autologue
Autologue is an interactive coding-agent game interface that reframes autonomous code generation as a real-time role-playing battle.
Core trick
Maps coding-agent backend events to game events through a pure reducer that streams one canonical state over WebSocket to a battle UI.
Description
Autologue is an interactive coding-agent game interface that reframes autonomous code generation as a real-time role-playing battle. Instead of presenting agent activity as logs or console output, it translates backend agent events into structured game mechanics and visual feedback. The system combines an LLM-powered coding agent with a deterministic game-state reducer and a browser-based battle UI.
README excerpt
# Autologue Autologue is a coding-agent game UI. Agent actions are turned into RPG-style battle events in real time. ## What It Does - Runs an agent backend (`openrouter` or `gemini-cli`) for each quest. - Maps backend events to game events (`FILE_READ`, `TEST_PASS`, `QUESTION`, etc.). - Reduces events into a single canonical `GameState`. - Streams state to the web client over WebSocket. - Shows a battle scene with party, enemy encounters, battle log, and results. ## Screenshots ### Menu  ### Play Screen  ## Current Runtime Architecture ```text Agent Backend (OpenRouter or Gemini CLI) -> EventMapper (pattern/action classification) -> Game Reducer (pure state transitions) -> WebSocket session stream -> React Web UI (battle/game overlays) ``` Notes: - Server default backend is `openrouter` (`AGENT_BACKEND` not set). - Terminal UI directly uses `GeminiProcess` from core (separate from server backend switching). ## Quick Start ### Prerequisites - Node.js 18+ - pnpm - API credentials (OpenRouter recommended for current default flow) ### Install ```bash pnpm install ``` ### Configure `.env` ```bash # Backend selector: openrouter (default) or gemini-cli AGENT_BACKEND=openrouter # OpenRouter backend OPENROUTER_API_KEY=... OPENROUTER_MODEL=google/gemini-2.5-flash-lite # Gemini CLI backend (optional) # AGENT_BACKEND=gemini-cli # GEMINI_MODEL=gemini-2.5-flash # GEMINI_CLI_PATH