How to See Beautiful Git Project Stats in Your Terminal


Key Takeaways

  • Onefetch provides code stats for git projects with ASCII art and detailed project info.
  • It can be easily downloaded for Linux, macOS, and Windows.
  • You can hide ASCII art and customize output fields to suit your preferences.



You may already know that checking a project’s status before you clone it with git is a good idea, but did you know there’s a convenient and attractive way of showing those stats right in your terminal? Meet Onefetch.


What Is Onefetch?

Neofetch may have been discontinued, but it still inspires imitators and similar tools. Onefetch is a project summarizer, featuring ASCII art, a language breakdown, contributor info, and other details. Here’s an example showing onefetch running against its own repository:

The onefetch program showing a summary of the onefetch git repository.

The tool works with any git repository and generates output consisting of two parts:


  • On the left, you’ll see an ASCII art representation of the project’s main programming language.
  • On the right, you’ll see details about the project including how many branches and tags it has, who its main authors are, and how many lines of code it contains.

How Do I Use Onefetch?

You can download a binary from Onefetch’s releases page for Linux, macOS, and Windows. There are also packages for various managers including Homebrew, pacman, and snap. Check out the full installation page for more details.

Basic Use of Onefetch

Once you’ve installed it, run onefetch directly from a repository’s root directory:

cd /path/to/repository
onefetch

Or by passing a repository path to the command:

onefetch /path/to/repository 
The onefetch program showing summary stats for an httpserver project written in C.

Onefetch makes heavy use of color-coded output, so you won’t get good results piping it to other commands or redirecting it to a file.


Advanced Use of Onefetch

If you’re not a fan of the ASCII art that renders the main logo, you can hide it altogether with the –no-art option:

onefetch --no-art 
The onefetch program showing statistics for the zed project without a logo.

There are some other nice visual settings you can use to tweak the output, including:

  • –no-color-palette to turn off the color palette that appears at the bottom
  • –nerd-fonts which produces nice icons alongside the languages
  • –no-title to hide the first line

In addition, you can configure the length of certain fields, like Authors, and turn off any that you don’t want to see using -d. Here’s a Go project with a heavily customized summary using the following command:


onefetch -d head license last-change churn version commits contributors url \
   --nerd-fonts --no-title --number-of-languages 10 --number-of-authors 10
Output from the onefetch command showing custom stats for a git project.


Onefetch is a simple command that’s easy to install and use. It’s great to showcase your own projects or to quickly remind yourself what that project lingering on your hard drive is all about.



Source link

Previous articleCardano and the XRP price action lock in bulls vs bears battle as RCO Finance prepares for 3,000% surge