DEV Community

loading...
Cover image for 5 Handy CLI Tools to Spice up Your Terminal

5 Handy CLI Tools to Spice up Your Terminal

Elena Lape
APIs, Open Source and power snatches.
Updated on ・4 min read

The Command Line.

A developer's best mate, and also one of the main sources of our frustration (it's esc, then :q to quit Vim, by the way).

Regardless of its social status, there are plenty of great CLI tools that can make quite a difference in the overall terminal experience.

Here are some of my favourites, in no particular order. Some are tools that I use every day in my work, and others are just fun apps to try if you get bored of a GUI.

Shall we?

1. Oh-My-Zsh

oh-my-zsh screenshot with wedisagree theme

Oh-My-Zsh is a framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, and themes.

In short — Oh-My-Zsh makes the terminal less intimidating by bringing some colour and autocompletion to tools like Git and Docker, as well as plenty of package managers and other popular command line utilities.

# To install
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# To configure your plugins, themes, aliases etc.
$ vi ~/.zshrc
Enter fullscreen mode Exit fullscreen mode

Admittedly, my favourite part is that there are lots of different themes to choose from — my favourite is wedisagree.

Note that Oh-My-Zsh is for the ZSH/Z-Shell (not bash or any other), so make sure you’ve got ZSH going first.

2. HTTPie

HTTPie in the terminal

Ever wanted to make a request to an API or a website, without having to pull out an arsenal of devtools?

Say no more — HTTPie is here to save the day.

HTTPie is a CLI HTTP client that comes with colourised output (that goes fashionably well with Oh-My-Zsh's wedisagree), really intuitive syntax, and a number of other features to make testing and debugging APIs as simple as it gets.

# To install with brew
$ brew install httpie

# To make a request
$ http httpie.io/hello
Enter fullscreen mode Exit fullscreen mode

One feature I find particularly handy is the --offline mode, which lets you build and print out a (colourised and formatted) HTTP request without sending it. That way, you can see exactly the stuff the API in question is going to receive.

Check out my recent Getting started with HTTPie guide to learn more.

Full disclosure: I am part of the HTTPie team. However, I have been using it even before I joined!

3. Wttr.in

wttr.in weather forecast preview

Using a command line just for the sake of using a command line?

Sign. me. up.

Wttr.in is a console-based weather report app. Just add your city to the URL, and send a request like so:

# Using HTTPie
$ http wttr.in/london 

# Or, using cURL
$ curl wttr.in/london 
Enter fullscreen mode Exit fullscreen mode

I’ve aliased http wttr.in/London with weather. So now, each time I want to see the weather forecast for London, I am able to simply type weather and save all those precious seconds of having to pick up my phone and navigate to the weather app.

4. Kalk

Kalk calculator preview

Computers have evolved so far ahead from their original purpose, which was to calculate things.

Sure, you can and create some sick beats with your machine, or run Overwatch at one bazillion frames per second.

But something as simple as calculating what grade you need to score in an exam to pass the course is more tricky than it should be. Your default OS calculator is an option, but it's very basic. Google kiiind of does the job, but requires internet connection. So do more advanced tools like Wolfram Alpha.

Kalk is... a CLI for a calculator.

# To install using brew
$ brew tap xoofx/kalk 
$ brew install kalk


# To launch
$ kalk
Enter fullscreen mode Exit fullscreen mode
kalk 0.4.0+3fb73b1 - Copyright (c) 2020-2021 Alexandre Mutel
# Type `help` for more information and at https://github.com/xoofx/kalk

>>> # You can do things such as
>>> x=2; round((54+4)/(4+x))

# x = 2; round((54 + 4) / (4 + x))
x = 2
out = 10
Enter fullscreen mode Exit fullscreen mode

It's simply brilliant both as your regular everyday calculator, and a more advanced one that will solve your equations using the same syntax you'd use in a maths class.

5. Taskwarrior

taskwarrior screenshot from wikipedia.org

It's an open secret that creating to-do lists is peak procrastination, as a queen of procrastination, I'd like to introduce you to one more way to-do it.

Taskwarrior is a nifty tool if you want to keep all your actual to-dos separate from shopping lists and song lyric ideas that you've got sitting in your note taking app.

# To install with brew
$ brew install taskd

# To create a new task (it will prompt you to create a ~/.taskrc file upon the first run; select yes
$ task add 'Write a dev.to article about CLI tools'

# To view all pending tasks
$ task

# To mark task as complete
$ task <task_id> done
Enter fullscreen mode Exit fullscreen mode

You can also annotate, set a priority level or a by-date to individual tasks or their groups.

Taskwarrior's 30 second tutorial has got everything you need to get started.


Do you have any favourite CLI tools you'd like to share? Please let me know if you give any of the ones listed above a try!

I'm going to go finish that burning task now.

Unless the weather is too nice for it.

Discussion (2)

Collapse
timoxley profile image
Tim Kevin Oxley

FYI kalk doesn't seem to be in brew anymore:

> brew install kalk
Warning: No available formula or cask with the name "kalk". Did you mean kalker?
Enter fullscreen mode Exit fullscreen mode

kalker is a different tool, but does seem to do something similar.

Collapse
elenalape profile image
Elena Lape Author

Good catch! This is the correct way to install it:

$ brew tap xoofx/kalk 
$ brew install kalk
Enter fullscreen mode Exit fullscreen mode