By Darren Burns

Translated by authorized LeanCloud, weakish@LeanCloud

This article is the third in the “Good Command line tools” series. In this article, I’ll show you five command-line tools that can help you solve common problems more easily.

tigInteractively browse the Git repository

With TIG, you can interactively browse git repositories without leaving the command line.

Tig is simple and intuitive to use, with Stash, staging, log and other views.

Thanks to Renato Suero @renatosuero for recommending Tig to me on DEV.

The installationtig

  • MacOS (Homebrew) :brew install tig

PathPicker (fpp) Select files quickly

PathPicker is a command line file selection library launched by Facebook. The animation below is taken from the PathPicker document.

From PathPicker’s website:

The PathPicker accepts all kinds of input — the output of git commands, grep results, searches — just about anything. After parsing the input, the PathPicker presents a nice interface for you to select files. Once the file is selected, you can open it with your preferred editor or execute any command.

Thanks to Nikolay Dubina (@Nikolayid) for recommending this tool.

Install PathPicker

  • MacOS (Homebrew) :brew install fpp

tldrA working example of using a command line tool

TLDR helps you quickly see a real-world example of using command-line tools. In short, the “TL; Dr” version of the MAN page.

Examples of TLDR are maintained by the community and stored in the GitHub repository of TLDR.

The installationtldr

  • NPM installation is recommended:npm install -g tldr
  • MacOS (Homebrew) :brew install tldr

gronLook at the JSON

Gron converts JSON text into discrete assignment statements for look-ups. I particularly like to use FZF in combination (I mentioned this tool in the first article in this series) to view the API interactively:

Gron can also be used to transform JSON objects (example). However, this is not the primary use scenario for Gron, and a specialized tool like JQ is probably more appropriate for such tasks.

The installationgron

  • MacOS (Homebrew) :brew install gron

Thefuck Quickly fixes command line errors

Misspelled while typing the command, fuck, thefuck gives some candidate correct commands.

Unfortunately, the name of this command is a little yellow, so you may want to call it something else.

Install thefuck

  • macOS (Homebrew) :brew install thefuck

Bonus: explainshell, explain commands

If you have a complicated line of commands and want to see what it does without looking up man or TLDR one by one, you can use explainshell:

conclusion

Hope you’re interested in the tools in this article! For more like this, follow @_DarrenBurns on Twitter and DEV.