This project retrieves contribution statistics from GitHub from the last 365 days for a given user and displays them in JSON format.
- Clone the project from the following URL:
git clone https://github.com/AaronBernabeu/gh-contributions.git- Navigate to the project directory:
cd gh-contributions- Install dependencies using
go mod tidy:
go mod tidy- Create a
.envfile based on the provided.env.dist. You can also set the required environment variables directly without creating a.envfile. The required variables are:
GH_TOKEN: Your GitHub token.GH_USERNAME: The username whose contributions you want to retrieve.
Run the program to display contribution statistics in JSON format:
go run cmd/gh-cli/main.go contributionsThe output will be in the following format:
{
"name": "Aaron Bernabeu",
"today": 2,
"week": 14,
"month": 63,
"year": 1324
}