A simple command-line interface tool that fetches and displays GitHub user activity using the GitHub API.
- Fetch recent GitHub activity for any user
- Display activity in a clean, readable format
- Support for multiple event types:
- Push events (with commit counts)
- Issue events (opened/closed)
- Watch events (starring repositories)
- Built with pure Go - no external dependencies
- Error handling for API failures and invalid usernames
- Clean and maintainable codebase structure
- Go 1.21 or higher
- Git
- Clone the repository
git clone https://github.com/yourusername/github-activity.git
cd github-activity
- Build the project
go build -o github-activity cmd/github-activity/main.go
- (Optional) Add to PATH
# On Unix-like systems
sudo mv github-activity /usr/local/bin/
github-activity <username>
Example:
$ github-activity kamranahmedse
- Pushed 3 commits to kamranahmedse/developer-roadmap
- Opened an issue in kamranahmedse/developer-roadmap
- Starred kamranahmedse/developer-roadmap
github-activity/
├── cmd/
│ └── github-activity/
│ └── main.go # Application entry point
├── internal/
│ ├── api/
│ │ └── github.go # GitHub API client
│ ├── models/
│ │ └── event.go # Data structures
│ └── formatter/
│ └── output.go # Output formatting logic
├── go.mod
└── README.md
The tool handles various error cases:
- Invalid GitHub usernames
- API rate limiting
- Network connectivity issues
- Malformed API responses
Example error output:
$ github-activity invalid@user
Error fetching events: GitHub API error: 404 Not Found - {"message": "Not Found"}
Contributions are welcome! Here are some ways you can contribute:
- Report bugs
- Suggest new features
- Submit pull requests
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Add authentication support for higher API rate limits
- Implement event filtering by type
- Add caching for better performance
- Support more event types
- Add pagination support
- Include colorized output
- Add detailed event information
- Support custom date ranges
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub API Documentation
- Go standard library
- The open-source community
If you encounter any problems or have suggestions, please open an issue in the GitHub repository.