The Wayback Machine - https://web.archive.org/web/20240808225738/https://www.geeksforgeeks.org/top-cli-tools/
Open In App

10 CLI Tools Every Developer Should Know in 2024

Last Updated : 22 Apr, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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?

CLI Tools Every Developer Should Know

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:

  • Plugins – Oh my Zsh comes bundled with plugins that can be used for git integration, autocompletion, managing workflows etc. It comes with the git plugin enabled by default.
  • Themes – Oh My Zsh comes with a large option of themes to make your terminal more customizable and visually appealing.
  • Community – Oh my Zsh has a large community base that improves user experience and ensures good growth of the tool.

Installation

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

  • Using curl
​​sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • Using wget
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • Using fetch
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.

  • Using curl
sh -c "$(curl -fsSL https://install.ohmyz.sh/)"
  • Using wget
sh -c "$(wget -O- https://install.ohmyz.sh/)"
  • Using fetch
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.

  • Using Node JS client
npm install -g tldr
  • Using Python client
pip3 install tldr
  • Using Rust client for Linux and Mac users
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.

  • For Ubuntu, WSL and derivatives
sudo apt-get install tmux
  • For Mac
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.

  • Searching a command in history by number.
!n 
-- It replays the nth command from the history file.
!-n
It replays the nth command from the latest command in history.
  • Searching specific commands by string
!<string>

It replays the last command starting with the specified string.

  • Manipulating old commands.
!!:s^<old>^<new>

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

  • Print commands.
!: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

  • Navigation to the highest-ranked directory matching the yellow
z yellow
  • Navigation to the highest-ranked directory matching yellow and blue
z yellow blue
  • Navigation to the subdirectory matching yellow
z yellow /
  • Navigate one level up
z .. 
  • Navigate to the previous directory
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.

  • For MacOS
brew install ngrok/ngrok/ngrok
  • For Debian Linux
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
  • For Windows
choco install ngrok
  • Connecting your ngrok agent to your ngrok account
ngrok config add-authtoken <TOKEN>
  • Creating a public URL for your app
ngrok http http://localhost:8080
  • Creating a static domain
ngrok http 8080 --domain static-domain-name.ngrok-free.app
  • Adding authentication to the application
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

  • GET request
http GET <link to api resource to make request>
  • POST request
http POST <link to api resource to make request> <JSON data>
  • Saving response to a file
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

  • Linux/macOS: Using package managers to install jq.
  • Windows: Downloading pre-compiled binaries from the official jq website https://github.com/jqlang/jq.

Usage

  • Filtering JSON data

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

cat data.json | jq '.sample'
  • Selecting multiple keys

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

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

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-

  • Clone the auto jump repository.
git clone git://github.com/wting/autojump.git
  • Run the installation script.
cd autojump
./install.py or ./uninstall.py

Automatic Installation-

  • OS X
brew install autojump

or

port install autojump
  • Windows

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

  • Linux

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-

  • Open the terminal in the desired directory you want to serve files.
  • Run the command python3 -m http.server 8080.

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.



    Similar Reads

    Top 10 AR Developer Tools Every Developer Should Know
    The booming Augmented Reality (AR) world involves the creation of immersive digital experiences that mix up with physical reality. As a developer, it is upon you to unlock and utilize this potential through creating inventive AR applications. However, with numerous AR development tools available; selecting one may become overwhelming. This in-depth
    9 min read
    Top 10 Tools That Every Java Developer Should Know
    Hey there, Java lovers! If you're someone who enjoys coding in Java or you're just starting out, you probably know that having the right tools can make a big difference. In this article, we're going to talk about 10 tools that every Java developer should know about. Whether you're new to Java or a pro, these tools will help you write better code, f
    15+ min read
    8 Best Android Libraries That Every Android Developer Should Know
    Android is an operating system which is built basically for Mobile phones. It is used for touchscreen mobile devices like smartphones and tablets. But nowadays these are utilized in Android Auto cars, TV, watches, camera, etc. Android has been one of the best-selling OS for smartphones. Android OS was developed by Android Inc. which Google bought i
    5 min read
    Simple and Concise Git Commands That Every Software Developer Should know
    As developer git is the most useful arena which is not operated directly so do we have git commands that become very crucial that one should know after having git installed in the local system. if not you must download git from here Download Git. If you need any help with the further installation process. So, Now let's start with the basic commands
    4 min read
    Top 10 Libraries Every Java Developer Should Know
    Now more than maybe ever, businesses, corporations, students, developers alike are aware of the omnipresence of IT and branches of IT including programming, and software development. Software Engineers and IT professionals are some of the highest-paid professionals. That being said it is also a profession that keeps evolving to keep up with these u
    6 min read
    7 Kotlin Extensions That Every Android Developer Should Know
    Kotlin is a programming language designed specifically for Android and JVM i.e. Java Virtual Machine. The language is quite popular among developers and you need to know that Google has already declared Kotlin as the preferred language for Android application development. There are various Kotlin extensions also available that empower Android devel
    5 min read
    Top 10 JavaScript Fundamentals That Every Developer Should Know
    Javascript is an object-oriented language that is lightweight and used for web development, web applications, game development, etc. It enables dynamic interactivity on static web pages, which cannot be done with HTML, and CSS only. Javascript is so vast that even mid-level professionals find it difficult to work and that might be possible because
    8 min read
    10 JavaScript DOM Tips and Tricks That Every Developer Should Know
    The DOM stands for ‘Document Object Model’, it’s a programming interface for HTML (Hypertext Markup Language) and XML (Extensible Markup Language) documents. DOM represents the structure of a document which means a hierarchical tree-like structure, where each existing element in the document are represented as a node in the tree. It also provides p
    13 min read
    Top 10 Django Packages Every Developer Should Know
    Python is one of the most popular languages for web development nowadays. It has various frameworks like Django, Flask, Hug, CherryPy, and Bottle that help developers write web applications in Python. Among all the frameworks Django is the most used framework to create websites in Python. Django is an open-source and free-to-use full-stack web fram
    9 min read
    Top 10 Microservices Patterns That Every Developer Should Know
    Hello tech lovers! Are you curious about what microservices are? Microservices have emerged as a crucial architectural approach that offers numerous benefits, such as scalability, flexibility, and resilience. Microservices are an integral part of modern application development, and every developer should be well-versed in their fundamental concepts
    10 min read
    Article Tags :
    three90RightbarBannerImg