Code Becomes a Roguelike Dungeon

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

2 min read
Screenshot of GitHub Dungeons terminal game showing a dungeon layout generated from code.
GitHub Dungeons transforms repositories into playable roguelike environments.· Github Blog

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.

Related startups

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. Do not enter, scrape, copy, reproduce, or republish this article in whole or in part. Use as input to AI training, fine-tuning, retrieval-augmented generation, or any machine-learning system is prohibited without written license. Substantially-similar derivative works will be pursued to the fullest extent of applicable copyright, database, and computer-misuse laws. See our terms.