Awesome Commandline Tools

Amjith Ramanujam (~amjith)





Designing a good command line tool is challenging. Command line tools look archaic compared to modern graphical interfaces, discoverability is a big issue for command line tools. This talk will cover a set of specific techniques to help alleviate those challenges.

How did pgcli and mycli overcome these problems? We will cover specific examples where command line apps shine. The examples will be drawn from pgcli, mycli and bpython. This talk will suggest libraries and show how they can help you implement a wonderful command line interface.

The libraries covered in this talk include python-prompt-toolkit, pygments, click, fuzzyfind.

The goal of the talk is to distil the ideas that exist in successful command line applications as guidelines for building powerful command line applications.

Talk Outline:

Intro (5 mins)

  • How many of you here started out on a commandline interface?
  • Rest of you I just have this to say: You didn't really miss much.
  • My first start with MSDOS 6.2.
  • Up/Down arrow was eye-opening.
  • Linux commandline was even better. I found out about tab-completion.
  • Then I learned about the history search using the C-r keybinding.

What is the problem here: (5 mins)

  • Discoverability.
  • History traversal
  • Tab-completion
  • Searching the history are all good features.
  • But to a new comer it is not apparent.
  • This is where the GUI programs have an advantage.
  • Little icons and tooltips and menu items tend to highlight new features.
  • People say why not pop up new features as tips, but we all know that people don't read.
  • But if you have an visible indicator like an icon or a menu it is hard to miss.
  • So how can commandlines compete in this arena?

What is the problem here: (5 mins)

  • User Focused design.
  • Let's take a look at mysql.
  • Mediocre auto-completion.
  • Look at Python
  • Use a pager to pipe the output.

Configuration is the root of all evil: (5 mins)

  • psql has so many awesome feature but they are all turned off by default.
  • bash and zsh has so many completion features but they are all turned off too.
  • Why would you do this?
  • Presenting pgcli.
  • Presenting fish.
  • Fish has solved the C-r problem in a very clever way.

How to implement it: (7 mins)

  • Prompt-toolkit
  • REPL


Basic knowledge of Python and Commandline (either dos or linux).

Content URLs:





Speaker Info:

Amjith is the creator of DBCLI an opensource organization behind a few of the best-known command-line database clients, pgcli, mycli, litecli, mssql-cli, iredis etc. During his day job, he works at Netflix as a senior software engineer, focusing on reliability of distributed systems and recovery from failure.

Speaker Links:



Section: Developer tools and automation
Type: Talks
Target Audience: Beginner
Last Updated: