{"id":42914081,"url":"https://github.com/lancedesk/github-unfollower","last_synced_at":"2026-02-04T11:45:45.905Z","repository":{"id":335501521,"uuid":"1134399249","full_name":"lancedesk/github-unfollower","owner":"lancedesk","description":"A powerful cross-platform Bash script to manage GitHub followers and following relationships. Identify non-followers, bulk unfollow/follow with dry-run support, auto-sync mode, rate limiting, and secure token persistence. Works on Windows (Git Bash), macOS, and Linux with global installation support.","archived":false,"fork":false,"pushed_at":"2026-01-30T15:18:47.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T07:42:35.532Z","etag":null,"topics":["bash","bash-script","bash-scripting","bashrc","follower-analysis","follower-analytics","follower-robot","follower-tracker","github-actions","github-api"],"latest_commit_sha":null,"homepage":"https://lancedesk.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lancedesk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-14T17:03:00.000Z","updated_at":"2026-01-30T15:25:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lancedesk/github-unfollower","commit_stats":null,"previous_names":["lancedesk/github-unfollower"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lancedesk/github-unfollower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedesk%2Fgithub-unfollower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedesk%2Fgithub-unfollower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedesk%2Fgithub-unfollower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedesk%2Fgithub-unfollower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lancedesk","download_url":"https://codeload.github.com/lancedesk/github-unfollower/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lancedesk%2Fgithub-unfollower/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29083297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","bash-scripting","bashrc","follower-analysis","follower-analytics","follower-robot","follower-tracker","github-actions","github-api"],"created_at":"2026-01-30T17:01:08.352Z","updated_at":"2026-02-04T11:45:45.899Z","avatar_url":"https://github.com/lancedesk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Follower Manager\r\n\r\nA powerful Bash script to manage your GitHub followers and following. Easily identify users who don't follow you back, bulk unfollow non-followers, and follow back your followers - all with dry-run support and rate limiting.\r\n\r\n![Bash](https://img.shields.io/badge/Bash-5.0%2B-green)\r\n![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20macOS%20%7C%20Linux-blue)\r\n![License](https://img.shields.io/badge/License-MIT-yellow)\r\n\r\n## 🎯 Features\r\n\r\n- **View Non-Followers**: See who you follow that doesn't follow you back\r\n- **View Unfollowed**: See followers you haven't followed back\r\n- **Bulk Unfollow**: Remove all non-followers at once\r\n- **Selective Unfollow**: Review and choose each user individually\r\n- **Bulk Follow Back**: Follow all your followers with one command\r\n- **Dry Run Mode**: Preview actions before executing them\r\n- **Rate Limiting**: Built-in delays to avoid GitHub API throttling\r\n- **Progress Tracking**: Real-time progress indicators\r\n- **Token Persistence**: Save your token securely for future sessions\r\n- **Logging**: All actions logged with timestamps\r\n- **Cross-Platform**: Works on Windows (Git Bash), macOS, and Linux\r\n- **Auto-Install Dependencies**: Automatic jq installation on Windows via Scoop\r\n- **Command-Line Arguments**: Direct option execution and auto-confirm support\r\n- **Auto-Sync Mode**: Combine unfollow + follow operations in one command\r\n- **Full Automation**: -y flag for completely unattended execution\r\n\r\n## 📋 Requirements\r\n\r\n### Dependencies\r\n\r\n| Dependency | Purpose | Installation |\r\n|------------|---------|--------------|\r\n| **Bash** | Shell interpreter | Pre-installed on macOS/Linux, use Git Bash on Windows |\r\n| **curl** | API requests | Pre-installed on most systems |\r\n| **jq** | JSON parsing | See installation below |\r\n\r\n### Installing jq\r\n\r\n**Windows (Git Bash):**\r\n```bash\r\n# The script will offer to install automatically via Scoop\r\n# Or manually:\r\nscoop install jq\r\n```\r\n\r\n**macOS:**\r\n```bash\r\nbrew install jq\r\n```\r\n\r\n**Linux (Debian/Ubuntu):**\r\n```bash\r\nsudo apt install jq\r\n```\r\n\r\n**Linux (Fedora/RHEL):**\r\n```bash\r\nsudo dnf install jq\r\n```\r\n\r\n## 🚀 Installation\r\n\r\n1. **Clone the repository:**\r\n   ```bash\r\n   git clone https://github.com/lancedesk/github-unfollower.git\r\n   cd github-unfollower\r\n   ```\r\n\r\n2. **Make the script executable:**\r\n   ```bash\r\n   chmod +x gh-followers.sh\r\n   ```\r\n\r\n3. **Create a GitHub Personal Access Token:**\r\n   - Go to [GitHub Settings → Tokens](https://github.com/settings/tokens)\r\n   - Click \"Generate new token (classic)\"\r\n   - Select the `user:follow` scope\r\n   - Copy the generated token\r\n\r\n4. **Run the script:**\r\n   ```bash\r\n   ./gh-followers.sh\r\n   ```\r\n\r\n5. **(Optional) Install globally:**\r\n   ```bash\r\n   chmod +x install.sh\r\n   ./install.sh\r\n   ```\r\n   Then restart your terminal and just type:\r\n   ```bash\r\n   followers\r\n   ```\r\n\r\n## 🌐 Global Installation\r\n\r\nThe `install.sh` script adds the `followers` command to your system PATH, allowing you to run it from any directory.\r\n\r\n### Installing\r\n\r\n```bash\r\nchmod +x install.sh\r\n./install.sh\r\n```\r\n\r\nAfter installation, **restart your terminal** (or run `source ~/.bashrc`) and use:\r\n\r\n```bash\r\nfollowers\r\n```\r\n\r\n### What the installer does\r\n\r\n| Operating System | Installation Location | Method |\r\n|------------------|----------------------|--------|\r\n| **Windows (Git Bash)** | `~/bin/followers` | Wrapper script + adds to `~/.bashrc` |\r\n| **macOS** | `/usr/local/bin/followers` or `~/bin` | Symlink |\r\n| **Linux** | `/usr/local/bin/followers` or `~/.local/bin` | Symlink + adds to `~/.bashrc` |\r\n\r\n### Uninstalling\r\n\r\nTo remove the `followers` command from your PATH:\r\n\r\n```bash\r\nchmod +x uninstall.sh\r\n./uninstall.sh\r\n```\r\n\r\nThis removes the command but keeps your token and logs intact.\r\n\r\n### Files after installation\r\n\r\n```\r\ngithub-unfollower/\r\n├── gh-followers.sh          # Main script (don't move/delete!)\r\n├── install.sh               # Installer\r\n├── uninstall.sh             # Uninstaller\r\n├── .github-token            # Your saved token (gitignored)\r\n├── .gitignore               # Ignores sensitive files\r\n├── gh-follower-manager.log  # Action log\r\n└── README.md                # This file\r\n```\r\n\r\n\u003e **Note:** Don't move or delete the `gh-followers.sh` script after installation - the `followers` command points to it!\r\n\r\n## 📖 Usage\r\n\r\n### Running the Script\r\n\r\n**Interactive Mode (default):**\r\n```bash\r\n./gh-followers.sh\r\n# or with global installation:\r\nfollowers\r\n```\r\n\r\n**Direct Command Mode:**\r\n```bash\r\n# Run specific option directly\r\n./gh-followers.sh 9          # Run auto-sync (will ask about dry-run)\r\nfollowers 3                   # Run bulk unfollow (will ask about dry-run)\r\n\r\n# Auto-accept ALL prompts with -y flag (no token confirmation, no dry-run)\r\n./gh-followers.sh 9 -y       # Auto-sync completely unattended\r\nfollowers 3 -y                # Bulk unfollow completely unattended\r\n\r\n# Arguments work in any order\r\nfollowers -y 1                # Show non-followers, auto-confirm token\r\nfollowers 0                   # Exit (same as using 0 in interactive mode)\r\n```\r\n\r\n**Command-Line Options:**\r\n| Flag | Description |\r\n|------|-------------|\r\n| `-y, --yes` | Auto-accept all prompts (skip token confirmation AND dry-run prompts) |\r\n| `-h, --help` | Show help message with all available options |\r\n\r\nOn first run, you'll be prompted to enter your GitHub token. The token is saved securely to `.github-token` for future sessions.\r\n\r\n### Menu Options\r\n\r\n```\r\n=========================================\r\n    GitHub Follower Manager\r\n=========================================\r\n1) Show who you follow but they don't follow back\r\n2) Show your followers you don't follow back\r\n3) Unfollow users who don't follow you back (bulk)\r\n4) Unfollow users (selective - choose each)\r\n5) Follow back your followers (bulk)\r\n6) Show rate limit status\r\n7) Change GitHub token\r\n8) Debug: Show counts\r\n9) Auto-sync: Unfollow non-followers + Follow back\r\n0) Exit\r\n=========================================\r\n```\r\n\r\n### Option Details\r\n\r\n| Option | Description |\r\n|--------|-------------|\r\n| **1** | Lists users you follow who don't follow you back (potential bots/spam accounts) |\r\n| **2** | Lists your followers that you haven't followed back yet |\r\n| **3** | Bulk unfollow all non-followers (with dry-run option) |\r\n| **4** | Review each non-follower individually and choose to unfollow or keep |\r\n| **5** | Bulk follow all your followers you're not currently following |\r\n| **6** | Check your GitHub API rate limit status |\r\n| **7** | Update or change your GitHub token |\r\n| **8** | Debug mode showing raw counts and mutual follow statistics |\r\n| **9** | **Auto-sync mode**: Automatically unfollow non-followers then follow back all followers in one operation |\r\n| **0** | Exit the program |\r\n\r\n### Dry Run Mode\r\n\r\nWhen performing bulk actions (options 3, 5, and 9), you'll be asked:\r\n```\r\nDry run first? (y/n):\r\n```\r\n\r\n- **y**: Preview what would happen without making changes\r\n- **n**: Execute actions immediately\r\n\r\n**Skip with -y flag:** Use `followers 9 -y` to bypass all prompts and execute immediately (perfect for automation).\r\n\r\nAfter a dry run, you can choose to execute for real:\r\n```\r\nExecute for real? (y/n):\r\n```\r\n\r\n## ⚙️ Configuration\r\n\r\n### Environment Variables\r\n\r\n| Variable | Default | Description |\r\n|----------|---------|-------------|\r\n| `GITHUB_TOKEN` | - | Your GitHub Personal Access Token |\r\n| `WAIT_BETWEEN_REQUESTS` | 2 | Seconds between API calls |\r\n| `WAIT_BETWEEN_ACTIONS` | 5 | Seconds between follow/unfollow actions |\r\n\r\n### Files Created\r\n\r\n| File | Description |\r\n|------|-------------|\r\n| `.github-token` | Stores your GitHub token (gitignored) |\r\n| `gh-follower-manager.log` | Action log with timestamps |\r\n\r\n## 🔒 Security\r\n\r\n- Your token is stored locally in `.github-token` with restricted permissions (`chmod 600`)\r\n- The token file is included in `.gitignore` to prevent accidental commits\r\n- **Never share your GitHub token or commit it to version control**\r\n\r\n## 🐛 Troubleshooting\r\n\r\n### Common Issues\r\n\r\n**Script exits unexpectedly during dry run:**\r\n- Fixed in latest version. Was caused by bash arithmetic with `set -e`\r\n\r\n**Same users appearing in both \"don't follow back\" lists:**\r\n- Fixed in latest version. Was caused by Windows line endings (`\\r`)\r\n\r\n**\"jq: command not found\":**\r\n- Install jq using the commands in the Requirements section\r\n- On Windows, the script offers automatic installation via Scoop\r\n\r\n**\"Authentication failed\":**\r\n- Ensure your token has the `user:follow` scope\r\n- Generate a new token if the old one expired\r\n- Use option 7 to update your token\r\n\r\n**Rate limit exceeded:**\r\n- Use option 6 to check your rate limit status\r\n- Wait for the rate limit to reset (shown in the output)\r\n- The script includes built-in delays to avoid this\r\n\r\n### Windows-Specific Notes\r\n\r\n- Use **Git Bash** to run the script (comes with Git for Windows)\r\n- The script automatically detects Windows and handles line endings\r\n- If Scoop/jq installation fails, restart your terminal after installation\r\n\r\n### Linux/macOS Notes\r\n\r\n- The script should work out of the box\r\n- Ensure `bash`, `curl`, and `jq` are installed\r\n- Make the script executable with `chmod +x gh-followers.sh`\r\n\r\n## 📊 Rate Limits\r\n\r\nGitHub API has rate limits:\r\n- **Authenticated requests**: 5,000 per hour\r\n- The script shows remaining requests after authentication\r\n- Built-in delays prevent hitting rate limits during normal use\r\n\r\n## 🤝 Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n1. Fork the repository\r\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\r\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\r\n4. Push to the branch (`git push origin feature/AmazingFeature`)\r\n5. Open a Pull Request\r\n\r\n## 📝 License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## 🙏 Acknowledgments\r\n\r\n- GitHub API documentation\r\n- The jq project for JSON parsing\r\n- Scoop package manager for Windows\r\n\r\n## 📧 Support\r\n\r\nIf you encounter any issues or have questions:\r\n1. Check the Troubleshooting section above\r\n2. Open an issue on GitHub\r\n3. Include your OS, bash version, and error messages\r\n\r\n---\r\n\r\n**⚠️ Disclaimer**: Use this tool responsibly. Mass following/unfollowing may violate GitHub's Terms of Service if abused. This tool is intended for managing legitimate follower relationships.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancedesk%2Fgithub-unfollower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flancedesk%2Fgithub-unfollower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flancedesk%2Fgithub-unfollower/lists"}