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

Run it inside any git repository โ€” no arguments needed:

gitquest

python -m gitquest works too.

Flags

Flag Description
--path <repo> Play on another repository (default: current directory).
--seed <n> Force a specific dungeon seed (default: derived from repo).
--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.1.0.tar.gz (29.6 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.1.0-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gitquest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5998c7b1c561e43a34b227e8adaffee96893966dd34b202d2c7f04ab910b9344
MD5 e994171cf943a05166a5ebdc971cda8f
BLAKE2b-256 24cafb0b39f3ca754ad7cc0201269ba7841ecd6d3c054aa6a0847e046bfbddf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitquest-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: gitquest-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 28.6 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2077b957ef4d2b0db691556e26e86e10a9587501bd033291fe7fe9c70eb97e0
MD5 73e491b04080fba967b1b006bffb98d6
BLAKE2b-256 356cc08894e5a89ffc617e708f0ad7d0576cd54acd8535a544df196d23330c55

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitquest-0.1.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