README Generator

How to Add GitHub Metrics to Your Profile README

GitHub Metrics generates a comprehensive developer card as a single SVG image covering dozens of data points — contribution calendar, language breakdown, starred topics, coding habits by time of day, recent activity, and much more. It is the most powerful and configurable GitHub README widget available, consolidating what would otherwise require five separate widgets into one cohesive image. This guide covers the lowlighter/metrics project and its GitHub Actions setup, which requires a GitHub personal access token but produces unmatched output depth.

Quick Setup Steps

  1. 1

    Step 1: Create a GitHub personal access token with read:user and repo scopes at github.com/settings/tokens.

  2. 2

    Step 2: Add the token as a METRICS_TOKEN repository secret in your profile repository settings.

  3. 3

    Step 3: Create .github/workflows/metrics.yml using lowlighter/metrics@latest with your chosen plugins.

  4. 4

    Step 4: Add permissions: contents: write to the workflow YAML.

  5. 5

    Step 5: Run the workflow manually, then add ![Metrics](metrics.svg) to your README.md after the first SVG is generated.

What Is GitHub Metrics?

The lowlighter/metrics project is an open-source SVG generator that produces rich developer cards by combining multiple data sources. Unlike simpler stats cards, Metrics supports over 30 plugins including: contribution calendar with color-coded activity, language breakdown with time estimates, starred repository topics word cloud, coding habits (commit times by hour and day), recently starred repositories, followers and following activity, achievements unlocked, WAKATIME integration, and more.

Each plugin can be enabled or disabled independently, letting you build a card that shows exactly the information you want. The result is a single SVG file committed to your repository daily, embedded in your README as a standard image.

How to Set Up GitHub Metrics

The recommended setup uses GitHub Actions:

  1. Create a GitHub personal access token at github.com/settings/tokens with scopes: read:user, repo, read:org.
  2. Add it as a repository secret named METRICS_TOKEN.
  3. Create .github/workflows/metrics.yml:
name: Metrics
on:
  schedule:
    - cron: '0 0 * * *'
  workflow_dispatch:
permissions:
  contents: write
jobs:
  github-metrics:
    runs-on: ubuntu-latest
    steps:
      - uses: lowlighter/metrics@latest
        with:
          token: ${{ secrets.METRICS_TOKEN }}
          output_action: commit
          filename: metrics.svg
          plugin_languages: yes
          plugin_languages_analysis_timeout: 15
          plugin_habits: yes
          plugin_habits_from: 200
          plugin_habits_days: 14
  1. After the first run, add to your README:
![Metrics](metrics.svg)

Configuring Metrics Plugins

Each plugin has a plugin_[name]: yes entry plus optional configuration sub-options. Commonly used plugins:

  • plugin_languages: yes — language breakdown with byte counts and time estimates
  • plugin_habits: yes — coding habits chart (times of day, days of week)
  • plugin_achievements: yes — GitHub achievement badges
  • plugin_calendar: yes — full-year contribution calendar
  • plugin_topics: yes — starred topics word cloud
  • plugin_notable: yes — notable contributions to other repositories
  • plugin_wakatime: yes — WakaTime integration (requires plugin_wakatime_token secret)

The official documentation at github.com/lowlighter/metrics/blob/master/README.md lists all plugins with their full parameter reference. A live preview tool is available at metrics.lecoq.io where you can interactively configure your metrics image before committing the workflow.

Troubleshooting GitHub Metrics

If the workflow fails with a 401 or 403 error, verify that your METRICS_TOKEN has the correct scopes: read:user is required for basic profile data. Add repo scope if you want metrics from private repositories.

If the workflow runs but the SVG is not committed, ensure the workflow has permissions: contents: write and that your token has push access to the repository. If using the GITHUB_TOKEN (Actions default token) instead of a personal access token, it may not have sufficient permissions — the personal access token approach is more reliable.

For very large accounts with many repositories, the plugin_languages_analysis_timeout may need to be increased. The default language analysis can time out on accounts with thousands of repositories.

Frequently Asked Questions

How do I add GitHub Metrics to my README?

Create a GitHub personal access token with read:user and repo scopes, add it as the METRICS_TOKEN repository secret, create a GitHub Actions workflow using lowlighter/metrics@latest, run it manually for the first SVG generation, then add ![Metrics](metrics.svg) to your README. The image updates daily via the cron schedule.

Is GitHub Metrics free to use?

Yes. The lowlighter/metrics project is open source under MIT license. It uses GitHub Actions compute (free for public repos) and reads from GitHub's public API with your personal access token. There is no external service cost and no subscription required.

Why is my GitHub Metrics SVG not generating?

Check that METRICS_TOKEN is set as a repository secret (not a personal token at the account level). Verify the token has read:user scope. Check the Actions tab for specific error messages in the job log. The most common failures are missing token scopes and insufficient workflow permissions.

How many plugins can I add to GitHub Metrics?

You can enable as many plugins as you want, but more plugins means longer generation time and a larger SVG file. For profile READMEs, 3-5 plugins produce the best balance between information density and load time. The metrics.lecoq.io preview tool helps you choose the right combination before committing.

From Our Blog

Generate Your GitHub Profile README

Generate a GitHub profile README featuring GitHub Metrics with AI

Try It Free — No Sign Up