04 May 2020 · cli
· python
This article is based on my PyCon 2020 talk of the same title.
In the beginning, was the command line. Well, not quite the command line we know today.
We had typewriters. We were communicating using Morse code. One fine day, someone had an idea to connect a typewriter to …
Read
There are
comments.
04 May 2020
Now that we know how to write CLIs in Python, let's talk about the CLI user experience. As mentioned earlier, we're operating in a constrained design space. In contrast to GUIs, which offer a lot of visual cues and guidance to the user.
There are some principles that can help …
Read
There are
comments.
04 May 2020
Let's look at some common CLI use cases and how we can use click to implement them.
This time we'll use an example CLI called smol-git.
$ smol-git --help
Usage: smol-git [OPTIONS] COMMAND [ARGS]...
smol-git - the stupid content tracker
Options:
--version Show the version and exit.
--help Show this message and …
Read
There are
comments.
04 May 2020
Let's see how we can write a command-line interface using Python. There are several options to do this, in the standard library and on PyPI.
We'll use an example CLI called smol-pip, and see how we can implement it using these different options.
$ smol-pip install --upgrade package_name
smol-pip has one …
Read
There are
comments.
04 May 2020
tty (short for teletype) is a Unix command that prints the name of the terminal connected to standard input. It is also the prefix in names for virtual terminals on Unix-based operating systems.
The fundamental type of application that runs on a terminal is the shell. The …
Read
There are
comments.