Skip to content

Git Seer is a powerful CLI tool that provides instant insights into any public GitHub repository.

License

Notifications You must be signed in to change notification settings

LMLK-seal/Git-Seer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ Git Seer

โšก Lightning-fast GitHub repository analysis without cloning

Git Seer is a powerful CLI tool that provides instant insights into any public GitHub repository. Get comprehensive overviews of project structure, dependencies, languages, and potential security concernsโ€”all without downloading a single file.

โœจ Features

๐ŸŽฏ Core Capabilities

  • ๐Ÿ“Š Repository Analytics - Stars, forks, issues, and description at a glance
  • ๐Ÿ—‚๏ธ Project Structure Analysis - Detect monorepos, Django projects, Docker setups
  • ๐Ÿ” Language Detection - Identify primary programming languages and file counts
  • ๐Ÿ“ฆ Dependency Scanning - Find package.json, requirements.txt, and other dependency files
  • ๐Ÿšฉ Security Insights - Flag potential secrets, credentials, and sensitive files
  • โšก Zero Clone Required - Leverages GitHub API for instant analysis

๐Ÿ–ฅ๏ธ Two Powerful Interfaces

1. Standard CLI (seer.py)

Clean, formatted terminal output with rich tables and panels

python seer.py owner/repository

2. Interactive TUI (seer-tui.py)

Full-featured terminal user interface with expandable file tree navigation

python seer-tui.py owner/repository

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.8 or higher
  • Internet connection (for GitHub API access)

Installation

  1. Clone the repository

    git clone https://github.com/LMLK-Seal/git-seer.git
    cd git-seer
  2. Install dependencies

    pip install -r requirements.txt

Usage

๐ŸŽจ Standard CLI Mode

# Analyze any public GitHub repository
python seer.py microsoft/vscode
python seer.py facebook/react
python seer.py your-username/your-repo

Example Output:

โ”Œโ”€ Oracle Report for microsoft/vscode โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โญ 162,847 โ”‚ ๐Ÿด 28,234 โ”‚ ๐Ÿž 6,543 issues                    โ”‚
โ”‚ Visual Studio Code                                           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ—ฃ๏ธ Top Languages    TypeScript (2,847 files), JavaScript (1,234 files)
๐Ÿ›๏ธ Architecture     ๐Ÿ“ฆ 'src' layout detected
                   ๐Ÿณ Dockerized environment
                   ๐Ÿ”„ CI/CD configured (GitHub Actions)
๐Ÿ“ฆ Dependencies     Found: package.json, yarn.lock
๐Ÿšฉ Red Flags        โœ… No obvious secret files found.

๐Ÿ–ฑ๏ธ Interactive TUI Mode

# Launch interactive file explorer
python seer-tui.py microsoft/vscode

TUI Features:

  • ๐Ÿ“‚ Expandable file tree - Navigate repository structure visually
  • โŒจ๏ธ Keyboard shortcuts - q to quit, t to toggle theme
  • ๐ŸŽจ Dark/Light themes - Toggle between visual modes
  • ๐Ÿ”„ Real-time loading - Asynchronous data fetching with status updates

๐Ÿ› ๏ธ Technical Architecture

Core Components

๐Ÿ”— API Integration

  • GitHub REST API - Repository metadata and file tree retrieval
  • Rate Limiting Aware - Handles API limits gracefully
  • Fallback Logic - Attempts both main and master branches

๐Ÿง  Analysis Engine

# Smart project detection
def analyze_project_structure(tree: list) -> list:
    # Detects: src/ layouts, monorepos, Django, Docker, CI/CD

๐ŸŽจ Rich Terminal UI

  • Rich Library - Beautiful tables, panels, and progress indicators
  • Textual Framework - Interactive TUI components and widgets
  • Typer CLI - Type-safe command-line argument parsing

๐Ÿ“ Project Structure

git-seer/
โ”œโ”€โ”€ seer.py           # Standard CLI interface
โ”œโ”€โ”€ seer-tui.py       # Interactive TUI interface
โ”œโ”€โ”€ requirements.txt  # Python dependencies
โ””โ”€โ”€ README.md         # This documentation

๐Ÿ”ง Dependencies

Package Purpose Version
requests GitHub API communication Latest
typer CLI framework Latest
rich Terminal formatting Latest
textual TUI framework Latest

Install all dependencies:

pip install requests typer rich textual

๐Ÿ“Š Analysis Capabilities

๐Ÿ—๏ธ Project Structure Detection

  • โœ… Source Layouts - src/ directory organization
  • โœ… Monorepos - packages/ or apps/ structure
  • โœ… Framework Detection - Django (manage.py), etc.
  • โœ… Containerization - Docker and docker-compose files
  • โœ… CI/CD Pipelines - GitHub Actions workflows

๐Ÿ” Language Analysis

Supports detection of:

  • ๐Ÿ Python
  • ๐ŸŸจ JavaScript/TypeScript
  • ๐Ÿฆ€ Rust
  • โ˜• Java
  • ๐Ÿ’Ž Ruby
  • ๐Ÿน Go
  • โšก C/C++
  • ๐Ÿ“ Markdown, HTML, CSS, YAML, JSON

๐Ÿšจ Security Scanning

Flags potentially sensitive files:

  • ๐Ÿ”‘ .env files
  • ๐Ÿ” Credential files
  • ๐Ÿ—๏ธ SSH keys (id_rsa, .pem)
  • ๐Ÿšซ Other secret-containing files

๐ŸŽฏ Use Cases

๐Ÿ‘จโ€๐Ÿ’ป For Developers

  • Quick Repository Assessment - Understand project structure before cloning
  • Technology Stack Discovery - Identify languages and frameworks used
  • Security Auditing - Spot potential security issues in public repos

๐Ÿข For Teams

  • Code Review Preparation - Get context before reviewing PRs
  • Architecture Analysis - Understand project organization patterns
  • Dependency Auditing - Identify package managers and dependency files

๐ŸŽ“ For Learning

  • Open Source Exploration - Study popular repositories without downloading
  • Best Practices - Learn from well-structured projects
  • Technology Research - Discover how different tools are organized

โš™๏ธ Configuration (Optional)

Environment Variables

# Optional: GitHub Personal Access Token for higher API limits
export GITHUB_TOKEN=your_personal_access_token

API Rate Limits

  • Unauthenticated: 60 requests/hour
  • Authenticated: 5,000 requests/hour

๐Ÿ”‘ GitHub Authentication Setup

Git Seer works seamlessly without any configuration, but adding a GitHub Personal Access Token dramatically improves your experience by increasing API rate limits from 60 to 5,000 requests per hour.

Quick Setup

# Set your GitHub token (optional but recommended)
export GITHUB_TOKEN=your_personal_access_token

Code Implementation Required

To enable token authentication, you need to modify both seer.py and seer-tui.py. Here are the required changes:

Step 1: Add import at the top of both files

import os  # Add this import if not already present

Step 2: Update the request functions in seer.py

Current Code (Anonymous):

def get_repo_metadata(repo_owner: str, repo_name: str) -> dict | None:
    api_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}"
    try:
        response = requests.get(api_url)  # โ† No authentication
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException:
        return None

Updated Code (With Token Support):

def get_repo_metadata(repo_owner: str, repo_name: str) -> dict | None:
    api_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}"
    
    # Check for GitHub token and set up headers
    token = os.getenv("GITHUB_TOKEN")
    headers = {}
    if token:
        headers["Authorization"] = f"token {token}"
    
    try:
        response = requests.get(api_url, headers=headers)  # โ† Now with auth
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException:
        return None

Step 3: Update the get_repo_tree function in seer.py

Current Code:

def get_repo_tree(repo_owner: str, repo_name: str, branch: str = "main") -> list | None:
    api_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/git/trees/{branch}?recursive=1"
    try:
        response = requests.get(api_url)  # โ† No authentication
        # ... rest of function

Updated Code:

def get_repo_tree(repo_owner: str, repo_name: str, branch: str = "main") -> list | None:
    api_url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/git/trees/{branch}?recursive=1"
    
    # Check for GitHub token and set up headers
    token = os.getenv("GITHUB_TOKEN")
    headers = {}
    if token:
        headers["Authorization"] = f"token {token}"
    
    try:
        response = requests.get(api_url, headers=headers)  # โ† Now with auth
        # ... rest of function remains the same

Step 4: Update the get_tree function in seer-tui.py

Current Code:

def get_tree(branch: str = "main") -> list | None:
    api_url = f"https://api.github.com/repos/{owner}/{name}/git/trees/{branch}?recursive=1"
    try:
        response = requests.get(api_url, timeout=10)  # โ† No authentication
        # ... rest of function

Updated Code:

def get_tree(branch: str = "main") -> list | None:
    api_url = f"https://api.github.com/repos/{owner}/{name}/git/trees/{branch}?recursive=1"
    
    # Check for GitHub token and set up headers
    token = os.getenv("GITHUB_TOKEN")
    headers = {}
    if token:
        headers["Authorization"] = f"token {token}"
    
    try:
        response = requests.get(api_url, headers=headers, timeout=10)  # โ† Now with auth
        # ... rest of function remains the same

How Authentication Works

The requests.get() function sends standard HTTP requests with no inherent knowledge of GitHub's authentication system:

Without Token (Anonymous Requests):

  • GitHub API receives unauthenticated request
  • Counts against public rate limit (60 requests/hour per IP)
  • โšก Analysis Capacity: ~30-60 repositories/hour

With Token (Authenticated Requests):

  • Authorization header identifies you to GitHub API
  • Counts against your personal rate limit (5,000 requests/hour)
  • ๐Ÿš€ Analysis Capacity: ~2,500-5,000 repositories/hour

๐Ÿ“ˆ Performance Impact

Each Git Seer analysis makes 1-2 API calls per repository:

  • 1 call for repository metadata (stars, forks, description)
  • 1 call for complete file tree structure
Authentication Rate Limit Repos/Hour Use Case
None 60 requests/hour 30-60 repos Quick checks, demos
Token 5,000 requests/hour 2,500-5,000 repos Development, batch analysis

๐ŸŽฏ Creating a GitHub Token

  1. Go to GitHub Settings โ†’ Personal Access Tokens

  2. Click "Generate new token" โ†’ Choose "Personal access tokens (classic)"

  3. Set Token Name: git-seer-cli

  4. Select Scopes:

    • โœ… public_repo (for public repository access)
    • โœ… repo (only if you need private repository access)
  5. Generate Token and copy it immediately

  6. Set Environment Variable:

# Linux/macOS
echo 'export GITHUB_TOKEN=your_token_here' >> ~/.bashrc
source ~/.bashrc

# Windows PowerShell
$env:GITHUB_TOKEN="your_token_here"

# Windows Command Prompt
set GITHUB_TOKEN=your_token_here

๐Ÿ”’ Security Best Practices

  • ๐Ÿ” Never commit tokens to version control
  • ๐Ÿ”„ Rotate tokens regularly (every 6-12 months)
  • ๐Ÿ“ Use minimal scopes required for your use case
  • ๐Ÿ—‘๏ธ Delete unused tokens from GitHub settings
  • ๐Ÿ’พ Store securely using environment variables or secret managers

๐Ÿ”ฎ Future Enhancements

  • ๐Ÿ“ˆ Commit Analysis - Activity patterns and contributor insights
  • ๐Ÿ”„ Real-time Updates - Live repository monitoring
  • ๐Ÿ’พ Caching Layer - Local storage for faster repeated analysis
  • ๐ŸŒ Web Interface - Browser-based repository explorer
  • ๐Ÿ“Š Export Options - JSON, CSV, and PDF report generation
  • ๐Ÿ”’ Private Repository Support - GitHub token integration

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch
  3. โœ๏ธ Make your changes
  4. โœ… Add tests if applicable
  5. ๐Ÿ“ค Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • ๐ŸŽจ Rich - For beautiful terminal formatting
  • ๐Ÿ–ฅ๏ธ Textual - For powerful TUI capabilities
  • โšก Typer - For elegant CLI interfaces
  • ๐Ÿ™ GitHub API - For making repository data accessible

โญ Star this repository if you find it useful!


Built with โค๏ธ for the developer community