Repr uses git post-commit hooks to automatically queue commits for story generation. Hooks run silently after each commit—no interruptions, no network calls, just quiet tracking.
How It Works
When you install a hook:
Hook installed - repr creates .git/hooks/post-commit in your repo
You commit - Git triggers the hook after each commit
Commit queued - Hook adds commit SHA to ~/.repr/queue
You generate - Run repr generate to turn queued commits into stories
Privacy guarantee: Hooks never make network calls. They just write commit SHAs to a local file.
Usage
repr hooks [ACTION] [OPTIONS]
Actions
install - Set up automatic tracking
Install the hook script in .git/hooks/post-commit.Options:
--all - Install in all tracked repositories
--repo <path> - Install in a specific repository
Examples:
# Install in all tracked repos (recommended)repr hooks install --all# Install in specific reporepr hooks install --repo ~/code/myproject
Check which repositories have hooks installed and view queue statistics.Options:
--json - Output as JSON for scripting
Examples:
# Human-readable outputrepr hooks status# JSON outputrepr hooks status --json
Output:
Hook Status✓ myproject Hook installed and active Queue: 12 commits✓ frontend-app Hook installed and active Queue: 5 commits○ old-project No hook installed
Runs in background (&) - doesn’t slow down commits
Silent (2>/dev/null) - never interrupts your workflow
Always exits 0 - never blocks commits even if repr fails
No network calls - purely local file write
Workflow Examples
Daily Developer Flow
# One-time setuprepr hooks install --all# Then just work normallygit commit -m "Add user authentication"git commit -m "Fix session timeout"git commit -m "Add rate limiting"# At end of day/weekrepr generate --local# Output:# Processing 15 queued commits...# Generated 3 stories
Selective Hook Usage
Maybe you want hooks on work projects but not personal ones:
# Install only on work reposrepr hooks install --repo ~/code/work-project-1repr hooks install --repo ~/code/work-project-2# Personal projects: manual generation onlyrepr repos add ~/code/personal-project# (no hook installed)
Pausing Auto-Tracking
If you want to pause hook-based tracking without removing hooks:
repr repos pause ~/code/myproject# The hook stays installed but won't queue commits# Resume later:repr repos resume ~/code/myproject
Troubleshooting
Hook not running after commits
Check if it’s installed:
repr hooks status
If not installed:
repr hooks install --repo ~/code/myproject
Hook conflicts with existing post-commit
If you already have a post-commit hook, repr’s installer will warn you. You can:Option 1: Merge manually
# Edit your existing hookvim ~/code/myproject/.git/hooks/post-commit# Add this line:repr hooks queue $(git rev-parse HEAD) --repo $(git rev-parse --show-toplevel) 2>/dev/null &