Turn your GitHub contribution graph into a real game of Snake — animated SVG, zero dependencies, drop-in Action.
Python
27
9 commits
updated Oct 2, 2026
Your GitHub contribution graph, but it's a real game of Snake.
The snake plays an actual, winnable game. It hunts every commit cell with real pathfinding, never crosses its own body, grows one segment per cell it eats, fades from a bright head to a dim tail, and counts the commits it swallows. Pure animated SVG (CSS, no JavaScript), so it renders anywhere GitHub shows an image.
green (default), blue, amber, matrixprefers-reduced-motion: falls back to a static graphAdd one workflow to your profile repo (the repo named after your username).
Create .github/workflows/snake.yml:
name: snake
on:
schedule:
- cron: "0 */12 * * *" # twice a day
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: dahan8473/snake-and-commits@v1
with:
github_user: ${{ github.repository_owner }}
output: dist/snake.svg
theme: green
- uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ github.token }}
Run it once from the Actions tab, then add this to your README.md:

It regenerates on schedule from your live contribution data.
Generate two themes and switch with <picture>:
<picture>
<source media="(prefers-color-scheme: dark)" srcset=".../output/snake-dark.svg">
<source media="(prefers-color-scheme: light)" srcset=".../output/snake-light.svg">
<img src=".../output/snake-dark.svg" alt="contribution snake">
</picture>
| input | default | description |
|---|---|---|
github_user | required | whose graph to render (usually ${{ github.repository_owner }}) |
output | dist/snake.svg | output path |
theme | green | green, blue, amber, matrix |
frame | false | draw a rounded window frame around the graph |
counter | true | show the commits eaten: n/total counter |
| theme | look |
|---|---|
🟩 green | native GitHub |
🟦 blue | phosphor terminal |
🟧 amber | old CRT |
⬛ matrix | bright-on-black |
GH_TOKEN=$(gh auth token) python3 generate.py --user YOUR_NAME --output snake.svg --theme green
One file, standard library only. Any token that can read public contribution data works.
Built by David Liu. Inspired by the contribution-graph art tradition (Platane/snk and friends), rebuilt from scratch as an actual game of Snake. MIT licensed.
pls drop a star!
Python
100.0%
Turn your GitHub contribution graph into a real game of Snake — animated SVG, zero dependencies, drop-in Action.
Python
27
9 commits
updated Oct 2, 2026
Your GitHub contribution graph, but it's a real game of Snake.
The snake plays an actual, winnable game. It hunts every commit cell with real pathfinding, never crosses its own body, grows one segment per cell it eats, fades from a bright head to a dim tail, and counts the commits it swallows. Pure animated SVG (CSS, no JavaScript), so it renders anywhere GitHub shows an image.
green (default), blue, amber, matrixprefers-reduced-motion: falls back to a static graphAdd one workflow to your profile repo (the repo named after your username).
Create .github/workflows/snake.yml:
name: snake
on:
schedule:
- cron: "0 */12 * * *" # twice a day
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: dahan8473/snake-and-commits@v1
with:
github_user: ${{ github.repository_owner }}
output: dist/snake.svg
theme: green
- uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: output
build_dir: dist
env:
GITHUB_TOKEN: ${{ github.token }}
Run it once from the Actions tab, then add this to your README.md:

It regenerates on schedule from your live contribution data.
Generate two themes and switch with <picture>:
<picture>
<source media="(prefers-color-scheme: dark)" srcset=".../output/snake-dark.svg">
<source media="(prefers-color-scheme: light)" srcset=".../output/snake-light.svg">
<img src=".../output/snake-dark.svg" alt="contribution snake">
</picture>
| input | default | description |
|---|---|---|
github_user | required | whose graph to render (usually ${{ github.repository_owner }}) |
output | dist/snake.svg | output path |
theme | green | green, blue, amber, matrix |
frame | false | draw a rounded window frame around the graph |
counter | true | show the commits eaten: n/total counter |
| theme | look |
|---|---|
🟩 green | native GitHub |
🟦 blue | phosphor terminal |
🟧 amber | old CRT |
⬛ matrix | bright-on-black |
GH_TOKEN=$(gh auth token) python3 generate.py --user YOUR_NAME --output snake.svg --theme green
One file, standard library only. Any token that can read public contribution data works.
Built by David Liu. Inspired by the contribution-graph art tradition (Platane/snk and friends), rebuilt from scratch as an actual game of Snake. MIT licensed.
pls drop a star!
Python
100.0%