Introduction
Onefetch is a command-line Git information tool that generates a visual summary of a repository, similar to neofetch for system info. It displays the dominant language with ASCII art, repo metadata, contributor counts, license, and code statistics in a colorful terminal-friendly format.
What Onefetch Does
- Displays repository metadata including name, description, HEAD, version, creation date, and license
- Shows language distribution as a color-coded bar chart with percentages
- Renders ASCII art logos for the dominant programming language of the project
- Reports contributor count, commit statistics, lines of code, and repository size
- Outputs data in multiple formats including terminal display, JSON, and YAML for scripting
Architecture Overview
Onefetch is written in Rust for fast execution. It reads Git objects directly from the .git directory to extract commit history and metadata without spawning external processes. Language detection uses the linguist grammar definitions. ASCII art is embedded for over 100 programming languages. The tool is entirely local and offline — no network requests are made.
Self-Hosting & Configuration
- No configuration file needed — all options are passed as CLI flags
- Exclude specific languages or file patterns with
--excludefor accurate statistics - Custom ASCII art can be provided via
--ascii-inputfrom a file or stdin - Image mode (
--image) renders the repo logo in terminals supporting image protocols - Include or hide specific info fields with
--showand--hideflags
Key Features
- Over 100 language ASCII art logos with automatic detection of the repository's primary language
- Zero network dependency — all analysis is performed locally from Git objects
- Churn statistics showing the most actively modified files in the repository
- Integration with terminal image protocols (Kitty, iTerm2, Sixel) for graphical logos
- Nerd Font icon mode for compact display in supported terminal configurations
Comparison with Similar Tools
- neofetch/fastfetch — display system information; Onefetch focuses on Git repository information
- tokei — counts lines of code but without repo metadata, ASCII art, or contributor stats
- git-summary — basic shell script summary; Onefetch provides richer visual output and more metrics
- cloc — code line counter without Git integration or visual presentation
FAQ
Q: Does Onefetch work with any Git repository? A: Yes. It works with any valid Git repository regardless of hosting provider or language.
Q: Can I use Onefetch in CI/CD pipelines?
A: Yes. Use --output json or --output yaml for machine-readable output suitable for automated reporting.
Q: How accurate is the language detection? A: It uses the same linguist grammars as GitHub, so results closely match what GitHub displays for your repository.
Q: Does it count lines of code in dependencies?
A: By default it respects .gitignore. You can further exclude paths with --exclude to skip vendor directories.