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.
Built for the roadmap.sh project:
- 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
- Java 21
- Maven
- Picocli
- Jackson
- Java HttpClient
- GitHub REST API
src
└── main
└── java
└── org.example
├── Main.java
├── APICall.java
├── Parser.java
├── SearchResponse.java
└── Repository.java
Clone the repository:
git clone https://github.com/utkarshu281/github-trending-cli.gitMove into the project:
cd github-trending-cliRun the application:
mvn exec:java -Dexec.args="--duration month --limit 10"| Option | Description | Default |
|---|---|---|
--duration |
day, week, month, year | week |
--limit |
Number of repositories | 10 |
Example:
mvn exec:java -Dexec.args="--duration year --limit 20"----------------------------------------------
#1 grok-build
Description : SpaceXAI's coding agent harness and TUI.
Language : Rust
Stars : 22,491
----------------------------------------------
#2 ...
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
- 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
This project is licensed under the MIT License.