Skip to content

Getting Started

Prerequisites

trueloc requires the GitHub CLI (gh) to be installed and authenticated:

# Install GitHub CLI (if not already installed)
# macOS
brew install gh

# Ubuntu/Debian
sudo apt install gh

# Windows
winget install GitHub.cli

Then authenticate:

gh auth login

Installation

uv tool install trueloc
uvx trueloc count USERNAME --since 1m
pip install trueloc
pipx install trueloc
git clone https://github.com/basnijholt/trueloc.git
cd trueloc
pip install -e .

Verify Installation

trueloc --help

You should see the available commands and options.

Your First Count

Count your lines of code from the last month:

trueloc count YOUR_USERNAME --since 1m

This will:

  1. Fetch all repositories you have access to
  2. Find merged PRs and direct commits since the specified date
  3. Count lines added and deleted across all commits
  4. Display a summary with per-PR breakdown and file type analysis

Next Steps