DEV Community

Neegueba10
Neegueba10

Posted on Edited on

๐Ÿ† GitHub Has Secret Trophies. Here's How to See How Close You Are to the Next One

Did you know your GitHub profile has trophies? ๐Ÿ†

Just like a video game, GitHub quietly hands out badges when you do certain things: merging pull requests, helping people, getting stars on your projects. Many of them even level up, from plain to ๐Ÿฅ‰ bronze, ๐Ÿฅˆ silver and finally ๐Ÿฅ‡ gold.

But there's a catch...

GitHub shows the trophies you already have, but never tells you how close you are to the next level.

It's like playing a game with no XP bar. ๐Ÿ˜ฉ So I built one!


๐ŸŽฎ First, what are GitHub achievements?

Open any GitHub profile and look on the left side, under the profile picture. Those little round badges are achievements.

Here are the most popular ones, explained simply:

Badge What it means ๐Ÿ”น Base ๐Ÿฅ‰ Bronze ๐Ÿฅˆ Silver ๐Ÿฅ‡ Gold
๐Ÿฆˆ Pull Shark Your pull requests (code changes) got merged 2 16 128 1024
๐Ÿง  Galaxy Brain Your answer in a Discussion was marked as "the answer" 2 8 16 32
โญ Starstruck People starred one of your projects 16 128 512 4096
๐Ÿ‘ฏ Pair Extraordinaire You coded together with someone (co-authored commits) 1 10 24 48
๐Ÿค  Quickdraw You closed an issue or pull request within 5 minutes 1 โ€“ โ€“ โ€“
๐ŸŽฒ YOLO You merged a pull request without a review 1 โ€“ โ€“ โ€“
๐Ÿ’– Public Sponsor You sponsored someone on GitHub Sponsors 1 โ€“ โ€“ โ€“

The numbers are how many you need for each level. For example, 128 merged pull requests = ๐Ÿฅˆ silver Pull Shark.


๐Ÿ˜ฉ The problem

Say you have the ๐Ÿฅ‰ bronze Pull Shark. Great! But...

  • How many merged PRs do you have right now? ๐Ÿคท
  • How many more until silver? ๐Ÿคท
  • Did you already reach it, with GitHub just being slow to show it? ๐Ÿคท

GitHub doesn't tell you. So I made a tool that does.


โœจ Meet gh-achievements

One command, and you get your full progress report:

  GitHub achievements for @you

  Pull Shark            x2 bronze  ######---------- 47/128 merged PRs
  Galaxy Brain          base       ####------------ 3/8 accepted answers
  Starstruck            -          ##-------------- 2/16 stars (you/your-repo)
  Public Sponsor        -          ---------------- 0/1 sponsorships
  Quickdraw             base       done
  YOLO                  base       done
Enter fullscreen mode Exit fullscreen mode

What you get:

  • ๐Ÿ… Your current level for every badge
  • ๐Ÿ“Š A progress bar to the next level, using live numbers from GitHub
  • โณ "Pending" alerts: GitHub can take 1โ€“3 days to show a new badge, and the tool tells you when you've already earned one that hasn't appeared yet
  • ๐Ÿ‘€ Anyone's progress: check your friends, your team, or your favorite developer

๐Ÿš€ How to install it (2 minutes)

Step 1: Install the GitHub CLI, GitHub's official command-line tool. ๐Ÿ‘‰ cli.github.com

Step 2: Log in, once:

gh auth login
Enter fullscreen mode Exit fullscreen mode

Step 3: Install the extension:

gh extension install Neegueba10/gh-achievements
Enter fullscreen mode Exit fullscreen mode

Step 4: Run it! ๐ŸŽ‰

gh achievements
Enter fullscreen mode Exit fullscreen mode

That's it!


๐ŸŽฏ More things you can do

gh achievements octocat     # see anyone's progress (try your friends!)
gh achievements --json      # get the data for your own scripts
gh achievements --no-color  # plain text, no colors
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”ง How does it work? (for the curious)

GitHub has no official API for achievements, so the tool combines two sources:

  1. ๐ŸŒ Your public achievements page tells it which badges and levels you already have.
  2. ๐Ÿ“ก The GitHub API gives it your live numbers: merged PRs, accepted answers, stars and sponsorships.

Compare the two, and you get your progress! ๐Ÿงฎ

It's a single small script. It works on Mac, Linux and Windows (with Git Bash), and it's free and open source under the MIT license.


๐Ÿ’ก Quick tips to earn badges the real way

  • ๐Ÿฆˆ Pull Shark: contribute to open source! Look for issues labeled good first issue.
  • ๐Ÿง  Galaxy Brain: answer questions in the Discussions tab of projects you use.
  • โญ Starstruck: build something useful and share it with the world.
  • ๐Ÿ‘ฏ Pair Extraordinaire: code with a friend and add them as a co-author on your commits.

๐Ÿ™Œ Try it and tell me what you think!

๐Ÿ‘‰ github.com/Neegueba10/gh-achievements

  • ๐Ÿ’ฌ Ideas or bugs? Open an issue, I'd love to hear them.
  • ๐Ÿ› ๏ธ Want to help? Pull requests are very welcome.
  • โญ Found it useful? A star on the repo helps other people find it, and maybe helps me level up my own Starstruck badge. ๐Ÿ˜„

What's your favorite GitHub achievement? Tell me in the comments! ๐Ÿ‘‡

Top comments (0)