Tools
Tools: I built Spotify Wrapped for Git using GitHub Copilot CLI
2026-02-15
0 views
admin
What I Built ## The Full Feature Set ## Why I Built This ## Try it yourself ## Tech Stack ## My Experience with GitHub Copilot CLI ## 1. Understanding git log format ## 2. Calculating commit streaks ## 3. Grouping commits by hour of day ## 4. Rendering the terminal heatmap ## The Impact ## Challenges & Discoveries ## What Makes This Special GitHub Copilot CLI Challenge Submission This is a submission for the GitHub Copilot CLI Challenge git-wrapped — Spotify Wrapped, but for your Git history. Every December, Spotify tells you what kind of listener you are. I wanted the same thing for coding. What if your terminal could tell you that you're a Night Owl who codes at 2 AM, or a Code Surgeon who deletes more than they write? git-wrapped is a Python CLI tool that analyzes any Git repository and generates a beautiful, colorful terminal report. No browser, no dashboard, no account — just run a command and see your year in code. I spend a lot of time in the terminal. I wanted something that celebrates the work developers do — not just the PRs that get merged, but the late-night debugging sessions, the weekend side projects, the 14-day commit streaks that nobody notices. git-wrapped makes that visible. And it's fun. GitHub repo: stackmasteraliza/git-wrapped One external dependency. That's it. GitHub Copilot CLI was my pair programmer for this entire project. Instead of tab-switching between Stack Overflow, Git docs, and Rich documentation, I stayed in my terminal and asked Copilot directly. Here's exactly how I used it at each stage of development: The first challenge was figuring out how to extract structured data from git log. I asked Copilot CLI to explain the --format flags, and it gave me a clear breakdown of every placeholder — %H for hash, %an for author name, %aI for ISO date, %s for subject line — plus how --numstat adds per-file insertion/deletion stats and how >>> delimiters can separate commits for reliable parsing. This saved me from trial-and-error with Git's dense documentation. Computing the longest daily commit streak was trickier than expected. I needed to handle gaps, deduplicate dates, and track both the longest historical streak and the current active one. I asked Copilot CLI for approaches and it gave me multiple solutions — a Python version using datetime.timedelta to detect consecutive days, and even a Bash one-liner. I adapted the Python approach directly into my analyzer: For the "When You Code" charts, I needed to count commits grouped by hour. Copilot CLI gave me multiple shell approaches — from simple cut pipelines to awk loops — which helped me understand the data shape before writing the Python version. Seeing the shell approach first made the Python implementation obvious. This was the hardest visual to get right. A GitHub-style contribution heatmap, but in the terminal, using colored Unicode blocks. I asked Copilot CLI how to render a colored heatmap using Python's Rich library, and it showed me two approaches: I ended up combining both — using Rich's Console for color management and block characters for the grid cells: Without Copilot CLI, each of these problems would have meant opening a browser, scanning docs, finding a relevant example, adapting it, and testing. That cycle breaks flow. With Copilot CLI, the cycle was: ask a question → get a working answer → adapt and move on. I stayed in my terminal the entire time. The cognitive load dropped and I could focus on making the output feel delightful instead of fighting implementation details. It felt less like using a tool and more like pair programming with someone who has every man page memorized. The heatmap was the hardest part. Terminals don't have pixels — you're working with a character grid where each "cell" is a text character. Getting the heatmap to look like GitHub's contribution graph required careful math: mapping 52 weeks × 7 days into a grid, choosing the right Unicode block characters, and picking green shades that look good across different terminal themes. Personality detection was surprisingly fun. The "Coder DNA" feature assigns you a personality based on your commit patterns. Calibrating the thresholds (e.g., "30% of commits after 10 PM = Night Owl") required running it against a bunch of real repos to make sure the labels felt accurate and fun, not arbitrary. Rich is incredible. Python's Rich library does the heavy lifting for all the terminal visuals — panels, tables, progress bars, colored text. It's the reason git-wrapped looks polished without needing a web UI. Built with Python, Rich, and a lot of late-night commits. Powered by GitHub Copilot CLI. GitHub Repository: stackmasteraliza/git-wrapped Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK:
# Install from PyPI
pip install git-wrapped # Or install from source
git clone https://github.com/stackmasteraliza/git-wrapped.git
cd git-wrapped
pip install -e . # Run on any repo
git-wrapped # Analyze a specific year
git-wrapped --year 2025 # Compare two years
git-wrapped --compare 2024 2025 # Generate a share card
git-wrapped --share Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
# Install from PyPI
pip install git-wrapped # Or install from source
git clone https://github.com/stackmasteraliza/git-wrapped.git
cd git-wrapped
pip install -e . # Run on any repo
git-wrapped # Analyze a specific year
git-wrapped --year 2025 # Compare two years
git-wrapped --compare 2024 2025 # Generate a share card
git-wrapped --share COMMAND_BLOCK:
# Install from PyPI
pip install git-wrapped # Or install from source
git clone https://github.com/stackmasteraliza/git-wrapped.git
cd git-wrapped
pip install -e . # Run on any repo
git-wrapped # Analyze a specific year
git-wrapped --year 2025 # Compare two years
git-wrapped --compare 2024 2025 # Generate a share card
git-wrapped --share COMMAND_BLOCK:
# Copilot helped me arrive at this pattern
sorted_dates = sorted(set(commit_dates))
streak, max_streak = 1, 1
for i in range(1, len(sorted_dates)): if (sorted_dates[i] - sorted_dates[i-1]).days == 1: streak += 1 max_streak = max(max_streak, streak) else: streak = 1 Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
# Copilot helped me arrive at this pattern
sorted_dates = sorted(set(commit_dates))
streak, max_streak = 1, 1
for i in range(1, len(sorted_dates)): if (sorted_dates[i] - sorted_dates[i-1]).days == 1: streak += 1 max_streak = max(max_streak, streak) else: streak = 1 COMMAND_BLOCK:
# Copilot helped me arrive at this pattern
sorted_dates = sorted(set(commit_dates))
streak, max_streak = 1, 1
for i in range(1, len(sorted_dates)): if (sorted_dates[i] - sorted_dates[i-1]).days == 1: streak += 1 max_streak = max(max_streak, streak) else: streak = 1 CODE_BLOCK:
colors = ["bright_black", "dark_green", "green", "bright_green"]
char = "█"
for week in range(weeks): for day in range(7): intensity = get_intensity(data[week][day]) output += f"[{colors[intensity]}]{char}[/]" Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
colors = ["bright_black", "dark_green", "green", "bright_green"]
char = "█"
for week in range(weeks): for day in range(7): intensity = get_intensity(data[week][day]) output += f"[{colors[intensity]}]{char}[/]" CODE_BLOCK:
colors = ["bright_black", "dark_green", "green", "bright_green"]
char = "█"
for week in range(weeks): for day in range(7): intensity = get_intensity(data[week][day]) output += f"[{colors[intensity]}]{char}[/]" - The Numbers — Total commits, files changed, lines added/deleted, net line impact, active days
- Activity Heatmap — A GitHub-style contribution calendar rendered entirely in your terminal using Unicode block characters
- When You Code — Hour-of-day and day-of-week bar charts showing your coding rhythm
- Top Files — Leaderboard of your most frequently modified files
- Languages — Programming language breakdown with percentage bars
- Streaks & Records — Longest streak, current streak, busiest single day, best month
- Coder DNA — A personality assessment based on your commit patterns: Night Owl, Early Bird, Weekend Warrior, Streak Master, Feature Machine, Code Surgeon, or Balanced Builder
- Fun Facts — Holiday commits, longest/shortest commit messages, contributor count, productivity stats
- Compare Mode — Year-over-year comparison (--compare 2024 2025) with delta percentages and personality shift tracking
- Share Card — A copy-pasteable plain text card for sharing on social media (--share)
- JSON Export — Dump raw stats as JSON for further analysis or integrations - Python 3.8+ — Core language
- Rich — Terminal formatting (panels, tables, progress bars, styled text)
- Git log parsing — Custom parser using --numstat and --format for file-level stats
- Zero external API calls — Everything runs locally, your data never leaves your machine - A Table-based approach using Rich's Table with colored cells
- A block character approach mapping values to █ characters with ANSI colors - See your coding habits visualized in seconds
- Discover patterns you didn't know you had (turns out I code most on Thursdays)
- A fun conversation starter in team standups - Run it on shared repos to see team-wide patterns
- Compare year-over-year to track how the team's rhythm evolves - Fully open source — fork it, extend it, make it yours
- Single dependency — easy to install anywhere
- Privacy-first — everything runs locally, no data leaves your machine
how-totutorialguidedev.toaibashshellswitchpythongitgithub