A powerful Go-based command-line tool to manage your GitHub following relationships. Follow users who follow a specific user but don't follow you, or unfollow users who don't follow you back.
user:follow scopeClone the repository:
bash
git clone https://github.com/dbunt1tled/github-unfollow.git
cd github-unfollow
Install dependencies:
bash
go mod download
Build the application:
bash
go build -o github-followers ./cmd/main.go
go install github.com/dbunt1tled/github-unfollow@latest
user:follow scopeCreate a .env file in the project root or set environment variables:
# Required
GITHUB_USERNAME=your_github_username
GITHUB_TOKEN=your_github_personal_access_token
# Optional (with defaults)
WORKER_COUNT=1 # Number of concurrent workers (default: 1)
QUEUE_SIZE=3 # Size of the worker queue (default: 3)
TIME_DELAY_MS=2000 # Delay between API calls in milliseconds (default: 2000)
Note: You can copy
.env.exampleto.envand fill in your credentials.
The tool provides two main commands: follow and unfollow.
Follow followers of a specific user who don't already follow you:
# Basic usage - follow followers of 'username' who don't follow you
./github-followers follow username
# Skip confirmation prompt
./github-followers follow username --force
./github-followers follow username -f
Unfollow users who don't follow you back:
# Show users who don't follow you back (dry run)
./github-followers unfollow
# Actually unfollow users who don't follow you back without confirm
./github-followers unfollow --f
./github-followers unfollow --force
github-unfollow/
├── cmd/ # Main application entry point
├── internal/
│ ├── cli/ # Command-line interface implementation
│ ├── config/ # Configuration management
│ ├── git_hub_manager/# GitHub API client and operations
│ ├── helper/ # Utility and helper functions
│ └── worker/ # Worker pool implementation
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
├── go.mod # Go module definition
├── go.sum # Go module checksums
└── main.go # Application entry point
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
Unfollow users who don't follow you back:
# Basic usage - unfollow users who don't follow you back
./github-unfollow unfollow
# Skip confirmation prompt
./github-unfollow unfollow --force
./github-unfollow unfollow -f
Example workflow:
1. Tool fetches your followers list
2. Tool fetches your following list
3. Identifies users you follow who don't follow you back
4. Shows the list and asks for confirmation (unless --force is used)
5. Unfollows the users concurrently with rate limiting
Both commands support the following flags:
--force, -f: Skip interactive confirmation prompt (use with caution)--help, -h: Show help information# Show general help
./github-unfollow --help
# Show help for specific commands
./github-unfollow follow --help
./github-unfollow unfollow --help
Recommended: 1-5 for most use cases
QUEUE_SIZE: Size of the task queue (default: 3)
Should be >= WORKER_COUNT
TIME_DELAY_MS: Delay between API calls in milliseconds (default: 2000)
Conservative (safe for large operations):
WORKER_COUNT=1
QUEUE_SIZE=3
TIME_DELAY_MS=3000
Balanced:
WORKER_COUNT=2
QUEUE_SIZE=3
TIME_DELAY_MS=2000
# Set token and username via environment
export GITHUB_USERNAME="myusername"
export GITHUB_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxx"
export WORKER_COUNT=2
export TIME_DELAY_MS=1500
./github-unfollow unfollow
The project is organized into the following components:
main.go: Application entry pointcmd/: Cobra CLI commandsroot.go: Root command setupfollow.go: Follow command implementationunfollow.go: Unfollow command implementationinternal/: Internal packagesconfig/: Configuration management with Vipergit_hub_manager/: GitHub API client wrapperworker/: Worker pool for concurrent processinghelper/: Utility functionsuser:follow scope - no access to repositories or other data.env file or commit it to version control.env file is included in .gitignore by defaultGitHub API has rate limits:
- 5,000 requests per hour for authenticated requests
- Each follow/unfollow operation uses 1 API call
- The tool includes built-in delays (configurable via TIME_DELAY_MS)
- Use conservative settings for large operations
"Authentication failed" error:
- Verify your GITHUB_TOKEN is correct and has user:follow scope
- Check that the token hasn't expired
"Rate limit exceeded" error:
- Increase TIME_DELAY_MS value
- Reduce WORKER_COUNT
- Wait for the rate limit to reset (1 hour)
"User not found" error: - Verify the username exists and is public - Some users may have restricted follower lists
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
This tool is provided as-is, without any warranties. Use it at your own risk. The maintainers are not responsible for any issues caused by using this tool. Always review the list of users before confirming bulk operations.
If you find this tool useful, please consider giving it a ⭐ on GitHub!
$ claude mcp add github-unfollow \
-- python -m otcore.mcp_server <graph>