GitFollow
GitFollow is a CLI tool to track your GitHub followers and unfollows. Get notified when someone follows or unfollows you, generate detailed reports, and automate monitoring with GitHub Actions.
Features
- Track new followers and detect unfollows automatically
- Generate detailed statistics and reports (text and Markdown)
- Create GitHub Issues automatically on changes, with a 7-day activity summary
- Complete history with timestamps stored locally in JSON
- JSON and CSV export support
- Colorized terminal output with formatted tables
Installation
gem install gitfollowOr from source:
git clone https://github.com/bulletdev/gitfollow.git
cd gitfollow
bundle install
gem build gitfollow.gemspec
gem install ./gitfollow-*.gemConfiguration
GitFollow requires a GitHub Personal Access Token with read:user scope.
- Generate a token at GitHub Settings -> Developer settings -> Personal access tokens
- Set it as an environment variable:
export OCTOCAT_TOKEN="your_github_token_here"Or create a .env file:
OCTOCAT_TOKEN=your_github_token_here
Usage
Initialize
Create your first snapshot:
gitfollow initFetching initial data... Done!
Initialization complete!
Username: @yourname
Followers: 542
Following: 123
Mutual: 89
Run 'gitfollow check' to detect changes.
Check for Changes
gitfollow checkChecking for changes... Done!
Changes detected for @yourname
+ New Followers (2):
* @newuser1
* @newuser2
- Unfollowed (1):
* @olduser
Net change: +1
Previous: 542 -> Current: 543
Statistics
gitfollow statsFollower Statistics for @yourname
==================================================
┌──────────────────────┬─────┐
│ Followers │ 543 │
│ Following │ 123 │
│ Mutual │ 89 │
│ Ratio │4.41 │
│ Total New Followers │ 15 │
│ Total Unfollows │ 3 │
└──────────────────────┴─────┘
Last Updated: 2026-10-07 09:00:00 UTC
Reports
gitfollow report
gitfollow report --format=markdown
gitfollow report --format=markdown --output=report.mdGitFollow Report for @yourname
==================================================
Last Updated: 2026-10-07 09:00:00 UTC
Statistics:
Followers: 543
Following: 123
Mutual: 89
Ratio: 4.41
Total New: 15
Total Unfollows: 3
Recent Activity:
--------------------------------------------------
[2026-10-07 09:00] NEW @newuser1
[2026-10-06 09:00] UNFOLLOW @olduser
Mutual Followers and Non-Followers
gitfollow mutual
gitfollow non-followersExport Data
gitfollow export json data.json
gitfollow export csv data.csvAdvanced Options
gitfollow check --json # JSON output
gitfollow check --table # table format
gitfollow check --quiet # suppress output if no changes
gitfollow check --data-dir=/path/to/data
gitfollow check --notify="owner/repo" # create a GitHub Issue on changesAutomated Monitoring with GitHub Actions
Setup
- Add your token as a repository secret named
OCTOCAT_TOKEN - Create
.github/workflows/daily-check.yml:
name: Daily Follower Check
on:
schedule:
- cron: '0 9 * * *'
workflow_dispatch:
jobs:
check-followers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4.5'
bundler-cache: true
- name: Install GitFollow
run: |
gem build gitfollow.gemspec
gem install ./gitfollow-*.gem
- name: Cache follower data
uses: actions/cache@v4
with:
path: ~/.gitfollow
key: gitfollow-data-${{ github.repository_owner }}-${{ github.run_id }}
restore-keys: |
gitfollow-data-${{ github.repository_owner }}-
- name: Initialize if first run
env:
OCTOCAT_TOKEN: ${{ secrets.OCTOCAT_TOKEN }}
run: |
if [ ! -f ~/.gitfollow/snapshots.json ]; then
gitfollow init
fi
- name: Check for changes
env:
OCTOCAT_TOKEN: ${{ secrets.OCTOCAT_TOKEN }}
REPO: ${{ github.repository }}
run: gitfollow check --notify="$REPO" --quietIssue Format
When changes are detected, GitFollow creates a GitHub Issue with:
- Today's diff: new followers and unfollows since the last run
- Summary: previous/current count and net change
- Last 7 days activity: full table of recent events
CLI Reference
| Command | Description |
|---|---|
gitfollow init |
Initialize and create first snapshot |
gitfollow check |
Check for follower changes |
gitfollow report |
Generate detailed report |
gitfollow stats |
Display statistics |
gitfollow mutual |
List mutual followers |
gitfollow non-followers |
List non-followers |
gitfollow export FORMAT FILE |
Export data (json/csv) |
gitfollow clear |
Clear all stored data |
gitfollow version |
Display version |
Data Storage
Data is stored in ~/.gitfollow/ by default:
~/.gitfollow/
├── snapshots.json # follower snapshots
└── history.json # change history
Use --data-dir to change the location.
Development
bundle install
bundle exec rspec # run tests
bundle exec rubocop # lint
gem build gitfollow.gemspecContributing
- Fork the repository
- Create a feature branch
- Commit your changes with tests
- Open a Pull Request
Security
- Never commit your GitHub token to version control
- Use GitHub Secrets for CI/CD workflows
- Keep
.envin.gitignore
License
MIT — see LICENSE.
Made with Ruby by Michael D. Bullet