DEV Community

Cover image for 15 Command Line Tools which Spark Joy in Your Terminal

15 Command Line Tools which Spark Joy in Your Terminal

Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard on May 06, 2021

Put joy and productivity inside your Terminal with those cool command line tools. But before we start, let's cover how you can install and uninsta...
Collapse
 
bravoecho profile image
B.E.

TUI file managers such as nnn (github.com/jarun/nnn, minimalistic, my favourite) or lf (github.com/gokcehan/lf/, a more interactive one)

delta, more limited than lazygit, focused on just diffs, but it does it really really well, and can be a nice complement (github.com/dandavison/delta)

glow terminal markdown renderer (github.com/charmbracelet/glow): some might think this is superfluous, because markdown is supposed to be meaningfully readable as plain text, but I often find poorly formatted files, sometimes "augmented" with a lot of inline HTML, to the point of becoming impossible to parse for the human eye

Collapse
 
vonheikemen profile image
Heiker

Speaking of creating your own cli tools. I would like to share something cool: a scripting language called ABS.

This is why I think is cool.

  • It has a C-like syntax.
  • You can call external commands and handle the result in a convenient way.
  • It has a module system.
  • It has a builtin tool that allows you to create cli tools.

Here is a little snippet.

tz = `cat /etc/timezone`

if !tz.ok {
  echo("Ooops, something went wrong")
  exit(1)
}

continent, city = tz.split("/")

echo("Best city in the world?")

selection = stdin()

if selection == city {
  echo("You might be biased...")
} else {
  echo("Yes, ${selection} is awesome.")
}
Enter fullscreen mode Exit fullscreen mode

I wrote about this language a few years ago, here is the post if anyone is interested.

I like this a lot because it allows people who are familiar with a languages like javascript or PHP (that would be me) to write shell scripts in a way that feels comfortable.

Collapse
 
pieter profile image
Pieter D

If bat looks appealing to you and you happen to be a Vim user, you might want to consider running view /path/to/file instead of bat. It'll open any file as readonly in Vim, with all your favorite plugins like Git integration present. Instead of piping to | less, you could also pipe to | view -. You may have to enter something like :set syntax=json if the syntax isn't autodetected based on content, although there's probably a simple setting or plugin to enable autodetection.

If you're not a Vim user and you want something that works with zero configuration, bat seems like a good choice!

Collapse
 
bravoecho profile image
B.E.

jump (github.com/gsamokovarov/jump) is in my opinion a better alternative to autojump

I personally prefer jump because it's actively maintained, but especially because – like all modern tools listed here – it's a standalone executable that does not require Python

it works really well, the author says it can "read his mind" and I tend to agree πŸ™‚

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

Thanks, I've added the suggestion!

Collapse
 
dazfuller profile image
Darren Fuller

I’m using ripgrep and bat daily, and they make everything just that much better.

Another tool I’m using a lot is Just. I might have processes which need a number of steps, or building a project with a lot of arguments. I can abstract it all away and use something like β€œjust build” instead.

github.com/casey/just

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

I started using just in my own project, thanks, it's nice!

github.com/jmfayard/refreshVersion...

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

thanks, I've added the suggestion

Collapse
 
siddharthshyniben profile image
Siddharth

Hey! I made this CLI tool called fcd which replaces the cd command. It basically searches for wherever you are trying to cd and then copies the appropriate cd command to your clipboard.

GitHub logo SiddharthShyniben / fcd

Faster cd-ing.

Contributors Forks Downloads Stargazers Issues MIT License


>_

fcd

Better cding for macOS
Explore the docs Β»

Report Bug Β· Request Feature

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Documentation
  5. Roadmap
  6. Contributing
  7. License
  8. Contact

About The Project

Please star this repo if you found this tool useful 🌟

fcd Screen Shot

fcd is a utility which helps you cd faster on macOS.

Ever had to type out a long cd ~/Sites/Projects/project, find out the path is wrong, rewrite it to cd ~/Sites/Sandbox/project? You just wasted a minute or two. This inspired me to create this tool: fcd.

fcd automatically reads the dirname and the basename of the input and searches for any folder with basename as the name in the dirname folder (Basically, if you input "some/where/else", the program returns the path to "some/where/**/else"). Once it finishes:

  • If there is more than one folder named basename, it gives you…
Collapse
 
siddharthshyniben profile image
Siddharth

I wanted to implement autojump like functionality ever since I made fcd.

Collapse
 
eggbean profile image
eggbean

If you want exa to behave just like ls, so that you do not need to learn any new switches, I have made this wrapper script:
gist.github.com/eggbean/74db77c4f6...

Collapse
 
joeklemmer profile image
Joe Klemmer

I've found lazygit to be quite handy, myself.

github.com/jesseduffield/lazygit

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard • Edited

I've tried it and love it, thanks!

Collapse
 
klvenky profile image
Venkatesh KL

Z is similar to autojump & works great for me.