$ gitstats
📊 Generate insightful visual reports from Git.
📘 Documentation: gitstats.readthedocs.io 📊 GitStats Gallery: shenxianpeng.dev/gitstats/gallery/
Example
gitstats . generates this gitstats report:
Check out the GitStats Gallery for live reports on the world’s largest open-source projects — auto-generated weekly.
Installation
pip install gitstats
Or, using uv (recommended):
uv pip install gitstats # install into current environment
uvx gitstats . # run instantly, no install required
gitstats is compatible with Python 3.10 and newer.
Usage
gitstats <gitpath> [<outputpath>]
If <outputpath> is omitted, reports are written to gitstats-report/ by default.
Analyze several repositories at once to get a portfolio overview — useful for seeing how all of a team’s projects are doing in one place:
gitstats repo1 repo2 repo3 <outputpath>
Each repository gets its full report in <outputpath>/<repo>/ along with a machine-readable summary.json, and an aggregate page at <outputpath>/index.html shows a sortable table of every repository — commits, authors, recent activity, lines of code and a health label — linking into the individual reports. Repositories that fail to analyze are listed on the page without stopping the run.
Add --serve to preview the generated report right away — gitstats starts a local web server and prints the URL (bound to 127.0.0.1 by default; pass --host 0.0.0.0 to expose it on your network, --port to pick a port):
gitstats --serve .
Use --verbose to show debug-level command logs, or --quiet to show only warnings and errors:
gitstats --verbose .
gitstats --quiet .
Run gitstats --help for more options, or check the documentation.
GitHub Action
Automate your gitstats report generation with the official GitStats Action.
- uses: shenxianpeng/gitstats-action@v1
with:
deploy-to-pages: true
With just one uses line, the Action generates a full gitstats report and deploys it to GitHub Pages automatically.
See the gitstats-action repository for detailed inputs, examples, and advanced usage (AI-powered reports, custom config, manual deploy, etc.).
What’s New in v2.0.0
v2.0.0 is a major release focused on modernizing the report UI and removing the Gnuplot dependency.
- Terminal-inspired UI redesign
The entire report interface has been redesigned with a terminal / OpenCode-inspired aesthetic: zero border-radius (sharp, angular corners), monospace fonts in headings and navigation, border-heavy layout, and a GitHub-style green heatmap. Both light and dark modes are supported with a one-click toggle — no flash of unstyled content when switching pages.
- Chart.js replaces Gnuplot
All charts are now rendered interactively in the browser using Chart.js. Gnuplot is no longer required. Reports are fully self-contained HTML files.
Features
Here is a list of some features of gitstats:
General: headline numbers (commits, authors, lines, files, active days, longest streak), commits per year, top contributors, latest releases.
Activity: commits by year, month and week; a punch card of day of week by hour of day; month of year; timezones.
Authors: every author’s commits, lines and active span; a contributor timeline; cumulative lines added per author; the top author per year and month; commits by email domain; contributor growth.
Files: file count over time, extensions ranked by lines, and the most-changed files.
Lines: lines of code over time, and lines added and removed per month.
Tags: every tag with its commits and authors.
Code Ownership: bus-factor risk (files only one person has changed), ownership by author, and the files shared by the most people.
History: the project’s life one year at a time — its peaks, quiet years and revivals, newcomers and releases — with optional AI narration.
Portfolio: analyze several repositories at once for an aggregate overview.
Readable anywhere: interactive charts, light and dark themes, and layouts that work on phones; long quiet periods are shaded on every timeline.
Customizable: config values through gitstats.conf.
Cross-platform: works on Linux, Windows, and macOS.
AI-Powered Features 🤖
GitStats supports AI-powered insights to enhance your repository analysis with natural language summaries and actionable recommendations.
Quick Start:
# Install with AI support
pip install gitstats[ai]
# Enable AI with OpenAI
export OPENAI_API_KEY=your-api-key
gitstats --ai --ai-provider openai <gitpath> [<outputpath>]
For detailed setup instructions, configuration options, and examples, see the AI Integration Documentation.
Contributing
As an open source project, gitstats welcomes contributions of all forms.
Thanks to all contributors:
The gitstats project was originally created by Heikki Hokkainen and is currently maintained by Xianpeng Shen.
Release files for gitstats 2.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gitstats-2.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / gitstats-2.7.0-py3-none-any.whl
| Download URL | gitstats-2.7.0-py3-none-any.whl |
|---|---|
| Size | 160.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f68d597e739ccf80d62dff04ecdafcfc5d480f21a4f59aca0ad40fb5bab70959
|
|
BLAKE2b-256 checksum How to use checksums |
9d61a00401ed8040fe598bc3ca8ee794289d9b94bad8e2e43d4e07e3c43bd298
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|