5 CLI Utilities to Boost Your Productivity
Tags: productivity, tips, unix, commandline
Published: 2019-05-07 13:43:51

---
title: 5 CLI Utilities to Boost Your Productivity
published: true
description: A showcase of the fx, http-prompt, fselect, ranger, and tokei CLI tools!
tags: productivity, tips, unix, command line
cover_image: https://thepracticaldev.s3.amazonaws.com/i/94jcs9eieixdjall0d2b.png
series: Power Up Your Command Line
---

Here are 5 command line tools I've found recently which can speed up your workflow.

## `fx`, a command-line JSON processing tool

`fx` ([GitHub](https://github.com/antonmedv/fx)) is a CLI tool written in JavaScript which allows you to process JSON using your terminal.

![fx](https://thepracticaldev.s3.amazonaws.com/i/xib6bmqvh44347z7nv6f.gif)

You can explore and modify JSON using small snippets of plain JavaScript, and use your cursor to dive into the structure. For all of the functionality offered by `fx`, check out the [documentation](https://github.com/antonmedv/fx/blob/master/DOCS.md).

### Installing `fx`

* `brew install fx`

## `http-prompt`, for interacting with APIs

`http-prompt` ([website](http://http-prompt.com/)) is useful for exploring and interacting with HTTP APIs. It comes with autocomplete and syntax highlighting.

![http-prompt](https://thepracticaldev.s3.amazonaws.com/i/fr1nejgr4ugiwfjbcyw3.gif)

`http-prompt` is written in Python, and builds on top of [HTTPie](https://httpie.org/), which was covered earlier in this series.

### Installing `http-prompt`

* `pip install --user http-prompt`

## `fselect`, for querying files with an SQL-like syntax

`fselect` ([GitHub](https://github.com/jhspetersson/fselect)) is an alternative way to search your filesystem. It lets you use a syntax similar to SQL to find what you're looking for. For example, to find the size and path of all `.cfg` and `.tmp` files in `/home/user/`:

`fselect size, path from /home/user where name = '*.cfg' or name = '*.tmp'`

`fselect` also supports aggregation functions, similar to those you find in SQL:

`fselect "MIN(size), MAX(size), AVG(size), SUM(size), COUNT(*) from /home/user/Downloads"`

The query above will find the smallest file size, the largest file size, the average file size, the total file size, and the number of files present in your `Downloads` folder.

`fselect` is written in Rust, and it can do much more than the examples above suggest. It has extensive [documentation](https://github.com/jhspetersson/fselect).

### Installing `fselect`

* `brew install fselect`

## `ranger`, a command-line file manager

`ranger` ([GitHub](https://github.com/ranger/ranger)) is a command-line file manager written in Python that lets you browse and manipulate your file system using Vim like keybindings.

![ranger](https://thepracticaldev.s3.amazonaws.com/i/h5ng3h3obd2vekxen6s4.png)

It offers a multi-column display, the ability to preview files, and lets you perform common file operations (such as creation, deletion, chmod, copying, etc.) from within the ranger interface.

You can extend `ranger` by installing some Python packages which allow it to preview images, HTML documents, and PDF files. The image below is an example posted on the [gallery](https://ranger.github.io/screenshots.html) available on the Ranger website, showing the image previewing functionality in action.

![ranger-screen](https://thepracticaldev.s3.amazonaws.com/i/p8a57yo2wruw0r2sluo4.png)

Ranger is a deep piece of software with countless features that don't fit within the scope of this post. More information can be found in the [official user guide](https://github.com/ranger/ranger/wiki/Official-user-guide).

### Installing `ranger`

* `brew install ranger`

## `tokei`, to view statistics on your code

`tokei` ([GitHub](https://github.com/XAMPPRocky/tokei)) lets you view code statistics for your projects by breaking down the languages you've used. It's written in Rust, which helps make it [very fast](https://github.com/XAMPPRocky/tokei/blob/master/COMPARISON.md).

Here's some example output from running `tokei` in my [Advent of Code](https://adventofcode.com/) folder:

```
-------------------------------------------------------------------------------
 Language            Files        Lines         Code     Comments       Blanks
-------------------------------------------------------------------------------
 Markdown                1          165          165            0            0
 Rust                   13         1071          854           51          166
 Plain Text             17         4032         4032            0            0
 TOML                    1           11           10            0            1
-------------------------------------------------------------------------------
 Total                  32         5279         5061           51          167
-------------------------------------------------------------------------------
```

### Installing `tokei`

* `brew install tokei`


## Conclusion
Thanks for reading! Hopefully, you found something on this page that interests you. If you’re interested in more content like this, follow me on [Twitter](https://twitter.com/_darrenburns) and on [DEV](https://dev.to/_darrenburns)!