Using better CLIs

For people who spend half of their lives in a terminal user experience and functionality is highly important; making you a happier person
10 October 2017   2361

Here are some very good alternatives to some default command line applications.

TLDR

My full setup includes all the stuff discussed in this article and even more

Git

hub

When working with open-source (and Github) projects frequently sometimes git is not enough. So, Github created a tool called hub.

It allows to fetch from remote forks, browse issues, and create pull requests with ease!

# Open the current project's issues page
$ git browse -- issues
  → open https://github.com/github/hub/issues

# Fetch from multiple forks, even if they don't yet exist as remotes:
$ git fetch user1,fork2

# Browse issues:
$ git browse -- issues
  → open https://github.com/github/hub/issues

# Create a pull request:
$ git pull-request -F message-template.md

tig

Let's face it. git log sucks. It allows browsing commits history, but when you want to look inside a specific commit for its changesets or tree structure, well ... You will have to memorize all these commands or use a lot of external plugins.

tig solves it all. Firstly, it allows to browse commits history. Then you can dive inside! Browse changesets, file trees, blames, and even blobs!

tig code example
tig code example

Utils

postgres (and mysql too!)

When working with postgres we have to use psql. And it is quite good. It has history, some basic autocomplete and commands that are easy to remember. But, there is a better tool called pgcli.

pgcli
pgcli example

Features:

  • smart autocomplete
  • syntax highlighting
  • pretty prints of tabular data

It also has a version for mysql called mycli.

By the way, yesterday a new 10th version of postgres was released.

glances

System monitoring is a common task for every developer. Standard tools like top and htop are fine and trusted software. But look at this beauty, glances:

glances example
glances example

glances has a lot of plugins to monitor almost everything.

It also has a web interface and a pre-build docker-container to integrate it easily. My top list of plugins:

  • docker
  • gpu (very useful for miners and coins-folks!)
  • bottle (web-interface)
  • netifaces (IPs)

Create your own if you want to!

httpie

curl and wget are well-known and widely used. But are they user-friendly? I don't think so. httpie is user-friendly and can do everything these tools can

httpie example
httpie example

And even more. I don't regret a single minute using it instead of curl.

jq

jq is like sed for json. It is useful in automation, configuration reading, and making requests.

You can try it online.

doitlive

Sometimes you have to do something live: a screencast, a gif, a talk. But everything can go wrong. You can make a typo, or misspell a word. That's where doitlive comes to the rescue.

Just create a file called session.sh with command that needs to be executed and then run:

doitlive play session.sh

Now you are a command line magician.

Python

I do a lot of python development. So, here are my tools to make it better.

pipsi

pipsi = pip Script Installer. It creates a virtualenv for every script and symlinks it into your /usr/local/bin. So it won't pollute your global environment.

pipenv

pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the Python world.

pipenv example
pipenv example

The problems that Pipenv seeks to solve are multi-faceted:

  • You no longer need to use pip and virtualenv separately. They work together.
  • Managing a requirements.txt file can be problematic, so Pipenv uses the upcoming Pipfile and Pipfile.lock instead, which is superior for basic use cases.
  • Hashes are used everywhere, always. Security. Automatically expose security vulnerabilities.
  • Give you insight into your dependency graph (e.g. $ pipenv graph).
  • Streamline development workflow by loading .env files.

ipython

ipython = Interactive python.

ipython brings autocomplete, nice history, and multiline editing to the python shell. It integrates into django and flask nicely without any configuration.
It is a must for all of my projects. If you like it, also check out jupyter.

Author - Sobolev Nikita, sobolevn

Meson Build System v0.51 to be Released

Meson is designed to provide a high speed of assembly process combined with convenience and ease of use
18 June 2019   305

The release of the Meson 0.51 build system has been published, which is used to build projects such as X.Org Server, Mesa, Lighttpd, systemd, GStreamer, Wayland, GNOME and GTK +. Meson code is written in Python and comes under the Apache 2.0 license.

The key development goal of Meson is to provide a high speed of assembly process combined with convenience and ease of use. Instead of the "mak"e utility, the Ninja toolkit is used in the default build, but other backends can also be used, such as xcode and VisualStudio. A multi-platform dependency handler is built into the system, allowing Meson to be used to build packages for distributions. Assembly rules are set up in a simplified domain-specific language, are distinguished by good readability and are understandable to the user (according to the authors' idea, the developer should spend the least amount of time writing the rules).

Cross-compilation and build on Linux, macOS and Windows using GCC, Clang, Visual Studio and other compilers is supported. It is possible to build projects in various programming languages, including C, C ++, Fortran, Java and Rust. An incremental build mode is supported, in which only components directly related to changes made since the last build are reassembled. Meson can be used to form repeatable assemblies, in which the launch of an assembly in different environments leads to the generation of completely identical executable files.

Get more info about new features and changes at official website.