What are good examples of interactive TUI/CLI user experience? I'm looking for nice layouts, use of ASCII color, interaction patterns, nicely written help text, etc.
Yes, tmux.<p>- tmux counts as a TUI UX. it is backed by ncurses (<a href="https://en.wikipedia.org/wiki/Ncurses" rel="nofollow">https://en.wikipedia.org/wiki/Ncurses</a>)<p>- colors: it supports 256 colors, 24bit colors landed in 2.2 (but haven't used it)<p>- layouts: 1) supports splitting multiple command lines into "panes" which are resizable 2) supports custom layouts and arrangements for panes 3) you can "zoom" in on panes via `C-b z` 4) you can actually run other TUI applications within it<p>- interaction: 1) tmux also forks itself into a server in the background so you can de/re-attach your workspace 2) you can create and move between collections of panes, what tmux calls "windows" 3) command-based, so configuration via ~/.tmux.conf uses the same language as scripting 4) tmux can be scripted / remote controlled, you can even send-keys and copy the contents of panes<p>- help: the tmux manual is superb (<a href="https://www.freebsd.org/cgi/man.cgi?query=tmux" rel="nofollow">https://www.freebsd.org/cgi/man.cgi?query=tmux</a>)<p>Downsides are, I still get glitchy issues when using vim / unicode / colors in tmux panes which are difficult to diagnose. `reset` normally fixes it. It's been this way for years, and I don't want to even begin figuring out what the hell is happening because I'm using too many plugins. Considering starting from scratch. So if you get into tmux/vim/other CLI stuff, the simpler you keep your config, the better off you'll be.<p>(P.S. I am the author of <i>The Tao of tmux</i>, a book you can read free online)
I would recommend that you check out the Heroku CLI Style Guide: <a href="https://devcenter.heroku.com/articles/cli-style-guide" rel="nofollow">https://devcenter.heroku.com/articles/cli-style-guide</a><p>There are many different teams within Heroku that need to provide interactions for developers via CLI whether its for dynos or data services. The guide was a way to codify building a consistent interaction that all product managers and engineers could follow. Disclaimer: I work for heroku.
The symbolics accept/present system (part of Dynamic Windows). Unfortunately if you haven't used it, all I couldn't find was Gene Ciccarellis' PhD thesis: <a href="https://dspace.mit.edu/bitstream/handle/1721.1/6946/AITR-794.pdf" rel="nofollow">https://dspace.mit.edu/bitstream/handle/1721.1/6946/AITR-794...</a><p>Basically: Lisp supports idempotent type-based printing (print something in a form that can be read back to identify the same object -- basically unremarkable these days; consider python's __repr__ and __string__) as well as human-friendly printing.<p>The presentation system was remarkable in that when you printed an object it printed in the user-friendly form, but when the text was read back the IO system knew what the object was and so acted as if a machine-readable representation had been printed. It also used the type hierarchy to support mouse action in "ordinary" text, thus if you needed a SHAPE object, the mouse would highlight "Square at 4,4" and "Circle centred at 5,5, radius 7" as if it were #<CIRCLE 5,5, r=7>. In fact the "printed" representation need not be textual.<p>Also BSD4.1 sh is quite good one !:... and ^...^ etc were added.<p>As a side note, IIRC Emacs started out as Ciccarelli's TECO init file around '75/76 or so.
It's a terrible idea, but an excellent example of experience:<p><a href="https://github.com/nvbn/thefuck" rel="nofollow">https://github.com/nvbn/thefuck</a><p>[TL;DR -- typo a command, type 'fuck', will run the command you should have run]
There was a talk at Pycon 2017 about this [0] that's pretty good. He(amjith) goes through several examples with his favorite being bpython [1] and even covers writing such a thing in python live on stage.<p>[0] <a href="https://www.youtube.com/watch?v=hJhZhLg3obk" rel="nofollow">https://www.youtube.com/watch?v=hJhZhLg3obk</a>
[1] <a href="https://bpython-interpreter.org/" rel="nofollow">https://bpython-interpreter.org/</a>
I'm constantly impressed by fzf (<a href="https://github.com/junegunn/fzf" rel="nofollow">https://github.com/junegunn/fzf</a>). I use it both from the shell (for files and command history) as well as a fuzzy finder in vim. I greatly enjoy the speed and intuitiveness.
There's mapscii[0], which was on HN a little while ago. Easily the coolest console experience I've ever had.<p>You can check it out by running "telnet mapscii.me"<p>[0] <a href="https://github.com/rastapasta/mapscii" rel="nofollow">https://github.com/rastapasta/mapscii</a>
Shameless plug: Elvish (<a href="https://github.com/elves/elvish" rel="nofollow">https://github.com/elves/elvish</a>) is a shell with a rich UI.<p>The idea of enriching shell's UI is not new though, zsh and fish are both prior arts.
Telemate BBS client was a great example of a windowed TUI in the style of DESQView. You could have a chat window, a DOS terminal and an ANSI terminal all open at the same time. Overlayed dialog boxes were framed, resizable and movable within the window. Scripting was supported in chat and terminal windows to navigate through menus or to type "^H^H^H^Hsexy beast" any time your name comes through the chat.
Another favorite of mine, Vern Buerg's List.com, was far better than Norton Commander or the MC clone, in my opinion. As a multi-column file viewer/manager, it maximized the number of files displayed onscreen and allowed simple file operations from a keystroke. By using a hex editor you could change the viewer and external editors. It was also written in 8086 assembly and was very fast.
I think that gnus & magit are pretty good.<p>Gnus is a full-featured news, email & RSS reader (and others too maybe?). I've used it for most of my life.<p>Magit is a full-featured git UI, good enough that I don't bother using git from the command line anymore.
for the TUI - aptitude, midnight commander, back in the days the Turbo Vision was awesome, which I think has some ports for Linux.<p>I'm constant midnight commander (linux/osx), FAR commander (windows) user. I'm so glad that it works flawlessly almost anywhere there is terminal support...
I like npm-check <a href="https://github.com/dylang/npm-check" rel="nofollow">https://github.com/dylang/npm-check</a> it has a really useful and easy to use UI, on of the nicest terminal UI driven applications I have used.<p>Edited: to use TUI instead of CLI
Midnight Commander and its spiritual predecessors going all the way back to Norton Commander and Volkov Commander are marvellous examples of TUI.<p>They're intuitive, interactive, come with embedded help, and use text mode to present a sophisticated, productive interface.
Tangentially-related: check out Vermont Views [1], a complete TUI development solution. I wish they open sourced it before they exited the market, or re-entered the market for IOT/embedded developers. I've never found a comparable open source effort, though here's to hoping the Blessed project for node.js takes inspiration from Vermont Views for future directions.<p>[1] <a href="http://web.archive.org/web/20091011010412/http://www.vtsoft.com/vcsproducts/vviews.html" rel="nofollow">http://web.archive.org/web/20091011010412/http://www.vtsoft....</a>
Serverless (<a href="https://serverless.com" rel="nofollow">https://serverless.com</a>) has a nice experience. I believe it is built using inquirer.js (<a href="https://github.com/SBoudrias/Inquirer.js" rel="nofollow">https://github.com/SBoudrias/Inquirer.js</a>)<p>I've recently built an internal tool with inquirer and it was a really nice development and user experience. I haven't figured out the best way to test the interactions though.<p>termUI in go is also nice if you need graphing and viz for a dashboard like command line.
I highly recommend ranger[0]. It's a very useful console based file manager with great vi key bindings.<p>The configuration is also very flexible and includes a python API to write your own commands[1].<p>[0] <a href="http://ranger.nongnu.org" rel="nofollow">http://ranger.nongnu.org</a><p>[1] <a href="https://github.com/ranger/ranger/wiki/Commands" rel="nofollow">https://github.com/ranger/ranger/wiki/Commands</a>
I'd look at old DOS applications - the last mass market (i.e. not just technical users) for non-GUI apps. Although towards they end, they were often just aping Windows GUIs as well as they could (see <a href="https://en.wikipedia.org/wiki/IBM_Common_User_Access" rel="nofollow">https://en.wikipedia.org/wiki/IBM_Common_User_Access</a> )
`parted` is pretty good, in an old-school way.<p>The only thing I'd personally ask for is if you offer an interactive interface, make sure you can execute the exact same commands on the plain CLI. Also (yeah, two things) support --help and --version (as well as -h and -v) out of the box.<p>Color, layouts (other than those required for readability), and other things just don't really matter as much, IMO.
<a href="https://www.youtube.com/watch?v=hJhZhLg3obk" rel="nofollow">https://www.youtube.com/watch?v=hJhZhLg3obk</a> "Amjith Ramanujam Awesome Command Line Tools PyCon 2017" goes through some nice examples: mycli, pgcli, fish shell and few others
The `micro` test editor is fantastic. GUI-standard keyboard shortcuts. Mouse support. Ability to execute commands while editing test.<p><a href="https://micro-editor.github.io/" rel="nofollow">https://micro-editor.github.io/</a>
The dbcli suite (pgcli, mycli) provide a great user experience on the command line that even some gui database tools don't match up to.<p><a href="https://github.com/dbcli" rel="nofollow">https://github.com/dbcli</a>
While it mostly piggy backs on ag, I think tag (<a href="https://github.com/aykamko/tag" rel="nofollow">https://github.com/aykamko/tag</a>) has one of the best UX workflows I've seen.
The FreePascal TUI is good, IMO. So was Turbo Pascal, back in the day. Both are very fast, get out of your way (IMO) and also look(ed) good. Okay, TP not so much :), but not bad either.
Jest is pretty neat: <a href="https://facebook.github.io/jest/" rel="nofollow">https://facebook.github.io/jest/</a>
The first tool that came to mind for me was htop [0] with ncurses. It's a friendly alternative to top.<p>I've previously used ncmpcpp [1] without any major complaints, although it's been a few years since then. It's an mpd [2] client written with ncurses.<p>On my personal servers I use goaccess [3] to analyze access logs. I remember being able to pick it up pretty quickly on my first try.<p>Only tangentially related, but you may find it useful to read the "Utility Conventions" [4] entry of The Open Group Base Specifications. I'd also suggest reading through the relevant entries under the "Program Behavior for All Programs" [5] section of GNU Coding Standards [6]. By following existing conventions (or even being aware they exist) you can sometimes make it easier for others to learn how to use your tool.<p>If you know JavaScript, you may consider writing your program with node. The blessed [7] library is a JavaScript reimplementation of ncurses, and there's even a react renderer [8]. This makes building the UI much easier than many of the alternatives I know. When you're ready to release, you can generate an executable [9] for easy deployment or publication. The biggest benefits of taking this approach are that it makes it very easy to achieve cross-platform support, and the barrier of entry is lower than many alternatives. The biggest caveats are that it'll be slower and much larger than if it had been written with C.<p>[0] <a href="http://hisham.hm/htop/" rel="nofollow">http://hisham.hm/htop/</a><p>[1] <a href="http://rybczak.net/ncmpcpp/screenshots/" rel="nofollow">http://rybczak.net/ncmpcpp/screenshots/</a><p>[2] <a href="https://www.musicpd.org" rel="nofollow">https://www.musicpd.org</a><p>[3] <a href="https://goaccess.io" rel="nofollow">https://goaccess.io</a><p>[4] <a href="http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap12.html#tag_21_12" rel="nofollow">http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_...</a><p>[5] <a href="https://www.gnu.org/prep/standards/html_node/Program-Behavior.html" rel="nofollow">https://www.gnu.org/prep/standards/html_node/Program-Behavio...</a><p>[6] <a href="https://www.gnu.org/prep/standards/html_node/index.html" rel="nofollow">https://www.gnu.org/prep/standards/html_node/index.html</a><p>[7] <a href="https://github.com/chjj/blessed" rel="nofollow">https://github.com/chjj/blessed</a><p>[8] <a href="https://github.com/Yomguithereal/react-blessed" rel="nofollow">https://github.com/Yomguithereal/react-blessed</a><p>[9] <a href="https://github.com/zeit/pkg" rel="nofollow">https://github.com/zeit/pkg</a>
slap[0] (the terminal-based text editor) was designed to emulate Sublime's UX within the terminal. It has a shallower learning curve than other command line editors.<p>[0] <a href="https://github.com/slap-editor/slap" rel="nofollow">https://github.com/slap-editor/slap</a>