Building GitMood - A CLI That Analyzes Your Commit Emotions with GitHub Copilot CLI
Source: Dev.to
Overview
GitMood is a CLI tool that analyzes your Git commit history, applies natural‑language sentiment analysis to commit messages, and generates an “emotional profile” of your coding journey. It visualizes mood trends over time, unlocks achievements, and can export shareable markdown reports.
Key Features
- Sentiment Analysis – Categorizes commits as positive, negative, or neutral.
- Time‑based Patterns – Shows when you’re happiest or most frustrated.
- ASCII Art Visualization – Terminal charts that illustrate mood trends.
- Mood Achievements – Badges such as “Zen Master” or “Rage Quitter”.
- Mood Reports – Generates shareable markdown reports.
Installation
npm install -g gitmood-cli
Usage
Analyze a Repository
gitmood analyze
Sample Output
🎭 GitMood Analysis for: my-awesome-project
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Overall Mood Score: 7.2/10 (Optimistic Developer!)
Mood Breakdown:
😊 Positive: ████████████████░░░░ 78%
😐 Neutral: ███░░░░░░░░░░░░░░░░░ 15%
😤 Negative: █░░░░░░░░░░░░░░░░░░░ 7%
📅 Weekly Mood Patterns:
Mon: 😊😊😊😊😊😊😊 (8.1)
Tue: 😊😊😊😊😊😊░ (7.5)
Wed: 😊😊😊😊😊░░ (6.8)
Thu: 😊😊😊😊░░░ (5.9)
Fri: 😤😤😤░░░░ (4.2) ← "fix: everything is broken"
🏆 Achievements Unlocked:
⭐ Zen Master - 50+ positive commits in a row
🌅 Early Bird - Most commits before 9 AM
🔥 Hot Streak - 30 days of continuous commits
Visualize Mood Over Time
gitmood chart --months 3
Commit Mood Over Last 3 Months
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
😊 | ╭──╮ ╭─────╮
| ╭──╯ ╰╮ ╭╯ │
| ╯ ╰──╯ ╰──
😐 |──╯
|
😤 |
└───────────────────────────
Dec Jan Feb
Generate a Shareable Report
gitmood report --format markdown > mood-report.md
Building GitMood with GitHub Copilot CLI
Project Scaffolding
gh copilot suggest "create a node.js cli tool structure with commander.js"
Copilot generated a complete boilerplate with argument parsing, help text, and a modular architecture.
Sentiment Analysis Engine
gh copilot explain "how to implement sentiment analysis in javascript without external APIs"
The suggestion used a lexicon‑based approach with the AFINN word list, handling scoring, sarcasm detection, and emoji parsing.
Parsing Git History
gh copilot suggest "parse git log with merge commits and extract only user messages"
The solution correctly handled octopus merges and signed commits.
ASCII Chart Generation
gh copilot suggest "generate ascii bar chart in terminal with node.js"
Copilot recommended the cli-chart pattern and showed how to make the chart responsive to terminal width.
Performance Review
gh copilot explain "review this function for performance issues"
It identified an O(n²) loop in date grouping and suggested using a Map for O(n) performance, resulting in a 10× speedup on large repositories.
Time Savings
| Task | Without Copilot | With Copilot |
|---|---|---|
| Project scaffolding | ~45 min | ~5 min |
| Sentiment algorithm R&D | ~3 h | ~30 min |
| Edge‑case handling | ~2 h | ~20 min |
| Total development | ~15–20 h | ~6 h |
Tech Stack
- Node.js + Commander.js – CLI framework
- AFINN sentiment lexicon – Lexicon‑based sentiment scoring
- chalk & ora – Colorful terminal output and spinners
- GitHub Copilot CLI – Assisted development
License
MIT