A neofetch-style CLI tool for GitHub, GitLab, Gitea, Forgejo, Codeberg, and Sourcehut statistics. Display your profile and stats from various git hosting platforms in a beautiful, colorful terminal interface with extensive customization options and intelligent layout adaptation.
|
|
|
- Neofetch-style display with ASCII art
- Comprehensive statistics from multiple git hosting platforms
- Smart SQLite-based caching system for faster subsequent runs
- Cross-platform support (macOS and Linux)
- First-run initialization with interactive provider selection
- Customize contribution characters, hide/show sections, control display elements
- Flags for advanced configuration (e.g.,
--no-date,--graph-only,--custom-box,--width,--height) see full list below withgitfetch --help
- GitHub - Uses GitHub CLI (gh) for authentication
- GitLab - Uses GitLab CLI (glab) for authentication
- Gitea/Forgejo/Codeberg - Uses personal access tokens
- Sourcehut - Uses personal access tokens
gitfetch can be installed without any prerequisites. During first-run setup, you'll be guided to install and authenticate with the necessary CLI tools or provide access tokens for your chosen git hosting platform.
When you run gitfetch for the first time, you'll be prompted to:
- Choose your git hosting provider (GitHub, GitLab, Gitea/Forgejo/Codeberg, or Sourcehut)
- Install required CLI tools (if using GitHub or GitLab)
- Authenticate with your chosen platform
- Configure access tokens (if using Gitea/Forgejo/Codeberg or Sourcehut)
The setup process will provide helpful error messages and installation instructions if anything is missing.
brew tap matars/gitfetch
brew install gitfetchyay -S gitfetch-pythonOr with other AUR helpers:
paru -S gitfetch-python
trizen -S gitfetch-pythonOr manual build:
git clone https://aur.archlinux.org/gitfetch-python.git
cd gitfetch-python
makepkg -si- Clone this repo
cdinto the repo- Then type the below command
pip install -e .uv tool install git+https://github.com/Matars/gitfetchpipx install git+https://github.com/Matars/gitfetchOn first run, gitfetch will initialize and ask you to configure your default GitHub username:
gitfetchThis creates:
~/.config/gitfetch/gitfetch.conf- Configuration file~/.local/share/gitfetch/cache.db- SQLite cache database
Use default username (from config):
gitfetchFetch stats for specific user:
gitfetch usernameBypass cache and fetch fresh data:
gitfetch username --no-cacheClear cache:
gitfetch --clear-cacheChange the configured git provider:
gitfetch --change-providerCustomize contribution block characters:
gitfetch --custom-box "██"
gitfetch --custom-box "■"
gitfetch --custom-box "●"Set custom graph dimensions:
gitfetch --width 50 --height 5 # 50 chars wide, 5 days high
gitfetch --width 100 # Custom width, default height
gitfetch --height 3 # Default width, 3 days highHide month/date labels:
gitfetch --no-dateShow only contribution graph:
gitfetch --graph-onlyHide specific sections:
gitfetch --no-achievements # Hide achievements
gitfetch --no-languages # Hide languages
gitfetch --no-issues # Hide issues section
gitfetch --no-pr # Hide pull requests
gitfetch --no-account # Hide account info
gitfetch --no-grid # Hide contribution gridCombine multiple options:
gitfetch --no-date --no-achievements --custom-box "█" --width 60gitfetch automatically adapts to your terminal size, but you can control spacing:
gitfetch --spaced # Enable spaced layout
gitfetch --not-spaced # Disable spaced layoutThe coloring system uses GitHub's standard contribution levels, which are absolute thresholds that remain consistent regardless of the time period or dimensions displayed:
- 0 contributions: Lightest gray
- 1-2 contributions: Light green (Level 1)
- 3-6 contributions: Medium green (Level 2)
- 7-12 contributions: Dark green (Level 3)
- 13+ contributions: Darkest green (Level 4)
What Custom Dimensions Affect:
--widthand--heightcontrol how many weeks/days are visible- The coloring thresholds remain the same (GitHub standard)
- You see the same accurate representation, just for a different time period
When It Might Seem "Inaccurate": If you're viewing only recent weeks with generally lower activity, everything might appear in lighter colors. This is actually correct - those weeks truly have fewer contributions compared to your overall history standards.
gitfetch automatically selects the best layout based on your terminal dimensions:
- Full Layout: Shows all sections (graph, account info, languages, achievements) when there's sufficient space (width ≥ 120 columns)
- Compact Layout: Shows graph and key info side-by-side for medium terminals
- Minimal Layout: Shows only the contribution graph for narrow terminals
The system considers both terminal width AND height to ensure optimal display. For very short terminals, it may choose more compact layouts even with sufficient width.
You can override automatic layout selection using the --width and --height flags to set custom graph dimensions, which will force gitfetch to adapt the layout accordingly.
gh auth loginFollow the prompts to authenticate with GitHub.
Install GitHub CLI:
- macOS:
brew install gh - Linux: See https://github.com/cli/cli#installation
gh auth statusConfiguration file location: ~/.config/gitfetch/gitfetch.conf
The configuration file is automatically created on first run. See docs/providers.md for detailed provider configuration and docs/colors.md for color customization options.
[DEFAULT]
username = yourusername
cache_expiry_hours = 24
provider = github
provider_url = https://api.github.com
custom_box = ■username: Your default username (automatically detected)cache_expiry_hours: How long to keep cached data (default: 24 hours)provider: Git hosting provider (github, gitlab, gitea, sourcehut)provider_url: API URL for the providercustom_box: Character used for contribution blocks (default: ■)
Note: Custom graph dimensions (--width, --height) and section visibility flags (--no-*) are command-line only and not saved in the configuration file.
Howerver if there is a need for it to be added to the config file please open an issue.
gitfetch supports extensive color customization. All colors use ANSI escape codes. See docs/colors.md for detailed color configuration options.
```ini
[COLORS]
reset = \033[0m
bold = \033[1m
# ... color definitions ...See docs/colors.md for detailed color configuration options and customization examples.
gitfetch supports multiple Git hosting platforms:
See docs/providers.md for detailed setup instructions for each provider.
Cache database location: ~/.local/share/gitfetch/cache.db
If you have an older version of gitfetch (pre v1.1.0) that stored cache in ~/.config/gitfetch/cache.db, you can safely delete the old cache file:
rm ~/.config/gitfetch/cache.db- Inspired by the beautiful contribution graph design from Kusa by Ryu0118
- Inspired by the very cool and extremely fun tool songfetch by fwtwoo
- Zeviraty: Small fixes, color configuration
- Vaishnav-Sabari-Girish: Better installation instructions
- Noirbizzarre: Added installation instructions using uv and pipx
- Fwtwoo: readme update
- Joeliscoding: Added homebrew formula and fixed readme
GPL-2.0