Skip to content

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.

Tags

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.
NeoGendaijin/Autologue★ 00 forksTypeScriptCreated Feb 21, 2026 · last push Feb 21, 2026

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

![Autologue Menu](images/menu.png)

### Play Screen

![Autologue Play Screen](images/play_screen.png)

## 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

Team