onefetch

o2shMIT活跃维护

用 Rust 写的命令行工具,直接在终端里展示 Git 仓库的统计信息,包括语言构成、贡献者、代码行数等,不用打开网页就能快速了解项目概况。

Command-line Git information tool

3.2.0发布于 2026-10-31 12:55 UTC12,086star +6 / 7 天335fork同步于 2026-11-10 11:28 UTC

怎么上手

由 README 提炼,执行前请确认
brew install onefetch
onefetch /path/of/your/repo
硬件要求按 README 说明

README 未说明,仅说明支持 Linux、macOS、Windows 平台

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

在终端离线展示本地 Git 仓库的项目信息与代码统计,注重性能与可定制

用 Rust 写的命令行工具,直接在终端里展示 Git 仓库的统计信息,包括语言构成、贡献者、代码行数等,不用打开网页就能快速了解项目概况。

核心能力

  • 离线读取本地仓库并统计代码行数与语言占比
  • 支持 100 多种编程语言识别
  • 用命令行参数调整文本样式、隐藏信息行、忽略文件目录
  • 支持 JSON、YAML 等多种格式输出
  • 通过 .mailmap 合并重复作者条目

容易踩的坑

默认只显示 programming 和 markup 类语言,prose 与 data 类需用 --type 显式包含;同一作者用不同名字或邮箱提交会重复出现,需在仓库加 .mailmap 合并;各平台安装方式不同,Linux 需按发行版选 deb、pacman 或 zypper

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本3.2.0
  1. 3.2.0最新正式版2026-10-31 · 2026-10-31 12:55 UTC

    What's Changed

    New Features

    Full Changelog: https://github.com/o2sh/onefetch/compare/3.1.0...3.2.0

  2. 3.1.02026-10-18 · 2026-10-18 20:35 UTC
    查看更新说明

    What's Changed

    Bug Fixes

    CI/CD

    Chores

    Full Changelog: https://github.com/o2sh/onefetch/compare/3.0.0...3.1.0

  3. 3.0.02026-10-06 · 2026-10-06 21:12 UTC
    查看更新说明

    What's Changed

    Breaking Changes

    JSON/YAML output (-o json, -o yaml) now contains raw values instead of display text:

    • creationDate and lastChange are always ISO 8601 timestamps ("2018-09-14T18:51:00Z"). Previously they were relative text ("8 years ago") unless --iso-time was passed.
    • repoSize is a number of bytes (2161012) instead of formatted text ("2.06 MiB").
    • dependencies is replaced by numberOfDependencies (number) and manifestType ("Cargo", "Npm", "PyProject", or null when there is no manifest).

    onefetch-manifest crate: ManifestType has a new PyProject variant.

    Security Fix

    New Features

    Bug Fixes

    Chores

    CI / CD

    New Contributors

    Full Changelog: https://github.com/o2sh/onefetch/compare/2.28.1...3.0.0

  4. 2.28.12026-08-30 · 2026-08-30 11:25 UTC
    查看更新说明

    What's Changed

    CI/CD

    • Fix CD pipeline by @o2sh

    Full Changelog: https://github.com/o2sh/onefetch/compare/2.28.0...2.28.1

  5. 2.28.02026-08-30 · 2026-08-30 10:58 UTC
    查看更新说明

    What's Changed

    New Features

    Bug Fixes

    CI/CD

    Chores

    New Contributors

    Full Changelog: https://github.com/o2sh/onefetch/compare/2.27.1...2.28.0

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Onefetch - Command-line Git information tool

    Crates.io Version GitHub Actions Workflow Status MSRV


    Onefetch is a command-line Git information tool that displays project information and code statistics for a local Git repository directly in your terminal. The tool works completely offline with a focus on performance and customizability.

    Screenshot 1Screenshot 2

    Installation

    Onefetch is available on Linux, macOS, and Windows platforms. Binaries for Linux, Windows, and macOS are available on the release page.

    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
    

    Usage

    onefetch /path/of/your/repo
    

    Or

    cd /path/of/your/repo
    onefetch
    

    Customization

    Onefetch can be customized via command-line arguments to display exactly what you want, the way you want it: adjust the text styling, disable info lines, ignore files and directories, output in multiple formats (JSON, YAML), etc.

    Frequently Asked Questions

    Why isn't my language detected?

    By default, onefetch only displays programming and markup languages. Languages classified as prose (like Org mode, Markdown, or Text) or data (like JSON, YAML, or TOML) are hidden unless you include them with --type.

    onefetch --type programming markup prose data
    

    Why do duplicate authors appear?

    Onefetch reads authors from the Git history. If the same person committed with different names or emails, they may appear more than once.

    To merge those entries, add a .mailmap file to the repository.

    Contributing

    Currently, onefetch supports more than 100 different programming languages; if your language of choice isn't supported, open an issue and support will be added.

    Contributions are very welcome! See CONTRIBUTING for more info.