Skip to content

Auth#4

Merged
PranavU-Coder merged 2 commits intomasterfrom
auth
Mar 30, 2026
Merged

Auth#4
PranavU-Coder merged 2 commits intomasterfrom
auth

Conversation

@PranavU-Coder
Copy link
Copy Markdown
Owner

@PranavU-Coder PranavU-Coder commented Mar 30, 2026

  • Code changes have been tested locally
  • I know how to update typings and have done so
  • This PR changes the projects's interface (inbuilt methods or parameters added)
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

Summary by CodeRabbit

  • New Features

    • Added command-line authentication for GitHub tokens
    • Implemented local caching for user profiles and avatar images with configurable refresh intervals
    • Enhanced terminal display with multiple image rendering strategies
  • Chores

    • Version bumped to 1.0.0
    • Restructured codebase into modular package organization
    • Updated dependencies and build configuration

@PranavU-Coder PranavU-Coder self-assigned this Mar 30, 2026
@PranavU-Coder PranavU-Coder added enhancement New feature or request good first issue Good for newcomers labels Mar 30, 2026
@github-project-automation github-project-automation bot moved this to Backlog in hubFetching Mar 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 1d87c3f9-d700-41bd-8fed-03239c44fbf5

📥 Commits

Reviewing files that changed from the base of the PR and between e826f90 and 498b83b.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • .gitignore
  • gh_scrap.py
  • ghfetch.sh
  • ghfetch/__init__.py
  • ghfetch/api.py
  • ghfetch/auth.py
  • ghfetch/cache.py
  • ghfetch/cli.py
  • ghfetch/config.py
  • ghfetch/display.py
  • main.py
  • pyproject.toml
  • shell.py
💤 Files with no reviewable changes (3)
  • ghfetch.sh
  • shell.py
  • gh_scrap.py

📝 Walkthrough

Walkthrough

This pull request refactors the project from standalone Python scripts into a structured Python package with a Click-based CLI. Old scripts (gh_scrap.py, ghfetch.sh, shell.py) are removed and replaced with modular components: an API client (api.py), authentication handler (auth.py), configuration manager (config.py), caching layer (cache.py), terminal renderer (display.py), and CLI entry point (cli.py). Dependencies are updated in pyproject.toml and a console script is registered.

Changes

Cohort / File(s) Summary
Configuration & Setup
.gitignore, pyproject.toml, main.py
Updated .gitignore to expose /assets and /output while adding cache/pycache patterns. Bumped version to 1.0.0, added click and pillow dependencies, registered ghfetch console script entry point, and added build system/tool config.
Removed Legacy Scripts
gh_scrap.py, ghfetch.sh, shell.py
Deleted standalone scripts that previously handled GitHub scraping, shell orchestration, and terminal rendering. Functionality is reorganized into modular package structure.
Package Initialization
ghfetch/__init__.py
New package init exposing top-level symbols: config, GitHubClient, and render via __all__.
Core API Client
ghfetch/api.py
New GitHubClient class providing GitHub REST/GraphQL integration with methods for user data, repositories, starred count, contributions, and orchestrated stats fetching via fetch_stats() with concurrent I/O and caching.
Authentication & Credentials
ghfetch/auth.py, ghfetch/config.py
New auth.py module with Click command for PAT verification and credential input. New config.py manages persistent credential storage in ~/.config/ghfetch/config.json with environment variable overrides.
Caching & Display
ghfetch/cache.py, ghfetch/display.py
New cache.py manages avatar and stats caching under ~/.cache/ghfetch with configurable refresh intervals. New display.py renders GitHub profiles to terminal using multiple image strategies (external tools or internal block-art fallback) and Rich tables.
CLI Framework
ghfetch/cli.py
New Click command group serving as the main CLI entry point, checking credentials, invoking GitHubClient, fetching stats, and delegating to render(). Registers auth as a subcommand.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A package born from scripts once scattered wide,
With auth and cache now standing side-by-side,
Click commands hop where shells once ran alone,
GitHub stats now claimed as our own!
From chaos clear, a modular design—
Refactoring magic, oh how we shine! ✨


Note

🎁 Summarized by CodeRabbit Free

The PR author is not assigned a seat. To perform a comprehensive line-by-line review, please assign a seat to the pull request author through the subscription management page by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@PranavU-Coder PranavU-Coder merged commit f5984ed into master Mar 30, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in hubFetching Mar 30, 2026
@PranavU-Coder PranavU-Coder deleted the auth branch March 30, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant