Your Work Log CLI now has git-standup style integration that automatically pulls your commits when you end your work day!
The script now:
- ✅ Automatically detects git commits from your work start time
- ✅ Pulls commit hash, message, and timestamp
- ✅ Adds them to a dedicated "## Git Commits" section
- ✅ Shows a beautiful Rich table with traffic light colors
- ✅ Works with any git repository in the current directory
Linux:
python worklog_cli.py startWindows 11:
python worklog_cli.py startThis captures your work start time (e.g., 09:00).
Make your commits throughout the day as usual:
Linux:
git commit -m "feat: implement OAuth token refresh (AUTH-123)"
git commit -m "fix: resolve cart calculation bug (BUG-456)"
git commit -m "docs: update API documentation"Windows 11:
git commit -m "feat: implement OAuth token refresh (AUTH-123)"
git commit -m "fix: resolve cart calculation bug (BUG-456)"
git commit -m "docs: update API documentation"Linux:
python worklog_cli.py endWindows 11:
python worklog_cli.py endThe script will automatically:
- Calculate your total work hours
- 🔍 Scan the git repository for commits since your start time
- Extract commit hash, time, and message
- Add them to your daily log in a new "## Git Commits" section
- Show a beautiful table with your commits
╔═══════════════════════════╗
║ 🏁 Ending Work Day ║
╚═══════════════════════════╝
🔍 Checking for git commits...
┏━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
│ Time │ Hash │ Message │
┡━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ 09:30 │ a3f2d1b │ feat: implement OAuth token refresh (AUTH... │
│ 11:45 │ e7c8a9f │ fix: resolve cart calculation bug (BUG-456) │
│ 14:20 │ b2d4e6c │ docs: update API documentation │
│ 16:30 │ 9f1a3c5 │ test: add integration tests for auth flow │
└────────┴─────────┴──────────────────────────────────────────────┘
✅ Added 4 commit(s) to work log
✅ Work day completed
🕐 Start: 09:00
🕐 End: 17:00
⏱️ Total: 8.00h
The commits are added to your markdown file:
---
## Git Commits
| Time | Hash | Commit Message |
|-------|-----------|---------------------------------------------------|
| 09:30 | `a3f2d1b` | feat: implement OAuth token refresh (AUTH-123) |
| 11:45 | `e7c8a9f` | fix: resolve cart calculation bug (BUG-456) |
| 14:20 | `b2d4e6c` | docs: update API documentation |
| 16:30 | `9f1a3c5` | test: add integration tests for auth flow |
---
## Tags
#work-log #sprint-14Edit the FEATURE_FLAGS in worklog_cli.py:
FEATURE_FLAGS = {
"git_integration": True, # Set to False to disable
# ... other flags
}The script runs this git command:
Linux:
git log --since="<your-work-start-time>" --pretty=format:%h|%ai|%s --no-mergesWindows 11:
git log --since="<your-work-start-time>" --pretty=format:%h|%ai|%s --no-mergesWhere:
%h= Short commit hash (7 characters)%ai= Author date in ISO 8601 format (for timestamp)%s= Commit subject (message)--no-merges= Excludes merge commits
- Start: Your work_start time from the daily log
- End: When you run
worklog end - Fallback: If no start time found, uses midnight (00:00)
- No Manual Entry - Commits are pulled automatically
- Accurate Timeline - Shows exactly when you committed
- Task Correlation - Easy to match commits to work items (AUTH-123, etc.)
- Weekly Reports - Your git activity is now part of your shareable logs
- Performance Reviews - Clear record of code contributions
Possible causes:
- You're not in a git repository
- Run
git statusto verify - Navigate to your project directory first
- Run
- No commits since your work start time
- Linux: Check with:
git log --since="09:00" --oneline - Windows 11: Check with:
git log --since="09:00" --oneline
- Linux: Check with:
- Git not installed
- Linux: Install with:
sudo apt install git - Windows 11: Download from https://git-scm.com/download/win
- Linux: Install with:
Linux:
# Check if git is installed
which git
# Install if missing
# Ubuntu/Debian:
sudo apt install git
# Fedora/RHEL:
sudo dnf install git
# Or disable the feature:
FEATURE_FLAGS["git_integration"] = FalseWindows 11:
# Check if git is installed
git --version
# Install if missing
# Download from: https://git-scm.com/download/win
# Or use winget:
winget install --id Git.Git -e --source winget
# Or disable the feature:
FEATURE_FLAGS["git_integration"] = FalseThe script pulls all commits from the repository since your start time, regardless of author. If you want to filter by author, modify the git command in get_git_commits_today():
cmd = [
"git", "log",
f"--since={since_date}",
"--pretty=format:%h|%ai|%s",
"--no-merges",
f"--author={YOUR_NAME}" # Add this line
]Modify the format to include branch:
"--pretty=format:%h|%d|%ai|%s"Only show commits that touched specific files:
cmd.extend(["--", "*.py"]) # Only Python filesAdd logic to group commits by hour ranges in the log.
Want to scan multiple repositories? You could modify the script to:
- Define repo paths in CONFIG
- Loop through each repo
- Combine all commits into one table
Example:
CONFIG = {
"git_repos": [
"~/projects/frontend",
"~/projects/backend",
"~/projects/infrastructure"
],
# ...
}Your git commits are now part of your work log, so:
- Weekly summaries include them automatically
- Search by commit hash or message
- Share your complete work record with employers
- Track productivity - see commit frequency patterns
- Write good commit messages - They'll appear in your work log!
- Commit frequently - Better granularity in your timeline
- Use conventional commits -
feat:,fix:,docs:, etc. - Reference task IDs - Makes correlation easier (AUTH-123)
- Review before sharing - Check that commit messages are appropriate
Linux:
# Morning
cd ~/projects/my-app
python ~/worklog_cli.py start
# Work and commit throughout the day
git commit -m "feat(auth): implement OAuth (AUTH-123)"
git commit -m "test(auth): add unit tests"
git commit -m "fix(cart): calculation error (BUG-456)"
# Check status anytime
python ~/worklog_cli.py status
# End of day - commits auto-added!
python ~/worklog_cli.py end
# View your log
cat ~/work-logs/26-01-2026.mdWindows 11:
# Morning
cd C:\Users\YourUsername\projects\my-app
python C:\path\to\worklog_cli.py start
# Work and commit throughout the day
git commit -m "feat(auth): implement OAuth (AUTH-123)"
git commit -m "test(auth): add unit tests"
git commit -m "fix(cart): calculation error (BUG-456)"
# Check status anytime
python C:\path\to\worklog_cli.py status
# End of day - commits auto-added!
python C:\path\to\worklog_cli.py end
# View your log
type C:\Users\YourUsername\work-logs\26-01-2026.mdYour work logging is now fully automated with git integration. Every commit you make is automatically tracked and added to your daily log when you end your day.
No more forgetting what you worked on! 🚀