Git Commit Stats CLI Tool
Write a command-line tool in Swift that parses local git log output to report commit frequency per author, busiest days of the week, and largest commits. Learners practice Swift Process/shell invocation, string parsing, and building formatted terminal reports.
- Estimate
- ~10.5h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
Foundation · ArgumentParser
Project roadmap
- 01
Set up the Swift package with ArgumentParser
~1.5hScaffold a CLI tool using ArgumentParser for options like repository path and date range.
- 02
Invoke git log via Process
~2hRun git log with a custom format and capture its output using Foundation's Process API.
- 03
Parse commit metadata
~2hParse author, date, and message from each log line using regular expressions.
- 04
Aggregate statistics
~2hCompute commit counts per author and per weekday.
- 05
Detect largest commits
~1.5hParse diff stats to identify the largest commits by lines changed.
- 06
Print a formatted report
~1.5hPrint a colored, aligned terminal report summarizing all statistics.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack