Skip to content

Instantly share code, notes, and snippets.

@ProProgrammer
Last active February 22, 2020 03:01
Show Gist options
  • Save ProProgrammer/25b5e3b3a85e283afe5a57170a894211 to your computer and use it in GitHub Desktop.
Save ProProgrammer/25b5e3b3a85e283afe5a57170a894211 to your computer and use it in GitHub Desktop.
Awesome Command Line Tools by Amjith Ramanujam

Third in Top 10 Must-Watch PyCon Talks by RealPython

Youtube | Slides | Date: Feb 22, 2020

Things to be super aware of

  • Discoverability - Make your features more obvious/forthcoming, don't hide them behind something (e.g. a particular key stroke combination in case of command line tools)
  • Be User focussed - Whatever you are building an application/feature, user comes first, make it most intutitive and absolutely powerful for the user, implementation should always come next
  • Configurability - Root of all evil! (Inspired by design decisions of Fish Shell) Adding config options means program too stupid to figure out what's best for the user. Configurations should be for subjective options only (e.g. color schemes based on indiv preferences)

Really good examples:

  • Fish Shell
  • PGCLI
  • MYCLI
  • BPYTHON

Checklist when implementing an interactive shell:

  • Persistent History - You shouldn't have to start from a clean slate
  • History Search - Cmd / Special Key to access / Fish style suggestion
  • Emacs Keybinding - Eg. Ctrl A > Beginning of Line, Ctrl E > End of the Line, etc. - Default key bindings in various popular shell
  • Paged Output - If output doesn't fit in a single page, send it through a pager so user doesn't have to scroll up/down
  • Auto-Completion - Automatically trigger this without having to press the tab key
  • Minimal Config - No configs, much better!
  • Syntax Coloring/Highlighting - Obvious!
  • Demo - implement most of the above using jonathanslenders/python-prompt-toolkit -- implementing REPL as part of Demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment