Archive your weekly WakaTime coding stats and generate beautiful SVG cards for GitHub README.
| Light Mode | Dark Mode |
|---|---|
Get your stats cards in 3 steps:
Click the Fork button at the top right of this page.
- Go to WakaTime Settings and copy your API key.
- In your forked repo, go to Settings > Secrets and variables > Actions.
- Click New repository secret:
- Name:
WAKATIME_API_KEY - Secret: your API key
- Name:
- Go to the Actions tab in your repo.
- Click I understand my workflows, go ahead and enable them.
- Run the workflow manually or wait for the daily auto-run (UTC 01:18 / Beijing 09:18).
Done! Your SVG cards will be generated in assets/ and updated daily.
| Card | Description | Light | Dark |
|---|---|---|---|
| Language Stats | Weekly coding time per language | wakatime-language.svg |
wakatime-language-dark.svg |
| AI Stats | AI tokens, cost, prompts & line changes | wakatime-ai.svg |
wakatime-ai-dark.svg |
All data is archived weekly as JSON in data/YYYY/MM/YYYY-WW.json, so you never lose historical stats—even after your free WakaTime account's retention period expires.
- 📊 Weekly archival — structured JSON with normalized fields
- 🎨 4 SVG variants — 2 card types × 2 themes (light & dark)
- 🔄 Auto updates — daily via GitHub Actions
- 📱 Local preview — HTML preview for quick inspection
- 🧪 Fully tested — reliable and maintainable
Copy and paste into your README.md:
Light theme:

Dark theme:

Responsive (auto switch):
<picture>
<source
media="(prefers-color-scheme: dark)"
srcset="
https://raw.githubusercontent.com/JS-banana/dev-stats/main/assets/wakatime-language-dark.svg
"
/>
<source
media="(prefers-color-scheme: light)"
srcset="https://raw.githubusercontent.com/JS-banana/dev-stats/main/assets/wakatime-language.svg"
/>
<img
alt="Weekly coding stats"
src="https://raw.githubusercontent.com/JS-banana/dev-stats/main/assets/wakatime-language.svg"
/>
</picture>┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ WakaTime │────▶│ Dev Stats │────▶│ Your Repo │
│ API │ │ (GitHub │ │ - assets/ │
│ │ │ Actions) │ │ - data/ │
└─────────────┘ └──────────────┘ └─────────────┘
Weekly Fetch & SVG cards
stats Generate + JSON archive
- Fetch — pulls weekly stats from WakaTime API
- Normalize — extracts and cleans relevant fields
- Archive — saves as
data/YYYY/MM/YYYY-WW.json - Generate — renders 4 SVG card variants
- Commit — pushes updates to your repo
⚙️ Advanced Setup (Local Development)
- Node.js >= 22
- WakaTime account with API key
git clone https://github.com/JS-banana/dev-stats.git
cd dev-stats
npm install
cp .env.example .envAdd your API key to .env:
WAKATIME_API_KEY=your_key_here
npm test # Run tests
npm run lint # Lint code
npm run format:check # Check formatting
npm run build # Build TypeScript
npm run update # Fetch WakaTime data and generate artifacts
npm run preview # Generate preview with test fixtures (no API key needed)| Variable | Description | Required |
|---|---|---|
WAKATIME_API_KEY |
Your WakaTime API key | Yes |