Shows daily line-change stats across all your GitHub repos in a terminal table.
And with --extra:
Column definitions:
- Added — truly new lines (no corresponding deletion in the same file)
- Changed — lines modified in place (
min(additions, deletions)per file) - Deleted — truly removed lines (no corresponding addition in the same file)
- uv — handles Python and dependencies automatically
- A GitHub personal access token (see below)
# last 7 days (default)
GITHUB_TOKEN=ghp_... uv run loc_deltas.py
# last 30 days
GITHUB_TOKEN=ghp_... uv run loc_deltas.py 30
# different user
GITHUB_TOKEN=ghp_... uv run loc_deltas.py 14 --user octocatuv will automatically create a temporary virtual environment and install
requests and rich on the first run. No setup step needed.
A token is not strictly required, but without one GitHub limits you to 60 API requests per hour. Because each commit requires a detail call, that budget is easily exhausted. With a token the limit is 5 000 req/hour.
- Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens
(
https://github.com/settings/tokens?type=beta) - Click Generate new token.
- Set an expiry (90 days is a reasonable default).
- Under Repository access choose All repositories (read-only is enough).
- Under Permissions → Repository permissions grant Contents: Read-only. No other permissions are needed.
- Click Generate token and copy the value — you won't see it again.
Pick whichever option fits your workflow:
Shell config (simplest) — add to ~/.zshrc or ~/.bashrc:
export GITHUB_TOKEN=ghp_yourtokenThen reload: source ~/.zshrc
A .env file — keep the token out of shell history and config:
echo "GITHUB_TOKEN=ghp_yourtoken" >> ~/.envLoad it when needed: source ~/.env — or add source ~/.env to your shell config.
pass (encrypted, recommended for long-term storage):
pass insert github/token # prompts for the value
export GITHUB_TOKEN=$(pass github/token)Add the export line to your shell config to load it automatically.
macOS Keychain (if you ever use this on a Mac):
security add-generic-password -a "$USER" -s github-token -w ghp_yourtoken
export GITHUB_TOKEN=$(security find-generic-password -a "$USER" -s github-token -w)Never commit a token to git. If you accidentally do, revoke it immediately on GitHub and generate a new one.

