Automatically generate SVG cards for your GitHub stats and embed them in any README.
This project runs entirely with GitHub Actions: no local installation required. Images are generated on a schedule you control and hosted on GitHub Pages, with public URLs.
This project generates SVG images showing your GitHub statistics and most used languages.
stats-top4.svg - Top 4 languagesgithub-stats.svg - Global GitHub stats# Clone the project
git clone https://github.com/FabioDevCode/github-stats.git
cd github-stats
# Remove existing SVG files (they will be regenerated with your stats)
rm -f *.svg
After cloning, make sure the following structure is present:
github-stats/
├── .github/
│ └── workflows/
│ └── update-stats.yml
├── config.json
├── generate-stats.js
├── github_colors.json
├── README.md
└── README.fr.md
In config.json, update values to match your needs:
{
"USERNAME": "your-username",
"TITLE": "Top Languages",
"STATS_TITLE": "GitHub Stats",
"BG_COLOR": "#202830",
"BORDER_COLOR": "#202830",
"TITLE_COLOR": "#D1D7E0",
"TEXT_COLOR": "#D1D7E0",
"PERCENT_COLOR": "#9298A1",
"ICON_COLOR": "#6e7681",
"VALUE_COLOR": "#41B883",
"VARIANTS": [2, 4, 6],
"IGNORE_LANGUAGES": ["HTML", "CSS", "Handlebars", "SCSS"]
}
📝 Note: See the Available options section for full parameter details.
GitHub Statsrepo (all sub-items)read:userGH_TOKENmain / / (root)Two options:
Option A - Automatic:
git add .
git commit -m "Initial setup"
git push
Option B - Manual:
After deployment, your images are available at:
https://your-username.github.io/github-stats/stats-top2.svg
https://your-username.github.io/github-stats/stats-top4.svg
https://your-username.github.io/github-stats/stats-top6.svg
https://your-username.github.io/github-stats/github-stats.svg
Note:
stats-topN.svgfiles depend on theVARIANTSsetting inconfig.json.github-stats.svgcontains your global stats (stars, commits, PRs, issues, contributions).


<img
src="https://your-username.github.io/github-stats/stats-top4.svg"
alt="Top Languages"
/>
<img
src="https://your-username.github.io/github-stats/github-stats.svg"
alt="GitHub Stats"
/>
All settings are configured in config.json:
{
"USERNAME": "your-username",
"TITLE": "Top Languages",
"STATS_TITLE": "GitHub Stats",
"BG_COLOR": "#202830",
"BORDER_COLOR": "#202830",
"TITLE_COLOR": "#D1D7E0",
"TEXT_COLOR": "#D1D7E0",
"PERCENT_COLOR": "#9298A1",
"ICON_COLOR": "#6e7681",
"VALUE_COLOR": "#41B883",
"VARIANTS": [2, 4, 6],
"IGNORE_LANGUAGES": ["HTML", "CSS", "Handlebars", "SCSS"]
}
| Option | Description | Exemple |
|---|---|---|
USERNAME |
Your GitHub username | "FabioDevCode" |
TITLE |
Title shown on languages SVG | "Top Languages" |
STATS_TITLE |
Title shown on global stats SVG | "GitHub Stats" |
BG_COLOR |
Background color | "#202830" |
BORDER_COLOR |
Border color | "#202830" |
TITLE_COLOR |
Title color | "#D1D7E0" |
TEXT_COLOR |
Text color | "#D1D7E0" |
PERCENT_COLOR |
Percentage color (languages) | "#9298A1" |
ICON_COLOR |
Icon color (global stats) | "#6e7681" |
VALUE_COLOR |
Value color (global stats) | "#41B883" |
VARIANTS |
Variants to generate (top N) | [2, 4, 6, 8] |
IGNORE_LANGUAGES |
Languages excluded from stats | ["HTML", "CSS"] |
In .github/workflows/update-stats.yml, set the cron value to match your preferred schedule:
schedule:
- cron: "0 0 * * *" # Every day at midnight
- cron: "0 */6 * * *" # Every 6 hours
- cron: "0 0 * * 1" # Every Monday
💡 The default schedule is defined in this file. Keep only one active
- cron:line.
Language colors are defined in github_colors.json. This file contains official GitHub language colors and can be customized if needed.
GH_TOKEN secret is correctly configuredUSERNAME in config.json is correcthttps://your-username.github.io/repo-name/stats-top4.svgThis project is distributed under the MIT license. You are free to use, modify, and redistribute it.
Note: Forked repositories are excluded from stats calculation. Update frequency is configurable in Change update frequency.