Skip to main content

Turn your git commit history into a playable ASCII dungeon roguelike.

Project description

gitquest ๐Ÿ—ก๏ธ

Your commits. Your dungeon. Your legend. Turn any git repository's history into a procedurally generated, playable ASCII dungeon roguelike โ€” right in your terminal.

gitquest reads your repo's real commit history and deterministically builds a dungeon from it. Each commit becomes a room. Bug-fix commits spawn bugs. Merge commits become mini-bosses. The languages you've coded fill your skill tree. Clear every room from the repo's first commit to HEAD, then flex your career on a shareable stats card.

Same repo + same seed = the same dungeon, every time. Reproducible and shareable.


โœจ Demo

   ____ _ _    ___                  _
  / ___(_) |_ / _ \ _   _  ___  ___| |_
 | |  _| | __| | | | | | |/ _ \/ __| __|
 | |_| | | |_| |_| | |_| |  __/\__ \ |_
  \____|_|\__|\__\_\\__,_|\___||___/\__|

      Your commits. Your dungeon. Your legend.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Room 2/5 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ fix: bug in output handling                                                  โ”‚
โ”‚ 33b27d3 ยท +2/-0 ยท a tight crawlspace of tangled diffs                        โ”‚
โ”‚ ๐Ÿง™ You meet Ada Lovelace, an ally from this commit.                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
๐Ÿง  Skill XP: +1 Python, +1 JavaScript
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ A Bug appears! โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                          (>_<)                                               โ”‚
โ”‚                          Off-by-One                                          โ”‚
โ”‚                          HP 11  ยท  ATK 4  ยท  DEF 0                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Attack  Defend  Item(0)  Run
Your move (a): ยป Hero hits Off-by-One for 6 damage.
โœ” Off-by-One defeated! (+10 XP, +6 gold)

And the grand finale โ€” the shareable flex card:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ flex card โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    โš”  GITQUEST CAREER CARD  โš”                                โ”‚
โ”‚                    my-repo   seed 17391773614721965407                       โ”‚
โ”‚                                                                              โ”‚
โ”‚     RANK: Senior Crusader                                                    โ”‚
โ”‚     SCORE: 2310                                                              โ”‚
โ”‚     STATUS: VICTORIOUS                                                        โ”‚
โ”‚                                                                              โ”‚
โ”‚     CAREER STATS                                                             โ”‚
โ”‚       Level   11              Gold   642                                     โ”‚
โ”‚       Kills   148           Bosses   12                                      โ”‚
โ”‚     SKILL TREE                                                               โ”‚
โ”‚   Python      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 220                                         โ”‚
โ”‚   TypeScript  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 130                                         โ”‚
โ”‚     Specialization: Python  ยท  6 skill paths explored                        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Install

The zero-friction way (isolated, recommended):

pipx install gitquest

Or with pip:

pip install gitquest

From source:

git clone https://github.com/jithin-jz/gitquest
cd gitquest
pip install .

๐ŸŽฎ Play

Two commands โ€” works on any machine, even with no repo around:

pip install gitquest
gitquest

If you run gitquest inside a git repository, it builds the dungeon from your commit history. If you run it anywhere else, it automatically launches a built-in demo dungeon so you can play right away.

python -m gitquest works too. Want your own repo? cd into it first, or pass --path:

cd path/to/your/repo && gitquest
gitquest --path ../some-other-repo
gitquest --demo            # force the built-in demo dungeon

Combat controls

During a fight, type one key + Enter: a attack ยท d defend ยท i item ยท r run.

Flags

Flag Description
--path <repo> Play on another repository (default: current directory).
--seed <n> Force a specific dungeon seed (default: derived from repo).
--demo Play the built-in demo dungeon (no git repo required).
--fast Skip animations and "press Enter" pauses.
--stats-only Skip gameplay and print just the flex card.
--max-commits Cap/sample commits for huge repos (default: 300).
--version Print the version.

Examples:

gitquest --path ../some-other-repo
gitquest --seed 42 --fast
gitquest --stats-only        # instant career card, no fighting

๐Ÿง  How it works

gitquest maps real repository data onto game mechanics:

Git data Becomesโ€ฆ
Commit A room in the dungeon
Lines added/removed Room size + monster difficulty
Merge commit A mini-boss room
Files changed Loot/items in the room
Commit author An ally/NPC you meet
Languages (by file extension) Your skill tree / XP categories
Message keywords Enemy types (fix โ†’ Bug, feat โ†’ Featureโ€ฆ)
Total repo stats Your final rank (e.g. Senior Crusader)

Determinism

The dungeon seed is derived from the SHA of the repository's first commit (unless you pass --seed). All procedural generation โ€” monster names, stats, loot rolls, room sizes โ€” flows from that single seed via a random.Random instance with a fixed call order. The result: identical, reproducible dungeons that you and a teammate can compare.

Architecture

gitquest/
  cli.py          # entry point + argument parsing (argparse)
  git_parser.py   # extract & normalize commit data (GitPython + git CLI fallback)
  generator.py    # commit data -> dungeon/rooms/monsters (seeded)
  engine.py       # game loop, state, turn handling
  combat.py       # combat math (pure, rng-driven, testable)
  entities.py     # Player, Monster, Room, Item, Dungeon dataclasses
  renderer.py     # all rich-based rendering
  flexcard.py     # final shareable stats card + ranking
  data/           # monster/item name lists, ranks, ascii art
tests/            # pytest: parser, generator determinism, combat

Everything runs locally and offline โ€” no network calls, ever.


๐Ÿ› ๏ธ Development

pip install -e ".[dev]"
pytest

Tests cover history parsing, generator determinism, and combat logic.

Edge cases handled

  • Not a git repository โ†’ friendly error, no traceback.
  • Empty history / no commits โ†’ friendly nudge to commit first.
  • Huge repos โ†’ evenly down-sampled to --max-commits (still deterministic).
  • Missing GitPython โ†’ automatic fallback to the git CLI.

๐Ÿค Contributing

Issues and PRs welcome! Ideas: more monster archetypes, a textual dungeon map, achievements, or exporting the flex card as an image.

๐Ÿ“„ License

MIT โ€” see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitquest-0.2.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitquest-0.2.0-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file gitquest-0.2.0.tar.gz.

File metadata

  • Download URL: gitquest-0.2.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gitquest-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e6148d2b26f94c0152e268d514f0870971d2b7d0325c18f94fe487cea4668264
MD5 f501e4d0a035f3933f93b223e2b92e18
BLAKE2b-256 b29af446dce4147e432277c3548833cf64d845e007925f89799c727dff8642a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitquest-0.2.0.tar.gz:

Publisher: publish.yml on jithin-jz/gitquest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gitquest-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gitquest-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gitquest-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82bb229bdd81ada836ac4306ba6a8170cd9a8d183dea69267edb6eae87e68e93
MD5 cde1324e5de228fea22458681d3965e7
BLAKE2b-256 8a311c6c3709a6bef1191bfcd1d60592f674edf6388e48be2f4ddfa2f4b8ef7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitquest-0.2.0-py3-none-any.whl:

Publisher: publish.yml on jithin-jz/gitquest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page