An open API service indexing awesome lists of open source software.

https://github.com/vishalyadav0987/github-user-activity-cli

https://roadmap.sh/projects/github-user-activity/solutions?u=69e11c4635198b31d63d8f6d
https://github.com/vishalyadav0987/github-user-activity-cli

cli-tool ddd-architecture github github-api golang

Last synced: 14 days ago
JSON representation

https://roadmap.sh/projects/github-user-activity/solutions?u=69e11c4635198b31d63d8f6d

Awesome Lists containing this project

README

          

# ๐Ÿ™ GitHub Activity CLI (Golang)

๐Ÿ”— **Project URL:**
https://roadmap.sh/projects/github-user-activity

---

A lightweight and efficient **Command Line Interface (CLI)** application built in **Go (Golang)** to fetch and display a GitHub user's recent activity directly in the terminal.

---

## ๐Ÿš€ Features

* ๐Ÿ‘ค Fetch GitHub user activity using username
* ๐Ÿ“ก Uses GitHub public API (no authentication required)
* ๐Ÿงพ Clean and readable terminal output
* ๐Ÿ”„ Supports multiple event types (Push, Issues, Stars, etc.)
* โšก Fast and lightweight CLI tool
* โŒ Graceful error handling (invalid user, API failure, etc.)
* ๐Ÿง  Clean Architecture (Domain + Application + Infrastructure)

---

## ๐Ÿ“ Project Structure

```
github-user-activity
โ”œโ”€ README.md
โ”œโ”€ cmd
โ”‚ โ””โ”€ github-user-activity
โ”‚ โ””โ”€ main.go
โ”œโ”€ go.mod
โ”œโ”€ interfaces
โ”‚ โ””โ”€ cli
โ”‚ โ”œโ”€ handler.go
โ”‚ โ”œโ”€ output.go
โ”‚ โ””โ”€ parser.go
โ””โ”€ internal
โ”œโ”€ application
โ”‚ โ””โ”€ github-activity
โ”‚ โ””โ”€ service.go
โ”œโ”€ config
โ”œโ”€ domain
โ”‚ โ””โ”€ github-activity
โ”‚ โ”œโ”€ entity.go
โ”‚ โ””โ”€ errors.go
โ””โ”€ infrastructure
โ”œโ”€ client
โ”‚ โ””โ”€ github_client.go
โ””โ”€ github-activity
โ””โ”€ service_implementation.go

```

---

## โš™๏ธ Installation

### 1. Clone repo

```bash
git clone https://github.com/vishalyadav0987/github-activity-cli.git
cd github-activity-cli
```

---

### 2. Build binary

```bash
go build -o github-activity cmd/github-activity/main.go
```

---

### 3. Make it global (Mac/Linux)

```bash
sudo mv github-activity /usr/local/bin/
```

---

## ๐Ÿงช Usage

### โ–ถ๏ธ Fetch GitHub Activity

```bash
github-activity
```

---

### ๐Ÿ“Œ Example

```bash
github-activity vishalyadav0987
```

---

## ๐Ÿ–ฅ๏ธ Example Output

```
- Pushed commits to vishalyadav0987/github-user-activity-cli
- Did CreateEvent on vishalyadav0987/github-user-activity-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/task-tracker-cli
- Did CreateEvent on vishalyadav0987/task-tracker-cli
- Pushed commits to vishalyadav0987/vishalyadav0987
- Pushed commits to vishalyadav0987/vishalyadav0987
- Pushed commits to vishalyadav0987/go-auth-ddd
- Pushed commits to vishalyadav0987/go-auth-ddd
- Did CreateEvent on vishalyadav0987/go-auth-ddd
```

---

## โš ๏ธ Error Handling

* โŒ Invalid username โ†’ "user not found"
* โŒ API failure โ†’ "failed to fetch data"
* โŒ No activity โ†’ "no recent activity found"
* โŒ Rate limit exceeded โ†’ "github api rate limit exceeded"

---

## ๐Ÿง  Tech Stack

* Go (Golang)
* GitHub REST API
* Clean Architecture (DDD inspired)
* CLI Interface
* Net/http package (no external libraries)

---

## ๐Ÿ—๏ธ Architecture Highlights

* ๐Ÿ”น Domain-driven structure
* ๐Ÿ”น Dependency Injection (manual)
* ๐Ÿ”น Interface-based design
* ๐Ÿ”น Separation of concerns (CLI / Service / Infra)

---

## ๐Ÿ”ฅ Future Improvements

* ๐ŸŽฏ Add caching for repeated users
* โฑ๏ธ Add rate limit handling & retry logic
* ๐ŸŽจ Colored and formatted CLI output
* ๐Ÿ“Š Group events by type (Push / Star / Issue)
* ๐Ÿ” GitHub token support for higher API limits
* ๐Ÿงช Unit tests with mocked GitHub client

---

## ๐Ÿ‘จโ€๐Ÿ’ป Author

**Vishal Yadav**

---

## โญ If you like this project

Give it a โญ on GitHub! ๐Ÿš€