[Author: @hasanmubin Date: 2025-06-19 Category: e.g., mini-projects/GitPulse Tags: [go, GitPulse, mini-projects] ]
GitPulse - A GitHub Activity Tracker CLI ๐งโ๐ป
A simple command-line tool that fetches and displays the recent public activity of any GitHub user using the GitHub Events API. Built with Go.
๐ Features
-
Accepts GitHub username as a command-line argument
-
Fetches recent activity from:
https://api.github.com/users/<username>/events -
Displays:
- Push events (e.g., number of commits pushed to a repo)
- Issues opened
- Repositories starred
- And moreโฆ
-
Gracefully handles errors such as:
- Invalid GitHub usernames
- Unexpected data formats
๐ฆ Prerequisites
- Go installed (version 1.18 or above recommended)
๐ ๏ธ Setup
-
Initialize a Go module:
go mod init GitPulse -
Build the application:
go build -o github-activityThis will create a binary file named
github-activity.
๐งโ๐ป Usage
./github-activity <github-username>
Example:
./github-activity kamranahmedse
Sample Output:
Pushed 3 commits to kamranahmedse/developer-roadmap
Opened a new issue in kamranahmedse/developer-roadmap
Starred kamranahmedse/developer-roadmap
๐ฏ๏ธ Error Handling
-
Invalid username or no recent activity? Youโll get:
Error: user not found or has no recent public activity. -
Internet down? API fails? Youโll get a meaningful error message instead of a crash.
๐ฑ Future Improvements (Optional Ideas)
- Filter by specific event type (
PushEvent,IssuesEvent, etc.) - Cache results locally to reduce API calls
- Display output in a more structured or colorized format
- Explore other endpoints like
/repos,/followers,/starred, etc.