git-poster
v1.0.2
Published
Turn your Git history into a beautiful poster
Maintainers
Readme
git-poster
Turn your Git history into a beautiful poster.
A zero-config CLI that parses your Git log and renders a contribution heatmap poster as an SVG or PNG — no account required, fully local.
Installation
Run directly (no install needed):
npx git-posterInstall globally:
npm install -g git-poster
git-posterInstall locally in a project:
npm install --save-dev git-poster
npx git-posterPNG support (optional):
npm install -g sharp
git-poster --pngRequires Node.js 18 or later.
Quick Start
cd your-repo
git-posterThat's it. Run from any Git repository and get git-poster.svg in the current directory.
Features
- 5 built-in themes — dark, light, midnight, forest, ocean
- SVG and PNG output — crisp at any resolution; PNG via optional
sharp - Zero config — sensible defaults, works out of the box
- Flexible filters — by author, branch, date range
- Terminal summary — commit stats printed to stderr before the file is written
- Requires only Node 18+ — no external dependencies beyond npm
Usage Examples
Basic — generate poster from cwd:
npx git-posterChoose a theme:
npx git-poster --theme midnightFilter by date range:
npx git-poster --since 2024-01-01 --until 2024-12-31Export as PNG:
npm install sharp # one-time optional peer dep
npx git-poster --png -o poster.pngQuiet mode (no terminal output):
npx git-poster -q -o ~/Desktop/poster.svgStats only (no file written):
npx git-poster --stats-onlySpecific repo, branch, and author:
npx git-poster --repo ~/projects/myapp --branch develop --author "Kerim Gulen"CLI Reference
| Flag | Description | Default |
|---|---|---|
| --repo <path> | Repository path | cwd |
| -o, --output <file> | Output file path | git-poster.svg |
| --png | Export as PNG (requires sharp) | — |
| --theme <name> | Color theme | dark |
| --branch <name> | Specific branch | all branches |
| --since <date> | Start date (YYYY-MM-DD) | — |
| --until <date> | End date (YYYY-MM-DD) | — |
| --author <name> | Filter commits by author name | — |
| --width <px> | Poster width in pixels | 1200 |
| --height <px> | Poster height in pixels | 800 |
| -q, --quiet | Suppress terminal output | — |
| --stats-only | Print stats only, no file written | — |
| -V, --version | Print version | — |
| -h, --help | Show help | — |
Themes
| Name | Background | Heatmap | Style |
|---|---|---|---|
| dark (default) | Dark gray | Green | GitHub dark mode |
| light | Off-white | Green | GitHub light mode |
| midnight | Deep navy | Blue tones | Late-night coding |
| forest | Dark green | Natural greens | Organic, muted |
| ocean | Dark blue-teal | Teal/cyan | Deep sea |
npx git-poster --theme oceanHow It Works
CLI (commander)
└─ Core
├─ git (simple-git) — parse commit log
└─ analyzer — aggregate by day, compute heatmap buckets
└─ Output
├─ poster (SVG builder) — render contribution grid + metadata
├─ terminal (chalk) — print stats table to stderr
└─ export (sharp) — optional raster conversion to PNG- CLI parses flags and resolves the repository path.
- Core reads the Git log via
simple-git, groups commits by calendar day, and maps counts into heatmap intensity buckets. - Output builds an SVG string from scratch (no external renderer), optionally converts it to PNG with
sharp, and prints a summary table to the terminal.
Contributing
- Fork the repository.
- Create a feature branch:
git checkout -b feat/my-change - Make your changes and add tests under
tests/. - Open a pull request against
main.
All contributions are welcome — new themes, output formats, performance improvements, or bug fixes.
License
MIT — see LICENSE.
Made by Kerim Gulen
