GitStats CLI is a lightweight C++ tool that uses the GitHub GraphQL API to show user language distribution, user info, and repository info directly from the command line.
Using yay:
yay -S gitstatsDownload the .deb package from the latest release and install it using apt (this automatically resolves required dependencies like libcurl):
wget https://github.com/andregarcia0412/gitstats-cli/releases/download/v1.0.1/gitstats_1.0.1_amd64.deb
sudo apt install ./gitstats_1.0.1_amd64.deb- C++17
- libcurl (HTTP)
- nlohmann/json (header-only)
- Makefile build
Prerequisites
- C++17 compiler (g++)
- make
- libcurl development headers
Build and run
make
./bin/gitstats helpOptional install
make install
# After install
gitstats helpThe Makefile builds to bin/gitstats (or bin/gitstats.exe on Windows) and provides install/uninstall targets.
Linux/macOS
make
make install- Output:
bin/gitstats - Install dir:
~/.local/bin
Windows (MSYS2/MinGW or similar)
make
make install- Output:
bin/gitstats.exe - Install dir:
%USERPROFILE%/AppData/Local/Programs/gitstats
Clean build artifacts
make cleanUninstall
make uninstallgitstats <command> [options]
Commands
help Show this help message
config <option> Manage local config
user <option> <user> GitHub user operations
repository <option> <owner> <repo> GitHub repository operations
languages <user> Alias for: gitstats user --languages <user>
User options
--languages, --langs <user> Show top languages for a GitHub user
--info <user> Show GitHub user info
Config options
--set-token <token> Set GitHub token in config file
--remove-token Remove token from config file
--list List config values
Repository options
--info <owner> <repo> Show GitHub repository info
Examples
gitstats help
gitstats config --set-token ghp_xxxxx
gitstats config --list
gitstats config --remove-token
gitstats user --languages torvalds
gitstats user --info torvalds
gitstats repository --info torvalds linux
gitstats languages torvaldsNotes
- A GitHub token is required for GraphQL API calls.
- Config file location:
./.config/config.json. - Forked repositories are ignored.
- "Jupyter Notebook" language is excluded.
All documentation is available via the CLI help:
gitstats helpThe help output includes the full command list, options, and examples.