Transform your git commits with the soundtrack of your code
Interactive-Commit is a git hook that automatically appends your currently playing audio to commit messages, creating a rich narrative of your development journey. Working solution for WSL2/Windows, Linux, and macOS environments.
# Install the CLI tool
go install github.com/pixare40/interactive-commit@latest
# Option 1: Install for current repository only
interactive-commit install --local
# Option 2: Install globally for ALL repositories (recommended!)
interactive-commit install --global
# Make a commit and watch the magic happen!
git add . && git commit -m "fix: resolve authentication bug"
# Result: Your commit message + 🎵 Currently playing: "Focus Flow" by Lo-Fi Study Beats (Spotify)
- Universal Audio Detection: Works with Spotify, YouTube Music, Chrome, Edge, Firefox
- WSL2/Windows Bridge: Breakthrough solution for cross-platform audio detection
- Privacy-First: All audio data stays local on your machine
- Single Binary: Zero dependency installation
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Git Hook │───▶│ Audio Detector │───▶│ Commit Formatter│
│ (prepare-commit)│ │ (Platform Layer) │ │ (Template Engine)│
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ Audio Sources │
│ • Window Titles │
│ • MPRIS/D-Bus │
│ • PowerShell API │
│ • AppleScript │
└──────────────────┘
Platform | Audio Source | Method | Status |
---|---|---|---|
WSL2 | Windows Spotify | Window Title Parsing | Working |
WSL2 | Windows Browsers | Window Title Parsing | Working |
Linux Native | MPRIS/D-Bus | playerctl |
Working |
macOS | Spotify/Apple Music/iTunes | AppleScript Player State | Working |
macOS | Browser Media | AppleScript Window Titles | Working |
The Problem: WSL2 runs in a separate Linux VM and traditionally can't access Windows audio streams.
Current Solution:
- Window Title Bridge: PowerShell queries Windows process window titles from WSL2
- Smart Pattern Matching: Intelligent parsing of Spotify, YouTube Music, and browser titles
- Cross-Platform Communication: Seamless WSL2 ↔ Windows process interaction
The Solution: Native AppleScript integration for comprehensive audio detection.
Implementation:
- Player State Detection: AppleScript queries actual playback state (playing/paused/stopped)
- Direct API Access: Native access to Spotify, Apple Music, and iTunes metadata
- Browser Window Monitoring: Intelligent parsing of browser window titles with priority for "Audio playing" indicators
- Smart Prioritization: Prioritizes actively playing apps over paused ones
Example Detection Patterns:
- Spotify:
"Artist - Song Title"
→ Parsed to structured data - YouTube Music:
"Song - Artist - YouTube Music"
→ Clean extraction - Browser Media: Generic
"Title - Source"
patterns for web players
- Go 1.21+
- Git 2.9+
- For WSL2: PowerShell accessible via
powershell.exe
- For Linux: Optional
playerctl
for MPRIS support - For macOS:
osascript
(included with macOS) for AppleScript detection
git clone https://github.com/pixare40/interactive-commit.git
cd interactive-commit
go build -o interactive-commit ./cmd/interactive-commit
# Install locally for current repo only
./interactive-commit install --local
# OR install globally for all repositories
./interactive-commit install --global
# Download binary from GitHub releases
# curl -L https://github.com/pixare40/interactive-commit/releases/latest/download/interactive-commit-linux -o interactive-commit
# chmod +x interactive-commit && ./interactive-commit install --local
# Install for current repository only
interactive-commit install --local
# Install globally for ALL repositories (recommended!)
interactive-commit install --global
# Verify installation
interactive-commit detect
Global vs Local Installation:
Mode | Command | Scope | Use Case |
---|---|---|---|
Local | --local |
Current repository only | Testing, specific projects |
Global | --global |
All repositories | Default recommendation |
Global Installation Details:
- Creates hooks in
~/.config/git/hooks/
(Linux/WSL2/macOS) - Configures Git's
core.hooksPath
globally - Works automatically in ALL repositories
- To disable:
git config --global --unset core.hooksPath
# Test what's currently playing
interactive-commit detect
# Example output:
# 🎵 Detecting currently playing audio...
# 📡 Available detectors: 1
# ✅ WSL2/Windows Media Session
#
# 🎵 Currently playing:
# Title: Hamnitishi (feat. Talia Oyando)
# Artist: E-Sir
# Source: Spotify
# Type: song
#
# 💬 Commit message addition:
# 🎵 Currently playing: "Hamnitishi (feat. Talia Oyando)" by E-Sir (Spotify)
# Start playing music, then commit normally
git add .
git commit -m "feat: implement user authentication"
# Your commit message automatically becomes:
# feat: implement user authentication
#
# 🎵 Currently playing: "Coding Flow" by Lo-Fi Beats (Spotify)
├── README.md # This file
├── cmd/interactive-commit/ # CLI entry point
│ └── main.go # Application main
├── internal/
│ ├── audio/ # Audio detection engine
│ │ └── detector.go # Multi-platform audio detection
│ └── cli/ # Command-line interface
│ ├── root.go # Root command & version
│ ├── detect.go # Audio detection testing
│ ├── hook.go # Git hook handler
│ └── install.go # Hook installation
├── go.mod # Go module definition
└── go.sum # Dependency checksums
# Clone and build
git clone https://github.com/pixare40/interactive-commit.git
cd interactive-commit
go mod tidy
go build -o interactive-commit ./cmd/interactive-commit
# Run tests
go test ./...
# Cross-compile for different platforms
GOOS=windows GOARCH=amd64 go build -o interactive-commit.exe ./cmd/interactive-commit
GOOS=darwin GOARCH=amd64 go build -o interactive-commit-macos ./cmd/interactive-commit
# Music while coding
git commit -m "refactor: optimize database queries"
# Result:
# refactor: optimize database queries
#
# 🎵 Currently playing: "Bohemian Rhapsody" by Queen (Spotify)
# Podcast while debugging
git commit -m "fix: resolve memory leak in worker pool"
# Result:
# fix: resolve memory leak in worker pool
#
# 🎵 Currently playing: "The Changelog #423: Building Better APIs" (YouTube Music)
# Focus music for deep work
git commit -m "feat: implement distributed caching layer"
# Result:
# feat: implement distributed caching layer
#
# 🎵 Currently playing: "Deep Focus" by Brain.fm (Microsoft Edge)
- 100% Local: All audio detection happens on your machine
- No Telemetry: No data sent to external services
- No Storage: Audio info only added to git commits you create
- Opt-out Anytime: Simply remove the git hook to disable.
# Check if global hooks path is configured
git config --global core.hooksPath
# Should show: /home/username/.config/git/hooks (absolute path)
# If it shows: ~/.config/git/hooks (with tilde), fix it:
git config --global core.hooksPath "$(echo ~/.config/git/hooks)"
# Verify the hook file exists and is executable
ls -la ~/.config/git/hooks/prepare-commit-msg
# Test the hook manually
cd /any/git/repo
interactive-commit detect
# Verify PowerShell is accessible
powershell.exe -Command "Write-Host 'PowerShell working'"
# Test audio detection directly
interactive-commit detect
# Make sure hook is executable
chmod +x ~/.config/git/hooks/prepare-commit-msg
# Check Git version (needs 2.9+)
git --version
- v0.1: WSL2/Windows Spotify detection via window titles
- v0.2: Multi-browser support (Chrome, Edge, Firefox)
- v0.3: Git hook installation system
- v0.4: Linux native MPRIS support improvements
- v0.5: macOS Now Playing integration
- v0.6: Global git hook installation
- v0.7: Configuration file support
- v1.0: Cross-platform stability & release
High Priority:
- macOS Support: Now Playing integration
- Windows Native: Direct Windows Media Foundation API support
- Config System:
.interactive-commit.json
configuration - CI/CD: Automated testing and releases
- Documentation: Usage examples and troubleshooting
Getting Started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and test thoroughly
- Commit with Interactive-Commit:
git commit -m "feat: add amazing feature"
- Push and create a Pull Request
- Windows Media Session API for the inspiration (even though we ended up using window titles!)
- MPRIS specification for Linux audio standards
- Cobra CLI for excellent command-line interface framework
- The WSL2 team for making cross-platform development possible
MIT License - See LICENSE for details.
Ready to soundtrack your code?
go install github.com/pixare40/interactive-commit@latest
interactive-commit install --local
git commit -m "feat: add musical commits to my workflow"
Soundtrack your creations.