Thchere

Code to Catacombs: Crafting a Procedural Roguelike with GitHub Copilot CLI

Published: 2026-05-15 11:21:15 | Category: Software Tools

Ever wondered what happens when a codebase meets a roguelike? One developer took the GitHub Copilot CLI Challenge and built GitHub Dungeons—a terminal game that transforms any repository into a playable dungeon. Rooms, corridors, and enemies emerge from your code, all navigated with arrow keys. Each commit reshapes the layout, and permadeath means one wrong move sends you back to the start. Below, we dive into the mechanics, the tech, and the madness behind this project.

§ What exactly is GitHub Dungeons?

GitHub Dungeons is a terminal-based roguelike written in Go that generates a dungeon from any GitHub repository. The game uses the repo’s latest commit SHA as a seed to procedurally create rooms, corridors, and enemies. You navigate via arrow keys, fight bugs, and search for the exit. Every repository produces a unique map, and each commit alters the layout. If your health drops to zero, you restart from scratch—true to the roguelike tradition. The project was built using GitHub Copilot CLI, which allowed the developer to focus on behavior over syntax.

Code to Catacombs: Crafting a Procedural Roguelike with GitHub Copilot CLI
Source: github.blog

§ How does procedural generation work in this context?

Procedural generation is a method of creating content algorithmically rather than by hand. In games, it means levels, maps, and enemies are generated at runtime using a set of rules and randomness. Instead of designing one dungeon, you design a system that produces endless variations. This gives roguelikes their replayability: every run is different, layouts change, and surprises await. In GitHub Dungeons, the system is tied directly to your codebase. The dungeon’s shape is seeded by the latest commit, so the same code yields the same map, while every change reshapes the adventure.

§ How does a repository actually become a dungeon?

The transformation relies on Binary Space Partitioning (BSP), a classic technique for generating dungeon layouts. The latest commit’s SHA acts as a random seed, feeding the BSP algorithm to split the space into rooms and corridors. The result: a consistent layout for the same commit, yet structurally distinct for different repos or updated code. In practice, the same commit always produces the exact same map, making debugging possible. Different repositories feel unique, and as the code evolves, so does the dungeon—a living procedural generation tied directly to your work.

§ What role did GitHub Copilot CLI play in building it?

GitHub Copilot CLI allowed the developer to describe behavior in plain English and have the tool generate the corresponding Go code. Since Go wasn’t the developer’s primary language, this was a major boost. With Copilot CLI, they could focus on game design decisions—like how rooms connect or how enemies spawn—rather than wrestling with syntax. The /yolo command (an alias for /allow-all) enabled rapid experimentation. It perfectly echoes the roguelike philosophy of permadeath—you only get one life, so make every move count.

Code to Catacombs: Crafting a Procedural Roguelike with GitHub Copilot CLI
Source: github.blog

§ What roguelike features does GitHub Dungeons include?

GitHub Dungeons embraces the core pillars of the genre: procedural generation, permadeath, and a text-based interface. Each new game generates a fresh dungeon from your repository. If your character dies, it’s game over—no continues, no saves. This reinforces tactical decision-making. The game also follows the spirit of the Berlin Interpretation, a modern set of roguelike guidelines. While not strictly turn-based, the terminal-driven experience and random loot drops (like health potions) keep it authentic. The result is a roguelike that feels both nostalgic and innovative, blending classic gameplay with your own codebase.

§ How does the dungeon change with each commit?

Because the dungeon’s seed is the latest commit’s SHA, every new commit potentially alters the map. Even a minor code change can lead to a completely different layout—new rooms, shifted corridors, repositioned enemies. This means your repository is never static; it evolves alongside your development. For the player, this adds a layer of unpredictability: you might know the code, but the dungeon is always one commit ahead. This dynamic generation encourages replayability and ties the game’s lifecycle to the project’s activity. Stale repos produce stale maps; active repos keep the adventure fresh.