Turning Your Codebase into a Roguelike Dungeon: A Guide to Procedural Generation with GitHub Copilot CLI
Introduction
Have you ever wondered what it would be like to explore your own repository as a dungeon? That's exactly what the GitHub Copilot CLI Challenge inspired me to do. I built a GitHub CLI extension in Go that transforms any repository into a playable roguelike dungeon. The result is GitHub Dungeons—a terminal game where rooms, corridors, and enemies are generated from your codebase. Navigate with arrow keys, fight bugs, and hunt for the exit. Every repository produces a different map, and every commit reshapes the layout. If your HP hits zero, you start over—true roguelike permadeath.

What Is Procedural Generation?
Procedural generation (often called procgen) creates content algorithmically rather than by hand. In games, this means levels, maps, enemies, and items are generated at runtime using rules plus randomness. Instead of designing one dungeon, you design a system that generates many. This is what gives roguelikes their replayability:
- Every run is different
- Layouts change each time
- New challenges emerge
In GitHub Dungeons, the generation system ties directly to your repository. The layout is seeded by your latest commit SHA, so the same code produces the same dungeon, and every change reshapes it.
How Does a Repository Become a Dungeon?
At a high level, GitHub Dungeons uses Binary Space Partitioning (BSP) to generate layouts. BSP recursively splits a rectangular space into smaller rectangles, which become rooms, and then connects them with corridors. The entire process is seeded by the commit SHA of your repository. This means:
- The same commit always generates the same map
- Different repositories produce structurally distinct layouts
- As your code changes, the dungeon evolves with it
It's procedural generation—but tied directly to your codebase. That's the core idea.

Building with GitHub Copilot CLI
I wrote the extension in Go, a language I don't normally use. Working with GitHub Copilot CLI meant I could focus on behavior rather than syntax. The /yolo command (short for /allow-all) was especially fitting—roguelikes are built around permadeath, and here you really only get one life. The Copilot CLI helped me quickly prototype the dungeon generation, input handling, and enemy logic. Instead of wrestling with Go's syntax, I described what I wanted and let the AI generate the code. This accelerated development and let me experiment with BSP and game mechanics.
The Roguelike Tradition
Roguelikes trace back to Rogue in the 1980s—terminal-based adventures where each run generated a new dungeon, and death meant starting over. That combination of procedural generation, permadeath, and text-based interfaces (later formalized in the Berlin Interpretation) makes the genre feel surprisingly modern. It's a perfect fit for the command line. GitHub Dungeons leans into that tradition, using a modern codebase to generate classic gameplay.
Conclusion
GitHub Dungeons is more than a game—it's a way to interact with your code creatively. By combining BSP, Go, and GitHub Copilot CLI, I turned a repository into an ever-changing adventure. Try it yourself: seed a dungeon from your own code, navigate its corridors, and see how each commit reshapes the map. The dungeon is alive, and it evolves with every line you write.
Related Articles
- 5 Terminal Power Tools That Eliminated My Need for Graphical Apps
- Apple Vision Pro Lives On: Debunking Abandonment Rumors
- CANopenTerm: A Terminal-Based Power Tool for CAN Network Monitoring and Analysis
- Swift Development Reaches New Horizons: IDE Ecosystem Expands
- Cozzilla, Godzilla's Most Bizarre Incarnation, to Finally Get Official Blu-Ray Release After Decades of Obscurity
- Unlocking the Power of Blocks: A Universal Protocol for the Web
- How to Safeguard Your Data from Malicious AI Browser Extensions
- HashiCorp Vault's AI Agent Support: Identity, Authorization, and Ephemeral Controls