GitHub Repository Insights is your go-to CLI tool for exploring and analyzing GitHub repos like a pro β no browser needed! π Itβs sleek, itβs fast, and itβs built with Ruby. Whether you're stalking your favorite devβs projects or managing your own, this app has got you covered.
- Fetch Repos Like a Boss: Get a complete list of public repos from any GitHub user.
- Deets Galore: Check out stats like stars, forks, issues, language, size, and commit counts.
- Filter & Sort FTW: Flex those sorting skillsβstars, forks, issues, you name it.
- Export Data: Save repo info to CSV or JSON (because spreadsheets rule).
- Zero Clutter: Simple, intuitive CLI vibes.
- Error-Handled Like a Pro: No crashing, no burning. πΈ
- Ruby: Make sure you have Ruby installed (v2.7 or later is π).
- To install Ruby: Check this out
- GitHub PAT (Personal Access Token): Create one with
public_repo
access. Hereβs how. - Required Gems: Install dependencies by running:
gem install terminal-table dotenv
- Clone this bad boy:
git clone https://github.com/NML-LETRAS/github_repository_insights.git cd github_repository_insights
- Create a
.env
file and paste your GitHub PAT:GITHUB_API_KEY=your_personal_access_token_here
- Run the app:
ruby main.rb
When you fire up the app, youβll see:
--- GitHub Repository Insights ---
1. View Repositories
2. Search Repository by Name
3. View Detailed Repository Information
4. Export Repository Data
5. Help
6. Exit
Get all public repos for a GitHub user. See them laid out in a sick table:
+-------------------------+-------+-------+-------------+----------+-----------+---------+
| Name | Stars | Forks | Open Issues | Language | Size (MB) | Commits |
+-------------------------+-------+-------+-------------+----------+-----------+---------+
| repo-1 | 150 | 25 | 3 | Ruby | 0.20 | 500 |
+-------------------------+-------+-------+-------------+----------+-----------+---------+
Looking for a specific repo? No problem. Search by keywords and get instant results.
Want the nitty-gritty on a repo? Dive deep:
--- Repository Details ---
Name: repo-1
Description: CLI tool.
Stars: 150
Forks: 25
Open Issues: 3
Language: Ruby
Size: 0.20 MB
Default Branch: main
Created At: 2025-01-01
Last Updated: 2025-01-03
Save your results for later:
- CSV: Perfect for Excel nerds.
- JSON: Because who doesnβt love APIs?
Get a quick rundown of all features. π
Peace out! π
- Enter the GitHub username:
Enter GitHub username: octocat
- View repo data in style:
+-----------+-------+-------+-------------+----------+-----------+---------+ | Name | Stars | Forks | Open Issues | Language | Size (MB) | Commits | +-----------+-------+-------+-------------+----------+-----------+---------+ | repo-1 | 150 | 25 | 3 | Ruby | 0.20 | 500 | +-----------+-------+-------+-------------+----------+-----------+---------+
- Export the data:
Export data as: 1) CSV 2) JSON: 1 Data exported to repositories.csv
github_repository_insights/
βββ lib/
β βββ api_client.rb # GitHub API requests.
β βββ repository.rb # Repo model.
β βββ display.rb # CLI output.
β βββ utils.rb # Filtering, sorting, exporting.
βββ main.rb # App entry point.
βββ .env # Your API key lives here.
βββ Gemfile # Dependencies.
βββ README.md # This file! π
To make sure itβs all working, run:
rspec
This will check your code and ensure no bugs are lurking. π‘
- Add analytics for contributors and pull requests.
- Cache API responses for faster loading.
- Build a web app version (because CLI isnβt for everyone π).
MIT Licenseβbecause sharing is caring. π See the LICENSE
file for details.