Rustifying my terminal
Tags: rust, opensource
Published: 2022-01-11 13:27:52

Photo by <a href="https://unsplash.com/@davidboca?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">David Boca</a> on <a href="https://unsplash.com/s/photos/rust?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
  
Rust has been one of my favorites for around 3 years now. A lot of people started to write CLI tools that either replace or enhance on the experience that your favorites like `sed` or `ls` provide.

This post is a short introduction to which CLIs I have installed and can recommend!

## [bat](https://github.com/sharkdp/bat)

Probably one of the more known ones, `bat` is an enhanced version of `cat` that supports syntax highlighting out of the box.


![Image showing the output of running `bat thefuck/conf.py` inside of thefuck's repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd5gvrowtxv3hb863omz.png)

## [exa](https://github.com/ogham/exa)

`exa` is a modern replacement for `ls`. It supports colored output, icons and has builtin support for git. It can show you the status of your files inside your repository and even use your `.gitignore` file to hide content. `exa` comes with better defaults and installing it is easy, since it's a single binary available for Linux, macOS and Windows.

![Image showing the output of running `exa -lbF --git --icons` inside of thefuck's repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cyjihblav42vbhs0c2as.png)

## [ripgrep](https://github.com/BurntSushi/ripgrep)

`ripgrep` is a more powerful and user-friendly alternative to tools like `grep`. It does a recursive search on your current directory and finds all occurances of a given string or regex. It comes with a lot of CLI flags that you can use to tailor your search and provides nicer output using colors.

![Image showing an the output when running `ripgrep xdg` iside of thefuck's repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfun4u8qjxmu6655f4py.png)

## [tokei](https://github.com/XAMPPRocky/tokei)

`tokei` does one thing and it does it good: counting the lines of code inside a given project!

![Image shows the output when running `tokei` inside of thefuck's repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/onm7tj4ls0565xj1vyye.png)

## [zoxide](https://github.com/ajeetdsouza/zoxide)

`zoxide` remembers the folders you `cd` into and allows you to fuzzy match onto them. The tool creates a ranking of the directories you visit, sorting them by the number of visits in descending order. When doing a fuzzy match, it chooses the directory with the highest match. The only caviat is that you have to use the `z` command instead of `cd`. But what are aliases for? :shrug:.

For example, my NixOS configuration is inside a folder called `nixos-config`. It's the only folder I visited that contais `os`. I can instantly switch to the folder by typing `z os`.

## Notable mentions

Although I do not use the following CLIs that often, I still wanted to mention them:

- [delta](https://github.com/dandavison/delta), a sane version of `git --diff`.
- [dust](https://github.com/bootandy/dust), a CLI to help you find those folders that bloat your filesystem.

There are a lot more cool CLIs out there, but these are the ones I do recommend and use frequently! If you happen to use other tools, let me know in the comments!