Code Becomes a Roguelike Dungeon

GitHub Copilot CLI transforms code into a roguelike dungeon, showcasing AI's potential in game development and creative coding.

Screenshot of GitHub Dungeons terminal game showing a dungeon layout generated from code.
GitHub Dungeons transforms repositories into playable roguelike environments.· Github Blog
Contents(3)

GitHub developer Lee Reilly has turned a codebase into a playable roguelike dungeon using the GitHub Copilot CLI. The tool, named GitHub Dungeons, generates a unique dungeon map for every repository, with its layout evolving alongside code commits.

This project leverages procedural generation, a method of creating content algorithmically rather than by hand. For roguelikes, this typically means generating levels, maps, or enemies using rules and randomness, ensuring each playthrough offers a fresh experience. The exact phrase procedurally generated roguelike describes this core mechanic.

From Code to Combat

The extension transforms a repository into a terminal-based adventure where players navigate using arrow keys, fight 'bugs', and search for an exit. Each repository yields a distinct map, and every code change reshapes the dungeon's layout. Permadeath, a genre staple, means starting over upon defeat.

Reilly described the prompt that kicked off the project: "Build a GitHub CLI extension in Go that takes the current repository and turns it into a playable roguelike dungeon, with dungeons generated with BSP." The result is a testament to the creative applications of AI in development.

AI Assistance in Game Design

Working with GitHub Copilot CLI, particularly the /delegate command, allowed Reilly to describe desired behaviors and have the AI handle implementation. This included generating features like progressively harder levels and invincibility cheat codes.

This approach is akin to having an army of NPCs available for tasks, as detailed in discussions about Copilot CLI: Chat vs. Quick Commands.

Reilly found that iterating with Copilot kept him in a game design mindset, minimizing context switching to implementation details.

The Art of Procedural Maps

At the core of GitHub Dungeons' map generation is Binary Space Partitioning (BSP). This technique involves recursively splitting a space into smaller regions until they are small enough to become rooms. These rooms are then connected by corridors.

BSP is ideal for roguelikes because it creates structured, replayable, and navigable maps. It balances predictability with enough randomness to feel organic, a key element for the genre's appeal.

The same commit always generates the same map.

Different repositories produce layouts that feel structurally distinct.

As the code changes, the dungeon evolves with it.

This project highlights how tools like the GitHub Copilot CLI builds emoji generator can be extended for novel applications, blurring the lines between coding and creative design.

© 2026 StartupHub.ai. All rights reserved. You may not republish this article in full without a license. Search engines and AI research tools may crawl and summarize for reference. Bulk reproduction or model training requires a license. See our terms.

Watch

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.

Daniel Singer

Written by

Daniel Singer

Editor, StartupHub.ai

Daniel Singer is the editor of StartupHub.ai, a technology expert and thought leader on AI and its applications across sectors, from fintech and healthcare to developer tooling and consumer software. He writes and tests the tools covered here thoroughly and regularly, and built StartupHub.ai to give founders, operators and buyers a clearer read on what they are actually being sold.