Turn your GitHub contribution graph into pixel-art by generating backdated commits from a web UI.
- Features
- Technology Stack
- Technical Block
- Getting Started
- Testing
- Deployment
- Usage
- Configuration
- License
- Contacts
Contribution Painter is built for devs who want deterministic control over contribution heatmaps without touching heavy frameworks.
- Interactive GitHub-style yearly heatmap editor with drag-to-paint controls.
- Intensity model (
0..4) + commit multiplier (x1/x3/x5/x10) for fast density scaling. - Year selection across current, previous, and next years with automatic week-grid alignment.
- Keyboard shortcuts (
0..4) for instant palette switching. - Graph operations: clear canvas, fill all active cells, invert paint state.
- Real-time stats: painted days, estimated commit count, and active period boundaries.
- Direct GitHub REST API push pipeline that writes git blobs, trees, commits, and branch refs.
- Supports creating a new branch if the target branch does not exist.
- Multi-language UI via pluggable i18n dictionaries.
- Progress bar + live logs for long-running commit generation jobs.
- Vercel-ready static deployment config.
- AI-driven GitHub Action that analyzes code changes and opens structured issues.
Important
The tool creates real commits in your repository history. Use it only in repos where rewritten contribution history is acceptable.
HTML5for the single-page UI shell.CSS3for GitHub-like contribution graph styling.Vanilla JavaScriptfor editor state, i18n, and GitHub API integration.
Python 3.11+for GitHub Action automation script.PyGithub,requests,python-dotenvfor GitHub and model API orchestration.
GitHub Actionsfor automated push/PR analysis.Vercelstatic hosting config for frontend deployment.
.
βββ index.html # Main web app entrypoint
βββ css/styles.css # UI styles
βββ js/
β βββ app.js # Painter logic + GitHub API workflow
β βββ i18n/*.js # Localization dictionaries
βββ process_event.py # AI-powered GitHub issue generator workflow script
βββ .github/
β βββ workflows/ai-issue.yml # CI workflow invoking automation script
β βββ ISSUE_TEMPLATE/ # Bug/feature templates
β βββ pull_request_template.md # PR checklist template
βββ requirements.txt # Python dependencies for automation
βββ vercel.json # Static hosting routing and headers
βββ LICENSE # GPL-3.0 license
- Frontend is framework-free by design: lower bundle complexity, easier self-hosting, and easy auditability.
- Commits are generated via low-level Git Data API (
blobs/trees/commits/refs) to allow exact commit timestamp control. - The contribution editor maps to a week-column x weekday-row matrix to mirror GitHub contribution graph semantics.
- i18n dictionaries are split per locale to keep translation churn isolated and avoid monolithic translation files.
- CI analysis is decoupled from frontend runtime; automation lives in Python to leverage mature GitHub SDK ergonomics.
Install these tools first:
gitPython 3.11+pip- Optional for frontend local dev convenience:
python -m http.serveror any static file server - A GitHub personal access token with
reposcope for writing commits
Tip
For testing safely, create a throwaway repository with a single seed commit (README.md) before pushing generated history.
# 1) Clone repository
git clone https://github.com/readme-SVG/Contribution-Painter.git
cd Contribution-Painter
# 2) Set up Python environment (for automation script and local checks)
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# 3) Run a local static server for the frontend
python3 -m http.server 8080
# 4) Open in browser
# http://localhost:8080This project is lightweight and does not currently ship with a formal unit/integration test suite. You can still run practical validation checks.
# Python syntax check for backend automation
python3 -m py_compile process_event.py
# Optional: quick dependency sanity
python3 -m pip check
# Optional: run script help/debug in controlled env
# (requires env vars like GITHUB_TOKEN, GH_MODELS_TOKEN)
python3 process_event.pyWarning
Running process_event.py without required environment variables will fail by design.
The repository includes vercel.json for static deployment with SPA-style route fallback.
# Option A: Vercel CLI
npm i -g vercel
vercel
# Option B: connect repo in Vercel dashboard
# Vercel will serve index.html and route all paths back to it.- On pushes to
mainand PR events,ai-issue.ymlruns the Python analyzer. - The workflow checks out code, installs Python, installs dependencies, and executes analysis script.
Caution
Ensure secrets (GH_MODELS_TOKEN, optional ALLOWED_USER) are configured before enabling the workflow in production repos.
Use the web UI to paint days and push generated commits.
# 1. Open app in browser.
# 2. Fill in:
# - GitHub Token (repo scope)
# - Repository: <owner>/<repo>
# - Email: exactly matching GitHub account email
# - Git name and branch (optional, defaults to main)
# 3. Pick year + intensity + multiplier.
# 4. Paint graph cells with mouse (or hit keys 0-4 to switch levels).
# 5. Click "Push to GitHub" and monitor progress/log output.
Example local run:
python3 -m http.server 8080
# then visit http://localhost:8080 and execute push from UIGitHub Token(reposcope required for commit/branch writes)Repository(owner/repo)Email(must match GitHub account email for contribution graph attribution)Name(commit author/committer display name)Branch(target branch, created automatically when missing)Commit multiplier(scales commit volume per painted intensity)Year(drives graph date range)
GITHUB_TOKENβ GitHub Actions token used by workflow.REPOSITORYβ target repository identifier.EVENT_NAMEβ event type (push,pull_request, etc.).COMMIT_SHAβ commit hash for push context.PR_NUMBERβ PR number when running in PR context.GH_MODELS_TOKENβ token for model endpoint authentication.ALLOWED_USERβ optional actor gate for execution.
Distributed under the GPL-3.0 license. See LICENSE for full legal text.
If you find this tool useful, consider leaving a β on GitHub or supporting the author directly.