https://roadmap.sh/projects/github-user-activity
A simple command-line tool that uses the GitHub API to fetch and display a user's recent activity directly in the terminal.
- Fetches recent activity (commits, issues, pull requests, etc.) for a given GitHub user.
- Displays the activity in a clean, human-readable format.
- Lightweight and easy to set up.
Before you can use this tool, ensure you have the following installed:
- Python 3.7+
- pip
- A GitHub Personal Access Token (if accessing private repositories or avoiding rate limits).
-
Clone the repository:
git clone https://github.com/your-username/github-user-activity-fetcher.git cd github-user-activity-fetcher
-
Install dependencies:
pip install -r requirements.txt
-
Run the script:
python main.py <github-username>
-
(Optional) Provide a GitHub Personal Access Token:
- Create a token at GitHub Developer Settings with the required scopes.
- Set the token as an environment variable:
export GITHUB_TOKEN=your_personal_access_token
Fetch recent activity for the user octocat
:
python main.py octocat
Output:
Recent activity for user: octocat
- [Commit] Updated README in repository `octocat/Hello-World` (2025-01-01)
- [Issue] Created issue: "Bug in API response" in `octocat/API-Repo` (2024-12-31)
- [Pull Request] Merged PR: "Fix typos" in `octocat/Docs` (2024-12-30)
You can customize the script by modifying the following settings in the config.py
file:
- API endpoint
- Number of activities to fetch
- Formatting options for terminal output
This project uses the following Python libraries:
requests
: For making HTTP requests to the GitHub APIargparse
: For parsing command-line argumentspython-dotenv
(optional): For managing environment variables
Contributions are welcome! If you'd like to add features, fix bugs, or improve documentation, feel free to submit a pull request.
- Fork the repository
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add some feature"
- Push to the branch:
git push origin feature-name
- Open a pull request
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy using GitHub User Activity Fetcher! 🚀