GitHub Personal Stats GitHub

Getting started

Install it as an action, a command, or a service, and see a card.

Setup Overview

  1. Add a workflow to your profile repository.
  2. Generate one or more SVG files into a tracked directory such as profile/.
  3. Commit those SVG files from the workflow.
  4. Reference the generated SVG from your profile README.

GitHub Action

Create .github/workflows/github-personal-stats.yml:

name: GitHub Personal Stats

on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * *"

jobs:
  generate:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v5
      - name: Check personal stats token
        env:
          PERSONAL_STATS_TOKEN: ${{ secrets.PERSONAL_STATS_TOKEN }}
        run: test -n "$PERSONAL_STATS_TOKEN"
      - uses: liuchong/github-personal-stats@v1.5.1
        with:
          card: dashboard
          path: profile/github-personal-stats.svg
          options: --user your-github-login --width 1000 --height 420 --authored-languages --author-email old@example.com,work@example.com --hide-language Ruby --min-repo-language-share 2
          token: ${{ secrets.PERSONAL_STATS_TOKEN }}
      - uses: stefanzweifel/git-auto-commit-action@v5
        with:
          commit_message: "chore: update profile stats"

Command Line

github-personal-stats help lists every command and option with its default. --help and -h work in the same place, including after a command, so generate --help prints the same page without rendering anything. The Action takes these same options through its options input.

Local Preview

The repository includes deterministic showcase data so you can preview changes without network access:

cargo run -p github-personal-stats -- generate \
  --fixture examples/showcase.json \
  --user showcase \
  --card dashboard \
  --output examples/dashboard.svg

Preview individual cards:

cargo run -p github-personal-stats -- generate --fixture examples/showcase.json --user showcase --card stats --width 520 --height 260 --output examples/stats.svg
cargo run -p github-personal-stats -- generate --fixture examples/showcase.json --user showcase --card languages --width 520 --height 260 --output examples/languages.svg
cargo run -p github-personal-stats -- generate --fixture examples/showcase.json --user showcase --card streak --width 1000 --height 220 --output examples/streak.svg

examples/showcase.json covers 30 days with a few quiet ones, which is what a fixed window needs to show. examples/streak-117.json carries a 117 day streak, which is where the ring changes geometry:

cargo run -p github-personal-stats -- generate --fixture examples/streak-117.json --card streak --width 1000 --height 220 --output /tmp/long-streak.svg