Skip to content

Playbooks for g

Story-style workflows—solo, team, and on-call. Jump into the full Use cases page anytime.

Stats

Turn your git history into a local, private dashboard — heatmaps, top commands, commit-type breakdowns, and fuzzy search.

g stats renders a usage dashboard right in your terminal — a contribution heatmap, the commands you run most, your conventional-commit mix, busiest hours, top authors, and more. Everything is computed locally and stored in ~/.config/g/g.db (SQLite). Nothing is uploaded; nothing phones home.

g stats

First run feels a little empty? Some sections (commit search, duplicates, message length) read from an imported history. Run g stats --import once to backfill, then re-run g stats.

Quick start

g stats                       # full report, last 365 days
g stats --days 90             # narrow the time-based sections to 90 days
g stats --no-git              # skip sections that shell out to git
g stats --import              # backfill commit history into the local db
g stats --search "fix login"  # fuzzy-search commit messages
g stats --duplicates          # find commit messages you've reused
g stats --message-stats       # subject-length trends over time

What’s in the report

A full g stats run prints these sections, each as its own panel:

SectionWhat it showsSource
Usage OverviewTotals: commands run, commits, active dayslocal db
Commit Heatmap — Last 52 WeeksGitHub-style contribution gridgit
Lines Changed — Last 60 CommitsAdditions vs deletions per commitgit
Top CommandsThe g/git subcommands you run mostlocal db
Commit TypesYour feat / fix / docs … mix from g commitlocal db
Repository ActivityCommits, churn, and recent momentumgit
Activity by Hour (UTC)When in the day you commitgit
Top AuthorsWho’s been committing in this repogit

Pass --no-git to print only the panels that come from the local database — handy in a directory that isn’t a git repository, or for a fast summary.

Importing history

The command-tracking panels grow naturally as you use g. The commit-message features (search, duplicates, message length) need a one-time import of your existing history:

g stats --import              # import everything
g stats --import-limit 2000   # cap the import to the most recent N commits

Re-running --import is safe: existing commits are skipped, only new ones are added.

Search your commit messages

Fuzzy-search across everything you’ve imported:

g stats --search "auth"
g stats --search "revert migration"

Each hit shows the short hash, author, date, and subject. If you get no results, import first:

g stats --import && g stats --search "auth"

Find duplicate & repetitive messages

Spot copy-pasted or low-signal commit subjects:

g stats --duplicates          # messages used more than once

Pair it with message statistics to see whether your subjects are trending too long (the conventional-commit sweet spot is ≤ 72 characters):

g stats --message-stats

This prints overall length statistics plus a 12-month trend of average subject length, and a Top Authors / Top Duplicate Messages breakdown.

Where the data lives

PathContents
~/.config/g/g.dbSQLite database: command usage + imported commits
~/.config/g/config.tomlYour configuration (see Configuration)

Because it’s a plain SQLite file, it’s easy to inspect or wipe:

g developer db                # open the database in sqlite3
rm ~/.config/g/g.db           # start fresh (re-created on next run)

Tips

  • Run g stats --days 30 on a Monday for a quick “what did I ship last month”.
  • g stats --no-git is instant — great for a shell prompt widget or alias.
  • Combine with Theming: a heavy-border theme makes the heatmap and bars pop on a projector.