The difference between an aggravating CLI tool and a great one can often be made by a few simple changes.
I have built many CLI tools over the years, including pipx which has nearly a half a million downloads. Here I try to capture the important things in a CLI tool that make it pleasant to use. These are conventions and expectations I’ve come to adopt. Without further ado, here is the checklist.
Don’t try to manually parse command line arguments. Use a library. Libraries will also autogenerate help text.
On POSIX systems the standard exit code is 0 for…
Unless you enjoy
sudo changing permissions on files in
/usr and searching for instructions on how to uninstall things cleanly (check out these answers on Stack Overflow), you might want to change up how you install homebrew on your mac.
This post outlines a clean way to install brew and programs with brew.
Instead of running curl or piping a shell script, we’re going to clone brew itself and run it directly. Don’t worry, you don’t have to compile anything, just clone it.
>> git clone https://github.com/Homebrew/brew ~/git/brew
You can now run brew directly at
~/git/brew/bin/brew, but that’s not so…
If you’re a Python developer you’ve likely heard of Virtual Environments. A Virtual Environment is “a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages.”
Why are they so popular? Well, they solve a problem: no longer are packages installed into a mishmash of global site-packages. Instead, each project can install precise dependency versions into their own “virtual” environments.
However, they introduce some problems as well:
Myth 1: “If I don’t use Pipenv or feel like it improves my workflow, I’m doing it wrong!”
Pipenv is designed for a very specific use-case: application dependency management and associated workflows. In other words it’s a fancy replacement for requirements.txt that automates virtual environment management. Even if your use-case matches what it’s designed for, nobody is saying you must use it, or looking down on you if you don’t. In fact core Python developers and the Pipenv team have workflows that don’t involve Pipenv. 
Myth 2: “Pipenv is the officially recommended Python packaging tool from Python.org”
PEP 517 and 518 are related and their combined changes are as follows.
A new standardized file named
pyproject.toml will be read by
pip for a section called
[build-system] . This file specifies two things
Here is an example of what
pyproject.toml looks like
requires = ["requests"] # PEP 518 - what is required to build
build-backend = “tool.module:myfunction” # PEP 517 - what function to call to build
SSH is awesome. It lets you securely connect to remote computers and act like you’re on a local computer. It’s so common it’s even a verb:
“ssh into the server and restart it”
But it has some downsides:
It turns out something could be better than SSH if it solved these problems, and in fact, some tools do exist that augment SSH. …