Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Trending CLI

A command-line application that fetches and displays the most popular GitHub repositories created within a specified time period.

This project was built to practice working with REST APIs, HTTP requests, JSON parsing, command-line applications, and Maven using modern Java.

Project Reference

Built for the roadmap.sh project:

GitHub Trending CLI


Features

  • View trending GitHub repositories
  • Filter by duration:
    • Day
    • Week
    • Month
    • Year
  • Limit the number of displayed repositories
  • Clean command-line output
  • Parses JSON using Jackson
  • Command-line argument parsing with Picocli

Tech Stack

  • Java 21
  • Maven
  • Picocli
  • Jackson
  • Java HttpClient
  • GitHub REST API

Project Structure

src
└── main
    └── java
        └── org.example
            ├── Main.java
            ├── APICall.java
            ├── Parser.java
            ├── SearchResponse.java
            └── Repository.java

Usage

Clone the repository:

git clone https://github.com/utkarshu281/github-trending-cli.git

Move into the project:

cd github-trending-cli

Run the application:

mvn exec:java -Dexec.args="--duration month --limit 10"

Command-Line Options

Option Description Default
--duration day, week, month, year week
--limit Number of repositories 10

Example:

mvn exec:java -Dexec.args="--duration year --limit 20"

Example Output

----------------------------------------------
#1 grok-build

Description : SpaceXAI's coding agent harness and TUI.
Language    : Rust
Stars       : 22,491
----------------------------------------------

#2 ...

What I Learned

This project helped me practice:

  • Building command-line applications
  • Using Java HttpClient
  • Working with REST APIs
  • Constructing URLs and query parameters
  • URL encoding
  • Parsing JSON with Jackson
  • Java Records
  • Enums
  • Maven project structure
  • Separation of concerns

Future Improvements

  • Better exception handling
  • Colored terminal output
  • Pagination support
  • Export results to JSON or CSV
  • Unit tests
  • Logging
  • GitHub Personal Access Token support for higher API rate limits

License

This project is licensed under the MIT License.

About

A Java CLI application that fetches and displays trending GitHub repositories using the GitHub REST API. Built with Java HttpClient, Picocli, Jackson, and Maven, featuring customizable time ranges and result limits.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages