These scripts work identically to the main scripts but use a GitHub personal access token instead of the GitHub CLI (gh). This makes them compatible with WSL, Git Bash, and any environment with curl and jq.
-
Create a GitHub Personal Access Token:
- Go to https://github.com/settings/tokens
- Click "Generate new token" → "Generate new token (classic)"
- Give it a name (e.g., "GitHub Stats")
- Select scopes:
- For public repos:
public_repo - For private repos:
repo(full repo access)
- For public repos:
- Click "Generate token" and copy it
-
Set the token as an environment variable:
# For single use (works in WSL, Git Bash, Linux, macOS) export GITHUB_TOKEN=ghp_your_token_here # Or pass it inline with the command GITHUB_TOKEN=ghp_your_token_here ./github_stats_token.sh owner/repo
# Basic usage
GITHUB_TOKEN=ghp_xxxx ./github_stats_token.sh coforma/github-contribution-stats
# With custom date
GITHUB_TOKEN=ghp_xxxx ./github_stats_token.sh coforma/github-contribution-stats 2024-01-01
# With user filtering
GITHUB_TOKEN=ghp_xxxx ./github_stats_token.sh coforma/github-contribution-stats 2025-01-01 --users users.txt# Using repos file
GITHUB_TOKEN=ghp_xxxx ./github_stats_bulk_token.sh repos.txt
# With custom date and users
GITHUB_TOKEN=ghp_xxxx ./github_stats_bulk_token.sh repos.txt 2024-01-01 --users users.txt
# Using organization
GITHUB_TOKEN=ghp_xxxx ./github_stats_bulk_token.sh --org coforma
# Organization with custom date and users
GITHUB_TOKEN=ghp_xxxx ./github_stats_bulk_token.sh --org coforma 2025-01-01 --users users.txt- Authentication: Uses
GITHUB_TOKENenvironment variable instead ofghCLI - Dependencies: Requires
curlandjq(no GitHub CLI needed) - Functionality: Identical behavior and output to main scripts
- Rate Limits: Same rate limiting and retry logic
These scripts work in:
- WSL (Windows Subsystem for Linux): Install
jqwithsudo apt install jq - Git Bash: Install
jqfrom https://stedolan.github.io/jq/download/ - Cygwin: Install
curlandjqpackages
bash(4.0+)curl(for API requests)jq(for JSON parsing)- GitHub Personal Access Token
Never commit your token to git! The .gitignore file excludes common token files, but be careful not to accidentally share your token.