A powerful command-line interface (CLI) tool for analyzing and exploring GitHub repositories. Fetch repository information, analyze multiple endpoints simultaneously, and access repository data using the GitHub API.
✨ Current Features:
- 🔐 Secure Authentication - Store and manage GitHub personal access tokens locally
- 📦 Repository Information - Get complete repository details including stars, forks, and issues
- 👥 Contributors Analysis - View repository contributors and their statistics
- � User Profiles - Fetch and display GitHub user profile information and hovercard data
- �💬 Multiple Endpoints - Query multiple repository endpoints simultaneously
- 🌐 Languages Detection - See programming languages used in repositories
- 🏷️ Tags & Topics - Explore repository tags, topics, and forks
- 📊 Activity Tracking - Monitor repository activity and changes
- 🛡️ Token Management - View and remove stored tokens securely
- 📋 JSON Output - Formatted JSON responses printed to stdout
- Python 3.7 or higher
- pip (Python package manager)
-
Clone the repository:
git clone https://github.com/FaizeenHoque/github-repo-analyzer.git cd github-repo-analyzer -
Install dependencies:
pip install typer requests
-
Run the CLI:
python main.py --help
Before accessing repositories, authenticate with your GitHub personal access token to avoid rate limits and access private repositories:
python main.py configauth YOUR_GITHUB_TOKENpython main.py configauth --view-authpython main.py configauth --remove-authNote: Tokens are securely stored in
~/.github-repo-analyzer/config.json
Fetch and display repository information with various endpoint options:
python main.py getrepo owner/repopython main.py getrepo owner/repo --list-repo-contributorspython main.py getrepo owner/repo --list-repo-languagespython main.py getrepo owner/repo --list-repo-contributors --list-repo-languages --list-repo-tagsFetch and display GitHub user profile information:
python main.py getprofile usernamepython main.py getprofile username --get-hovercard# Get user email
python main.py getprofile username --get-email
# Get user name
python main.py getprofile username --get-name
# Get user company
python main.py getprofile username --get-company
# Get user blog
python main.py getprofile username --get-blog
# Get user location
python main.py getprofile username --get-location
# Get user bio
python main.py getprofile username --get-bio
# Get user X/Twitter handle
python main.py getprofile username --get-x
python main.py getprofile username --get-twitter{
"name": "repo-name",
"full_name": "owner/repo",
"description": "Repository description",
"stargazers_count": 100,
"forks_count": 50,
"open_issues_count": 10,
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-12-30T00:00:00Z"
}| Command | Description | Usage |
|---|---|---|
configauth |
Manage GitHub authentication | python main.py configauth [TOKEN] |
getrepo |
Get repository information | python main.py getrepo OWNER/REPO [...FLAGS] |
getprofile |
Get user profile information | python main.py getprofile USERNAME [...FLAGS] |
TOKEN- GitHub personal access token (optional)--view-auth- Display currently saved token--remove-auth- Remove stored authentication token
repo_url- Repository in formatowner/repo(required)--list-repo-activities- Lists detailed history of changes to the repository--list-repo-contributors- Lists contributors to the repository--list-repo-languages- Lists programming languages used in the repository--list-repo-tags- Lists tags associated with the repository--list-repo-teams- Lists teams associated with the repository--get-repo-topics- Lists topics associated with the repository--list-repo-forks- Lists forks of the repository
Note: Multiple flags can be used together to fetch multiple endpoints in one command.
user_id- GitHub username (required)--get-hovercard- Provides hovercard information about the user in relation to their pull requests, issues, repositories, and organizations--get-email- Provides the public email address of the user--get-name- Provides the public name of the user--get-company- Provides the public company of the user--get-blog- Provides the public blog URL of the user--get-location- Provides the public location of the user--get-bio- Provides the public bio of the user--get-x- Provides the public X handle of the user--get-twitter- Provides the public Twitter handle of the user
- Go to GitHub Settings > Developer Settings > Personal Access Tokens
- Click "Generate new token" (classic)
- Select scopes:
repo- Full control of private repositoriespublic_repo- Access public repositories
- Copy the generated token
- Use with
python main.py configauth YOUR_TOKEN
github-repo-analyzer/
├── main.py # Main CLI application entry point
├── api.py # GitHub API interaction functions
├── auth.py # Authentication management
├── printcolors.py # Terminal color utilities
├── commands/
│ ├── __init__.py # Commands package
│ ├── auth_commands.py # Authentication CLI commands
│ ├── repo_commands.py # Repository CLI commands
│ └── profile_commands.py # User profile CLI commands
├── README.md # Documentation
├── LICENSE # MIT License
└── __pycache__/ # Python cache files
The project follows a modular architecture:
- main.py - Minimal entry point that registers commands
- api.py - Contains all GitHub API request logic
- commands/ - Separate modules for different command categories
- auth_commands.py - Token management commands
- repo_commands.py - Repository query commands
- auth.py - Handles secure token storage and retrieval
- printcolors.py - Terminal color formatting utilities
Configuration files are stored at:
- Windows:
C:\Users\<username>\.github-repo-analyzer\config.json - Linux/Mac:
~/.github-repo-analyzer/config.json
- Authenticate using:
python main.py configauth YOUR_TOKEN
- Authenticate to increase rate limits from 60 to 5,000 requests/hour
- Wait for rate limit reset (shown in error message)
- Verify repository owner/name format:
owner/repo - Ensure you have access to private repositories (authenticate first)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Typer - CLI framework
- Uses GitHub REST API - GitHub API
- Powered by Requests - HTTP library
For issues, questions, or suggestions:
- Open an issue on GitHub
- Contact: haquefaizeen11@gmail.com
Made with ❤️ for developers by developers