A 2D pixel-art RPG-style desktop game where you walk around a virtual office and interact with AI agents. Each NPC runs a real GitHub Copilot CLI session with full coding capabilities β plan tasks, debug code, and orchestrate multi-agent workflows from inside a game. You can even bring an agent online in a Microsoft Teams channel and drive it from your phone.
- Pixel-art office environment β every sprite is procedurally generated in code; there are no external image assets
- Real Copilot agents β each NPC runs an actual Copilot CLI session, rendered live in an xterm.js terminal
- 3 active NPC agents by default, each with a distinct personality:
- Gene (Generalist) β general-purpose coding, debugging, and research
- Dan (Debugger) β bug investigation and root-cause analysis
- Alice (Admin) β has direct access to edit this game's own source code (
workingDir: '.')
- 6 reserve agents β Azure (Cloud Wizard), Val (Validator), Rex (Deployer), Doc (Code Doctor), Scout (Ranger), and Penny (Accountant) have pre-generated sprites ready to seat at an empty desk
- Arthur (the Architect) β hosts Meeting Mode and appears in fleet v-team offices (can be toggled into the default office in config)
- Teams remote agents β bring any agent online in a Microsoft Teams channel thread; anyone can reply in-thread to drive the agent's terminal session and get answers posted back (feature-flagged)
- Multi-office management β switch between projects with independent agent state and working directories per office
- Meeting Mode β a private meeting room where Arthur decomposes a complex request into a structured, reviewable plan
- Fleet execution β approved plans spin up parallel agent sessions in a dedicated v-team office
- Real-time status badges β agent states (slacking β starting β ready β waiting/thinking) with animated indicators
- Toast & OS notifications β configurable per-event notifications for agent activity
- Session persistence β offices, seated agents, and terminal sessions survive restarts
- Player & sprite customization β customize your character's appearance and colors
- Mini-games β a built-in Galaxian arcade game (Pong and Basketball are also included behind feature flags)
- Hot reload development mode with file watching
- Phaser 3 β 2D game framework (the sole renderer)
- Electron 40+ β desktop shell with a Node.js main process
- TypeScript β strict mode throughout
- esbuild β fast bundling for both the game and Electron code
- xterm.js β terminal emulator for agent conversations
- node-pty β pseudo-terminal that hosts the Copilot CLI
- @github/copilot-sdk β SDK control plane for the
ui-serverterminal backend - ws β WebSocket transport (SDK runtime + Teams real-time receive)
The terminal server (electron/terminal/server.ts) selects a backend via the COPILOT_TERMINAL_BACKEND environment variable:
node-pty(fallback, always available) β spawns the real Copilot TUI directly, one PTY per agentui-server(default) β node-pty hosts onecopilot --ui-serverruntime per office and the Copilot SDK attaches over a local port; automatically falls back tonode-ptywhen the CLI can't host--ui-serversdk(legacy) β the SDK spawns its own headless runtime over stdio
To use the app in full you'll need:
- Node.js 18+ and npm
- GitHub Copilot access β the agents run the real Copilot CLI, so you must be signed in to a GitHub account with an active Copilot subscription. The CLI runtime ships with the app via the
@github/copilot-sdkplatform package; on first run, authenticate through the CLI as prompted. - (Teams remote agents only) Azure CLI β the Teams feature acquires Microsoft Graph and IC3 tokens via
az account get-access-token, so you must have the Azure CLI installed and be logged in (az login) with an account that has access to the target Teams channel. This feature is off by default and enabled in Settings.
npm i -g copilotoffice
copilotofficegit clone https://github.com/dan1510123/CopilotOffice.git
cd CopilotOffice
npm install
# Build and run
npm start
# Development mode (with hot reload)
npm run dev| Key | Action |
|---|---|
WASD / Arrow Keys |
Move around the office |
Shift |
Sprint (2x speed) |
E |
Interact with nearby agent or object |
F10 |
Close terminal |
Escape |
Close terminal or mini-game |
Ctrl+Shift+N |
New terminal session (terminal focused) |
CopilotOffice/
βββ electron/ # Electron main process
β βββ main.ts # Window, IPC handlers, hot reload
β βββ nonTerminalIpc.ts # Non-terminal IPC handlers
β βββ officeFileStore.ts # Office persistence on disk
β βββ cli-bridge.ts # Legacy placeholder (not used at runtime)
β βββ terminal/ # Terminal server subsystem
β β βββ server.ts # PTY/SDK owner (forked child process)
β β βββ terminal-backend.ts # Backend selection (node-pty / ui-server / sdk)
β β βββ pty-registry.ts # Live PTY/session bookkeeping
β β βββ agent-viewers.ts # Active-viewer dual-key invariant helpers
β β βββ office-foreground.ts # Foreground session selection (ui-server)
β β βββ session-repair.ts # Session recovery
β β βββ ipc-relay.ts # IPC bridge (renderer β main β server)
β β βββ preload.ts # Context bridge (window.copilotBridge)
β β βββ protocol.ts # IPC message type definitions
β β βββ event-source.ts # Backend-agnostic event source
β β βββ events-watcher.ts # Copilot CLI event file parser
β βββ teams/ # Teams remote agents (main-process service)
β βββ teamsService.ts # Orchestrator (register/route/reply lifecycle)
β βββ auth.ts # Graph + IC3 tokens via `az`
β βββ graphClient.ts # Send channel messages
β βββ trouterClient.ts # Real-time receive (WebSocket)
β βββ chatsvcClient.ts # Poll fallback receive
β βββ messageFilter.ts # Dedup / marker / classify pipeline
β βββ dispatchQueue.ts # Per-agent FIFO dispatch
β βββ sessionGateway.ts # Adapter over the terminal server
β βββ onlineAgentsStore.ts # Online-agent persistence + GC
β βββ ... # channelLink, marker, chunk, resolvers, IPC
βββ src/ # Renderer process (Phaser + DOM)
β βββ main.ts # Entry point β DOM layout, Phaser init, IPC wiring
β βββ index.html # HTML host page
β βββ scenes/ # Phaser scenes
β β βββ BootScene.ts # Procedural sprite generation
β β βββ OfficeScene.ts # Main game scene (layout, NPCs, interactions)
β β βββ MeetingScene.ts # Meeting room with Arthur for planning
β βββ entities/ # Game entities (Player, NPC)
β βββ sprites/ # Procedural sprite generation + animation
β βββ ui/ # DOM overlays
β β βββ TerminalOverlay.ts # xterm.js terminal for agent sessions
β β βββ SeriousTerminalController.ts # Split-pane terminal controller
β β βββ FleetDashboard.ts # Fleet execution dashboard
β β βββ SettingsPanel.ts # Settings overlay
β β βββ TeamsSettingsOverlay.ts # Teams feature settings
β β βββ SpriteCustomizerPanel.ts # Player appearance customization
β β βββ GalaxianGame.ts # Galaxian mini-game
β β βββ PongGame.ts / BasketballGame.ts # Mini-games (feature-flagged)
β β βββ NotificationService.ts / NotificationSettingsPanel.ts / ToastNotification.ts
β β βββ CameraDragController.ts / DialogBox.ts
β βββ input/ # Keyboard focus management (InputManager + listeners)
β βββ office/ # Multi-office state management (officeManager.ts)
β βββ meeting/ # Meeting mode & fleet orchestration
β β βββ types.ts / planParser.ts / planApproval.ts
β β βββ fleetOrchestrator.ts / fleetTracker.ts / fleetVisualizer.ts
β βββ layouts/ # Layout system
β β βββ types.ts / index.ts # Layout registry + behaviors
β β βββ default/ # Default office layout
β β βββ fleet/ # Fleet v-team layout
β βββ config/ # Static configuration
β βββ agents.ts # Agent definitions, reserve + fleet config
β βββ depths.ts / zIndex.ts # Phaser depth + DOM z-index constants
β βββ notifications.ts # Notification event settings
β βββ meetingPrompt.ts # Meeting coordinator prompt
β βββ playerCustomization.ts # Player color customization
βββ dist/ # Build output
Edit src/config/agents.ts to add new NPCs. Six reserve agent slots (Azure, Val, Rex, Doc, Scout, Penny) already have pre-generated sprites β activate one by adding its config, or add a brand-new entry to the AGENTS array:
{
id: 'unique-id',
name: 'Display Name',
skill: 'general',
sprite: 'sprite_key',
color: 0xff0000, // Hex color for the procedural sprite
position: { x: 5, y: 7 }, // Grid position in the office (20Γ12 tile grid)
greeting: "Hello message shown when the player approaches",
description: 'Short description',
workingDir: 'optional/path', // Optional custom working directory
}Sprites are auto-generated from the color β no image assets needed.
Tip: Don't hardcode agent IDs in scene/layout/dashboard logic. Use the named constants exported from
src/config/agents.ts(GENERALIST_AGENT_ID,DEBUGGER_AGENT_ID,ADMIN_AGENT_ID,ARCHITECT_AGENT_ID,DEFAULT_PLAN_AGENT_IDS).
# Watch mode with hot reload
npm run dev
# Build only (no run)
npm run build
# Run without rebuilding
npm run electronnpm run test # Vitest unit/integration suite
npm run test:coverage # Vitest with coverage output
npm run test:e2e # Playwright end-to-end tests (runs a build first)- Stable:
npm i -g copilotoffice(uses the npmlatestdist-tag) - Beta:
npm i -g copilotoffice@beta(uses the npmbetadist-tag)
For maintainers: pushing to GitHub is not enough for npm i -g copilotoffice by name β
you must publish to npm. Typical flow:
npm run build
npm test
npm version patch
npm publish
# Beta example
npm version prerelease --preid=beta
npm publish --tag betaISC
