7 Awesome Rust-powered Command-line Utilities | by Shinichi Okada | Towards Data Science

Table of ContentsIntroduction🦀 Starship🦀 ripgrep🦀 bat🦀 tokei🦀 exa🦀 fd🦀 procs🦀 How I found themConclusion
The Rust programming language has been Stack Overflow’s most loved language for four years in a row.
Rust is largely viewed as an alternative to other systems programming languages, like C or C++.
That’s why many talented developers including Benjamin Sago and Andrew Gallant created excellent Rust-powered command-line utilities.
In this article, you will find the top seven command-line utilities you can start using today.
Starship is the minimal, blazing-fast, and infinitely customizable prompt for any shell.
To install with homebrew run:
brew install starship
For more details on how to install the Starship, please read about the Starship in this article.
And add the init script to your shell’s config file:
# ~/.zshrceval "$(starship init zsh)"
You can find other installations from here.
A super-fast search tool that recursively searches directories for a regex pattern. ripgrep supports Windows, macOS, and Linux and it is a modern replacement for grep.
You can install ripgrep:
# macOS Homebrew/Linuxbrew$ brew install ripgrep# MacPorts$ sudo port install ripgrep# Windows Chocolatey$ choco install ripgrep# Windows Scoop$ scoop install ripgrep
You can find other installations here.
MS's VS code uses a ripgre-powered search. It also ignores hidden and binary files by default.
bat is a cat clone with syntax highlighting and Git integration. bat is written in Rust and woks on Windows/macOS/Linux.
# for macOSbrew install bat
bat supports syntax highlighting for a large number of programming and markup languages:
bat has git integration and shows modifications with respect to the index (see the left sidebar in the above image).
tokei is a program that displays statistics about your code. It is a super-fast replacement for cloc.
tokei shows the number of files, total lines within those files and code, comments, and blanks grouped by language.
tokei is available on Mac, Linux, and Windows. See installation instructions.
exa is a modern replacement for the command-line program ls that ships with Unix and Linux operating systems.
To install with homebrew run:
brew install exa
You can find other installations in this link.
fd is a simple, fast, and user-friendly alternative to find. fd works on Windows/macOS/Linux.
To install with homebrew run:
brew install fd 
For other installations please see this link.
procs is a replacement for ps written in Rust. It creates the tree view and its output is a human-readable format.
You can keyword-search over multi-column. procs works on Windows(experimental)/macOS/Linux.
Please find other installations for your system here.
You can cycle through the headings by pressing n and order in ascending order by pressing a and order in descending order by pressing d.
# for macOSbrew install procs
The website doesn’t allow you to order by # of downloads so you can run this code to stay up to date.
I used BeautifulSoup to scrape the website and used Pandas to create a dataframe on Jupyter Notebook.
Even though lib.rs has its own ranking algorithm, I ordered them by download numbers.
import requestsfrom bs4 import BeautifulSoupimport pandas as pdURL = 'https://lib.rs/command-line-utilities'page = requests.get(URL)soup = BeautifulSoup(page.content, 'html.parser')# find all package namesdivs = soup.select('.h > h4')names=[]for div in divs:    names.append(div.text.strip())# find all package downloadsmetas = soup.select('.meta')downloads=[]for meta in metas:    if(mytitle:=meta.find(class_='downloads')):        parts = str(mytitle).split()[2].split('="')[1]        downloads.append(int(parts))    else:        # some libraries do not have downloads class        downloads.append(0)# create a dataframe using pandasdata_tuples = list(zip(names,downloads))df=pd.DataFrame(data_tuples, columns=['Name','Downloads'])# sort by number of downloadsdf = df.sort_values(by='Downloads', ascending=False)df.head(20)
Result (as of May 5, 2020)
Some packages are for the Rust environment, so I selected packages that everyone can use for a terminal.
There are more Rust-powered command-line utilities that are not on this list. I hope you find these utilities useful.
What are your favorites? Or you are so inspired that you want to start building your own command-line application in Rust.
Get full access to every story on Medium by becoming a member.