惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

Resources to grow as a software developer - The GitHub Blog

Transitioning as a Hubber I automated my job (and it made me a better leader) GitHub for Beginners: Answers to some common questions GitHub for Beginners: Getting started with Git and GitHub in VS Code Dungeons & Desktops: 10 roguelikes that never die (because their communities won’t let them) GitHub for Beginners: Getting started with OSS contributions GitHub for Beginners: Getting started with Markdown GitHub for Beginners: Getting started with GitHub Pages GitHub Copilot CLI for Beginners: Getting started with GitHub Copilot CLI Agent-driven development in Copilot Applied Science GitHub for Beginners: Getting started with GitHub security Building AI-powered GitHub issue triage with the Copilot SDK
Dungeons & Desktops: Building a procedurally generated roguelike with GitHub Copilot CLI
Lee Reilly · 2026-05-12 · via Resources to grow as a software developer - The GitHub Blog

I got nerd-sniped into the GitHub Copilot CLI Challenge and made a questionable decision: I turned my codebase into a roguelike dungeon.

It started with a simple prompt: 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 [snip]. And then /yolo .

The result is GitHub Dungeons, a terminal game that generates a dungeon from your codebase. Rooms, corridors, and enemies, all built from your repo and rendered right in your terminal. You navigate with arrow keys, fight bugs, and hunt for the exit. Every repository produces a different map. Every commit reshapes the layout. And if your HP hits zero, you start over.

Screenshot of 'gh dungeons'

💡 Fun fact: /yolo (“you only live once”) is a Copilot CLI command (an alias for /allow-all). Fitting, since roguelikes are built around permadeath. You really do only get one life.

Roguelikes trace back to games like 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 things like the “Berlin Interpretation”) makes the genre feel surprisingly modern, and a perfect fit for the command line.

GitHub Dungeons leans into that tradition. It’s written in Go, which I don’t normally use, but working with Copilot meant I could focus on behavior instead of syntax.

What is procedural generation?

Procedural generation (or “procgen” as the cool kids call it) is a way of creating content algorithmically instead of designing it by hand. In games, that usually means levels, maps, enemies, or items are generated at runtime using a set of rules plus a bit of randomness.

So instead of designing one dungeon, you design a system that generates many.

That’s what gives roguelikes their replayability:

  • Every run is different
  • Layouts change every time
  • Something
  • Something

In GitHub Dungeons, that system is tied to your repo. The layout is seeded by your latest commit, so the same code produces the same dungeon, and every change reshapes it.

So how does a repository actually become a dungeon?

At a high level, GitHub Dungeon layouts are generated using Binary Space Partitioning (BSP), seeded by your repository’s latest commit SHA (more on BSP in a bit). That means the same codebase produces a consistent layout, while still evolving as the code changes.

In practice:

  • 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

It’s procedural generation—but tied directly to your codebase. That’s the idea.

The interesting part was actually building it.

Building it with Copilot CLI

Working with GitHub Copilot CLI meant describing behavior instead of writing everything from scratch. One command that made a big difference was /delegate. Instead of just generating code inline, /delegate hands the task off to GitHub’s Copilot coding agent running in the cloud.

I could describe what I wanted in plain English, kick it off, and then go do something else while it worked independently. When it finished, it opened a pull request with the results.

For example,/delegate Make each level progressively harder e.g. on level 2 there are extra baddies, but more health potions

Copilot generated a solid first pass asynchronously, and I reviewed and tweaked the PR from there until the balance felt right. I took the same approach to other features like adding cheat codes that make the player invincible (because why not).

I even had Copilot generate a “dungeon scribe” agent, a small helper that added documentation and ASCII art diagrams to explain how dungeons were generated, which felt very on-brand for a terminal roguelike.

I even had Copilot generate a dungeon scribe agent to create documentation and explain how dungeons were generated with ASCII art diagrams, which felt very on-brand for a terminal roguelike.

Using Copilot (especially with /delegate) is like having an army of NPCs available to do whatever I want them to do.

Lee Reilly, Dungeon Master

Working this way (describing features, delegating them to Copilot, and reviewing the resulting pull requests) meant I could spend less time on edge cases and boilerplate, and more time on the player experience, including adding easter eggs for players to discover. Iterating with Copilot let me stay in a game design mindset instead of constantly switching into implementation details. Because Copilot was handling most of the build and scaffolding, I could stay in the flow of designing mechanics, testing ideas, and figuring out what actually made the game fun.

Procedurally generated levels (with BSP)

At the heart of each dungeon design is a technique called Binary Space Partitioning (BSP), which is a great thing to casually mention alongside middle-out compression if you want to impress your friends and colleagues. It sounds intimidating, but the idea is surprisingly simple: keep splitting a space into smaller chunks until you have a bunch of rooms you can connect.

Why BSP works so well for roguelikes

Roguelikes need maps that feel:

  • Structured (not completely random nonsense)
  • Replayable (different every run)
  • Navigable (no dead ends or impossible layouts)

BSP hits a sweet spot. It gives you:

  • Clean, rectangular rooms
  • Guaranteed connectivity
  • Just enough randomness to feel organic

Here’s how it works…

1. Start with a big empty space

Everything begins as one big rectangle: your entire dungeon.

Screenshot of 'entire map' and 'start with one rectangle'.

2. Split it (recursively)

We split the space into two regions.

Screenshot showing two boxes: left and right.

Then split those again.

Screenshot showing three boxes: A, B, and C.

And again.

Each split can be horizontal or vertical.

3. Stop when it gets too small

We keep splitting until regions are too small to fit a room.

That creates a bunch of “leaf” regions, the final building blocks.

Screenshot showing six boxes: A, B, C, D, E, and F.

4. Turn each region into a room

Each leaf becomes a room, but not perfectly aligned. We randomize size and position slightly.

Screenshot showing six rooms.

That slight randomness is what stops everything feeling too grid-like.

5. Connect rooms with corridors

Now we connect rooms by walking back up the tree and linking siblings.

Screenshot showing rooms 1 and 2 separated.
Screenshot showing rooms 1 and 2 connected.

Each connection is an L-shape:

6. End result: structured chaos

Put it all together and you get something like this:

Screenshot showing the final room layout.
  • Rooms feel intentional
  • Corridors make everything reachable
  • Every run is different (but reproducible with a seed)

Why this lands so well

What I like about BSP is that it feels designed, even though it isn’t.

It avoids the two big problems of procedural generation: pure randomness (messy), and rigid grids (predictable, boring). Instead, you get something in between… and sometimes beautiful.

How to install and play it

If you want to see what your own codebase looks like as a dungeon, and you already have GitHub Copilot CLI installed, you can run:

gh extension install leereilly/gh-dungeons 

After that, run gh dungeons to transform your repository into a custom dungeon, ready to be conquered. Control your hero with WASD, arrow keys, or Vim keys.

Your goal is to find the hidden door and escape from (and attack!) enemies over five levels. I’ve added fun features like fog of war that limit visibility, auto-attack, ability to track stats like kills and conquered levels, and more that you’ll have to discover yourself.

Danger zone!

If you’re feeling reckless, play it on crazy mode: you can set up a pre-commit hook that deletes your saved changes unless you beat the entire game.

⚠️ WARNING: Do not do this unless you fully understand what this will do to your repository, you’ll lose saved work and probably some sanity as well.

# Create the pre-commit hook 
cat > .git/hooks/pre-commit << 'EOF' 
#!/bin/bash 
gh dungeons 
if [ $? -ne 0 ]; then 
    echo "You died! Your changes have been stashed into oblivion..." 
    git stash && git stash drop stash@{0} 
    exit 1 
fi 
EOF 
 
# Make it executable 
chmod +x .git/hooks/pre-commit 
 
# To be clear, you’ll lose all your uncommited changes if you enable this 
# and fail to beat the dungeon, adventurer. 

(Editor’s note: Please, please, please do not do this. We are not responsible for any lost work. But Lee definitely is.)

Take this with you

This started as a throwaway experiment, but it changed how I think about GitHub Copilot CLI.

I was able to MVP it quickly, iterate on the parts that mattered, and let Copilot handle the heavy lifting, things like BSP generation and even monsters and movement defined in a slightly cursed YAML file of Yendor.

Written by

Lee Reilly

Senior Program Manager, GitHub Developer Relations. Open source hype man, AI whisperer, hackathon and game jam wrangler. I write && manage programs, support dev communities, and occasionally ship something.

Explore more from GitHub

Docs

Docs

Everything you need to master GitHub, all in one place.

Go to Docs

GitHub

GitHub

Build what’s next on GitHub, the place for anyone from anywhere to build anything.

Start building

Customer stories

Customer stories

Meet the companies and engineering teams that build with GitHub.

Learn more

The GitHub Podcast

The GitHub Podcast

Catch up on the GitHub podcast, a show dedicated to the topics, trends, stories and culture in and around the open source developer community on GitHub.

Listen now