Noureddine RAMDI / Onefetch: A fast, offline Git repository information tool in Rust

Created Sat, 23 May 2026 20:41:14 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

o2sh/onefetch

Onefetch is a command-line tool that displays detailed information and code statistics about a local Git repository directly in your terminal — all without needing an internet connection. It stands out by supporting over 100 programming languages and delivering results quickly thanks to its Rust implementation. This makes it a handy tool for developers who want instant insights about their projects without relying on external services.

What onefetch does and how it works

Onefetch is designed to analyze a Git repository on your local machine and output useful metrics about the project. It extracts information such as the repository’s name, description, author, license, and the languages used, along with statistics like lines of code, number of files, and commits.

The tool is written in Rust, which ensures high performance and low resource consumption. It works offline, so it doesn’t depend on GitHub APIs or internet connectivity. This is particularly useful for private repos or environments with limited network access.

Its architecture centers around parsing the local .git directory to gather metadata and scanning the repository files to detect languages and count lines of code. The language detection supports more than 100 programming languages, which is a broad coverage uncommon in similar tools.

Onefetch outputs data in various formats: by default, it displays a colored, human-readable summary in the terminal. For integration with other tools or scripts, it can emit JSON or YAML.

The tool runs on Linux, macOS, and Windows, making it cross-platform with consistent behavior across environments.

Why onefetch is technically interesting

The core technical strength lies in its balance between speed, accuracy, and multi-language support. Implementing language detection for over 100 languages and computing statistics without external dependencies requires efficient parsing and file handling.

Under the hood, onefetch uses Rust’s performance characteristics to scan files quickly and manage memory safely. The codebase reflects a clear separation of concerns: Git metadata extraction, language detection, statistics calculation, and output formatting are modularized.

The language detection engine is particularly noteworthy. It likely relies on file extensions and heuristics to classify files, which is faster than full syntax parsing yet accurate enough for statistics purposes. This tradeoff favors speed over deep semantic analysis, which fits the tool’s use case of quick insights rather than deep code analysis.

Another design choice is the offline-first approach. Unlike tools that query remote APIs (like GitHub’s), onefetch processes everything locally, which avoids API rate limits and privacy concerns.

The code quality is good, with idiomatic Rust practices and clear documentation. The project also embraces customizable CLI options allowing users to tailor output verbosity, formats, and which stats to display.

Installation and quick start

Onefetch provides pre-built binaries for major platforms, easing installation. Here are the official commands from the repository’s README:

Linux

  • Ubuntu
wget https://github.com/o2sh/onefetch/releases/latest/download/onefetch_amd64.deb && sudo dpkg -i ./onefetch_amd64.deb && rm onefetch_amd64.deb
  • Arch Linux
pacman -S onefetch
  • openSUSE
zypper install onefetch

macOS

brew install onefetch

Windows

winget install onefetch

After installing, just run onefetch in the root of any Git repository. It will output the project stats directly in your terminal.

Verdict

Onefetch is a solid choice if you want a fast, offline way to get Git project information and code statistics across a wide range of languages. Its Rust implementation ensures performance without much resource overhead.

The tradeoff is that it focuses on summary statistics and language detection by heuristics rather than deep code analysis or integration with online services. If you need richer metrics or deep code insights, other tools might be better suited.

For developers who work with multiple languages or private repositories and value quick terminal summaries, onefetch serves well. Its cross-platform support and customizable output make it practical for scripting and automation.

Limitations include an inherent tradeoff in language detection accuracy due to reliance on file extensions and heuristics. Also, since it only analyzes local Git repos, it won’t provide networked insights like pull request stats or GitHub-specific metadata.

Overall, it’s a pragmatic tool that fits nicely into many developer workflows without fuss or dependencies beyond Rust’s efficient runtime environment.


→ GitHub Repo: o2sh/onefetch ⭐ 11,796 · Rust