Alfian Yusuf Abdullah
All work

2024 · Shipped

Terminal heatmap

Reads shell history and prints a calendar heatmap of which commands you actually run. Small, finished, and slightly uncomfortable to look at.

Role
Build
Stack
Rust, CLI
Source
Repository

I wanted to know what my shell history says about me. The answer was that I run git status far more often than I would have guessed, and that my busiest days correlate with days I was confused rather than days I was productive.

Usage

terminal-heatmap --since "6 months ago" --top 20

Output is a 26-week grid, one cell per day, shaded by command volume. It reads ~/.zsh_history and ~/.bash_history and handles the format differences between them, which is most of the actual code.

Notes

The interesting constraint is that shell history is not a log. It has no timestamps in some configurations, it truncates, and zsh escapes newlines inside commands. Roughly a third of the implementation is parsing defensively around that.

The heatmap itself is a two-pass render: build the counts, find the 95th percentile, then bucket into four shades. Using the maximum instead of a high percentile makes almost every day look empty, because one day always has an outlier.