A simple CLI tool written in Golang to fetch and display GitHub repository traffic stats, including views and clones, in a markdown format that can be rendered beautifully in the terminal using Glow.
- Fetch views and clones data dynamically from GitHub.
- Display data in Markdown tables.
- Use Glow to render markdown beautifully in the terminal.
Before using the tool, ensure you have the following setup:
-
GitHub API Token
- Generate a fine-grained personal access token from GitHub:
GitHub Token Guide - Export your token:
export GH_API_KEY=your_github_api_key
- Generate a fine-grained personal access token from GitHub:
-
Set Your GitHub Username
export GH_OWNER_UNAME=your_github_username
-
Install Glow (for markdown rendering)
https://github.com/charmbracelet/glow?tab=readme-ov-file#installation
You can install the CLI tool using go install
:
go install github.com/joybiswas007/gh-traffic@latest
Make sure $GOPATH/bin
is in your PATH
to run the installed binary globally.
To run the tool locally without installing it globally:
-
Clone the repository:
git clone https://github.com/joybiswas007/gh-traffic.git cd gh-traffic
-
Install dependencies:
go mod tidy
-
Build the application:
make install
-
Run it
gh-traffic
Run the CLI tool to fetch views and clones data:
./gh-traffic # Fetch and display Views AND Clones data
- Built with ❤️ using Golang.
- Markdown rendering powered by Glow.