Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub User Activity CLI

A simple command-line interface (CLI) tool written in Go to fetch and display recent activity of a GitHub user. This project is built as a learning project following the specification from roadmap.sh GitHub User Activity Project.


📌 Features

  • Activity Fetching: Fetches public activity events for any specified GitHub user using the GitHub API (https://api.github.com/users/<username>/events).
  • Formatted Event Display: Formats event types (commits pushed, issues opened, repositories starred, etc.) into clean, human-readable terminal output.
  • Error Handling: Gracefully handles errors such as non-existent users (404), network connectivity failures, and API rate limits.
  • Zero External Dependencies: Built entirely using Go's standard library (net/http, encoding/json, os, fmt).

🚀 Getting Started

Prerequisites

  • Go (version 1.20 or higher recommended)

Build & Installation

  1. Clone or navigate to the project directory:

    cd github-user-activity
  2. Build the CLI executable:

    go build -o github-activity main.go

💻 Usage

Once built, you can execute commands using ./github-activity (or run directly using go run main.go <username>):

Fetch User Activity

github-activity <username>

Example Usage

github-activity kamranahmedse

Output:

Output:
- Pushed 3 commits to kamranahmedse/developer-roadmap
- Opened a new issue in kamranahmedse/developer-roadmap
- Starred kamranahmedse/developer-roadmap

⚡ Supported Event Types

The CLI formats and displays terminal output for common GitHub activity events:

  • PushEvent: Pushed commits to a repository.
  • IssuesEvent: Opened, closed, or updated an issue.
  • WatchEvent: Starred a repository.
  • CreateEvent: Created a repository, branch, or tag.
  • PullRequestEvent: Opened, closed, or merged a pull request.
  • ForkEvent: Forked a repository.
  • IssueCommentEvent: Commented on an issue or pull request.

🔗 Reference

About

A lightweight, zero-dependency command-line GitHub User Activity CLI written in Go.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages