Open In App

10 CLI Tools Every Developer Should Know in 2024

Consider a software development team working on a web application. The process of building an application involves assistance with various tasks like version control, package management, automation, build, containerization, server management, debugging, etc. Each of these tasks can be done with their respective graphical user interface but going to various tools for each feature is a tedious task. What if everything can be done in a single place?



This is possible with CLI or Command-Line Interface. It is a text-based interface used for interacting with computer systems and programs by typing commands into a terminal or command prompt. Thus, using CLI, developers can achieve efficiency and remote access easily. In this article, we’ll discuss various trending CLI Tools.

10 CLI Tools Every Developer Should Know in 2024

Following is a list of trending CLI tools in 2024.



1. Oh my Zsh

Oh my Zsh is an open-source framework for managing Zsh configuration. Thus, it elevates your normal and boring Zsh experience. It provides the following main features:

Installation

Oh my Zsh can be installed in the terminal using the following commands.

​​sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

For areas where raw.githubusercontent.com is blocked, the following can be used.

sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
sh -c "$(wget -O- https://install.ohmyz.sh/)"
sh -c "$(fetch -o - https://install.ohmyz.sh/)"

2. Tldr

Tldr is an internet slang that stands for Too Long; Didn’t Read. It is a collection of community-maintained help pages that give simpler help pages for command line tools instead of traditional man pages. It is a growing collection covering UNIX, Linux, macOS, SunOS, Android and Windows command-line tools. It provides concise and practical information about the tools like descriptions, options and examples. It can be accessed through Node JS, Python and Rust Client.

Installation

Tldr pages can be installed using the following commands.

npm install -g tldr
pip3 install tldr
brew install tldr

Now since tldr is installed, you can get help pages about commands like grep, tar etc using tldr grep or tldr tar instead of man grep or man tar.

3. Tmux

Tmux is a terminal multiplexer. Using tmux you can create, navigate and control multiple terminals within a single screen. Each terminal has its shell instance running independently. It provides a powerful feature of detachment and reattachment where your progress is stored whenever you detach from the tmux window.

Installation

Tmux can be installed using the following commands.

sudo apt-get install tmux
Brew install tmux

4. !(Bang)

The value of the HITSIZE variable defines the total number of commands that will be stored in your terminal history. The Bang command uses this history of your terminal to help you efficiently repeat commands, and fix typos in commands which is very daunting work in the case of long commands. This is the scenario where bang comes into the picture.

Commands

$ cat hello.txt
Hey there!
$ !!
cat hello.txt
Hey there!

!! can also be used to fix sudo.

!n 
-- It replays the nth command from the history file.
!-n
It replays the nth command from the latest command in history.
!<string>

It replays the last command starting with the specified string.

!!:s^<old>^<new>

It replays the last command by replacing the old with the new.

!:p

It prints the last command used but does not execute it.

5. Zoxide

Zoxide is an alternative to the cd command. It offers faster performance and smart navigation capabilities. It keeps track of the directories you visit and provides quick access to them.

Usage

z yellow
z yellow blue
z yellow /
z .. 
z -

6. Ngrok

Ngrok allows users to host their web servers on the internet securely and easily. It proves to be a very useful tool during development where you can share the progress of your project on a local host with various stakeholders.

Installation

Ngrok can be installed using the following commands.

brew install ngrok/ngrok/ngrok
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | \
sudo gpg --dearmor -o /etc/apt/keyrings/ngrok.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/ngrok.gpg] https://ngrok-agent.s3.amazonaws.com buster main" | \
sudo tee /etc/apt/sources.list.d/ngrok.list && \
sudo apt update && sudo apt install ngrok
choco install ngrok
ngrok config add-authtoken <TOKEN>
ngrok http http://localhost:8080
ngrok http 8080 --domain static-domain-name.ngrok-free.app
ngrok http http://localhost:8080 --oauth=google --oauth-allow-email=name@example.com

This command gives access to only name@example.com

7. Httpie

Httpie is a command line HTTP client used to make HTTPS requests and interact with web services. It is better than curl due to a simpler and more expressive syntax, colourful output, and smart defaults.

Usage

http GET <link to api resource to make request>
http POST <link to api resource to make request> <JSON data>
http GET <link to api resource to make request> > response.json

8. Jq

jq is a lightweight and flexible command-line JSON processor written in portable C akin to sed, awk, grep, and friends for JSON data. It allows easy mapping, filtering, slicing and transforming structured data due to zero run-time dependencies.

Installation

Usage

Value of the key named ‘sample’ from the JSON data in the data.json file.

cat data.json | jq '.sample'

A new JSON object is created from the various keys mentioned.

cat data.json | jq '{ key1: .sample1, key2: .sample2 }'

Update the value of key ‘sample’ to ‘new_sample’.

cat data.json | jq '.sample = "new_sample"'

9. Autojump

Autojump is a command-line utility designed to easily navigate through your file system based on the user habits and the insights drawn through these insights by the tool. This tool helps you to easily navigate to a file or directory far away from your present working directory without typing out the entire path to the destination.

Installation

Manual Installation-

git clone git://github.com/wting/autojump.git
cd autojump
./install.py or ./uninstall.py

Automatic Installation-

brew install autojump

or

port install autojump

Clink should be installed to enable auto jump support on Windows.

Autojump is included in the following distro repositories, Debian, Ubuntu, Linux Mint, RedHat, Fedora, CentOS, ArchLinux, Gentoo, Frugalware and Slackware.

10. Python3 -m http.server 8080

Python3 -m http.server 8080 is used to start a simple HTTP server in Python3. The -m flag in the command is used to tell Python to run a built-in module as a script. On execution of this command, a basic web server is started in the current working directory and all the files and folders are accessible over the web. This tool is useful whenever you want to share files from your local machine over the network.

Following are the steps you need to follow to serve your directory-

To access the server, navigate to http://localhost:8080 to see all the listings of the directory specified in the above step.

Must Read:

Conclusion

The command line offers a powerful and efficient toolkit for developers. This article explored essential CLI tools in 2024, from customizing your shell and simplifying help pages to navigating directories, managing sessions, and interacting with APIs and web services. Mastering these tools will enhance your workflow and unlock a world of possibilities for development efficiency. Dive deeper into each tool’s documentation and tutorials to become a true terminal pro.


Article Tags :