6 ms·
Ask HN: Good examples of interactive command-line user experience?
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.
- grovegames 9y agoyeoman is pretty good. It gives the option of interactive or command line. Reasonable use of colour, with some layout formatting. Dynamic options.
- gabrielcsapo 9y agoI like npm-check https://github.com/dylang/npm-check https://github.com/dylang/npm-check it has a really useful and easy to use UI, on of the nicest terminal UI driven applications I have used. Edited: to use TUI instead of CLI
- souenzzo 9y agoTUI is not CLI. htop and these curses interfaces was TUI
- gabrielcsapo 9y agoThank you for the clarification, I updated my post.
- noshbrinken 9y agoThanks for pointing that out. I'm interested in both.
- odammit 9y agoServerless (https://serverless.com https://serverless.com) has a nice experience. I believe it is built using inquirer.js (https://github.com/SBoudrias/Inquirer.js https://github.com/SBoudrias/Inquirer.js) 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. termUI in go is also nice if you need graphing and viz for a dashboard like command line.
- shoshin23 9y agoI can second Serverless. Apart from being quite a powerful tool, it also has a nice experience overall.
- noshbrinken 9y agoI think many/most Node TUI's use Inquirer. I have mixed feelings about it. Python has several library's that provide lower-level constructs for building CLI and TUI's. Then they provide examples for using the library to implement a common pattern or prompt. Inquirer gives you some ready-made prompts but doesn't provide any help/convenience for creating your own prompt. It seems like the wrong level of abstraction.
- odammit 9y agoWhich python libraries do you prefer? Inquirer is def the HTML inputs of the terminal but I got pretty far with it. My use case was Fairly Simple™ though. What other UI components do you think it's lacking?
- noshbrinken 9y agoI like python_prompt_toolkit, though I think the learning curve can be a bit steep. It gives you a ton of flexibility, which I really appreciate, but I have a hard time remembering how all the pieces interact. I hope I don't sound overly critical of people's open source work, because I've used and really appreciate both Inquirer and PPT. Just seems like there's yet to be a canonical library for this problem set.
- odammit 9y agoIt'd be really nice to see one in go or something else I could ship around easily w/o needing NPM and node, etc. I'll give PPT a swing. I haven't used it before. Thanks!
- gglitch 9y ago- Emacs' Magit - moc (Music on Console)
- souenzzo 9y agogit
- raverbashing 9y agoit was awful, it is getting better and I think it's a good example in several occasions (I mean when it's not an unpredictable sequence of commands that need to be passed to accomplish something outside of a regular workflow)
- odammit 9y agoI enjoy how much git-flow-avh dumbs down git for me. I've been using regular old git commands for years but inevitably end up in some weird merge conflict with myself and possibly a slightly inebriated version of me that was coding the night before.
- souenzzo 9y agoI'm using git cli. Already tried sourceTree, gitkraken, intellij plugins, atom plugins.... all these attempts ended up in "I do not know which branch I am in" or "How do I get a diff to remote"?
- tracker1 9y agoAgreed, part of why I love the integrated terminal in VS Code... mostly doing git, node and npm commands while working on my projects. About the most GUI I use, is the active diff tool in VS Code. But that's not CLI based. I've also tried a few gui tools for git, and none seem to be quite as easy as just using the CLI for it. Probably the cli that I find the most useful beyond git that I use regularly is docker... It's pretty useful if you aren't in a linux environment but need to build something in one... In my node lambda builds, I'll do something like: docker -i -v "${PWD}/dist":/app -w /app node:6.10 npm i Which is usually enough to give me something I can zip and upload for use in a lambda... Though, like git, if I'm doing something not usual, I often wind up having to google it. Like anything in git more complicated than a simple rebase or add/commit/push.
- 9y ago
- neovintage 9y agoI would recommend that you check out the Heroku CLI Style Guide: https://devcenter.heroku.com/articles/cli-style-guide https://devcenter.heroku.com/articles/cli-style-guide 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.
- pricechild 9y agoOne thing not mentioned there is exit statuses. I think they're just as important a thing to think about, up there with what arguments to accept.
- neovintage 9y agoThanks for the feedback! I'll see if we can get that in the guide.
- noshbrinken 9y agoThis is great. Exactly the kind of thing I'm looking for.
- falcolas 9y ago`parted` is pretty good, in an old-school way. 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. Color, layouts (other than those required for readability), and other things just don't really matter as much, IMO.
- sonofgod 9y agoIt's a terrible idea, but an excellent example of experience: https://github.com/nvbn/thefuck https://github.com/nvbn/thefuck [TL;DR -- typo a command, type 'fuck', will run the command you should have run]
- txdv 9y agotig is pretty solid
- sevensor 9y agoI'll second that. I use tig daily. Another tui I like is for networkmanager. For whatever reason, nmtui always seems to work better than the gui frontends. I think PyPy deserves a special mention -- it's been a few years since I built it, but the last time I did it drew the Mandelbrot set as a progress indicator.
- rdavis 9y agoI use tig every day and it is easily my favourite git client. I especially love the staging view and ability to stage individual lines.
- odammit 9y agoOh and don't forget figlet when you need that dope ASCII logo banner.
- git-pull 9y agoYes, tmux. - tmux counts as a TUI UX. it is backed by ncurses (https://en.wikipedia.org/wiki/Ncurses https://en.wikipedia.org/wiki/Ncurses) - colors: it supports 256 colors, 24bit colors landed in 2.2 (but haven't used it) - 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 - 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 - help: the tmux manual is superb (https://www.freebsd.org/cgi/man.cgi?query=tmux https://www.freebsd.org/cgi/man.cgi?query=tmux) 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.S. I am the author of The Tao of tmux, a book you can read free online)
- nicoburns 9y agoThe `micro` test editor is fantastic. GUI-standard keyboard shortcuts. Mouse support. Ability to execute commands while editing test. https://micro-editor.github.io/ https://micro-editor.github.io/
- malkia 9y agofor the TUI - aptitude, midnight commander, back in the days the Turbo Vision was awesome, which I think has some ports for Linux. 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...
- zie 9y agoThere 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. [0] https://www.youtube.com/watch?v=hJhZhLg3obk https://www.youtube.com/watch?v=hJhZhLg3obk [1] https://bpython-interpreter.org/ https://bpython-interpreter.org/
- d0mine 9y agoPython prompt toolkit is worth a look https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/README.rst https://github.com/jonathanslenders/python-prompt-toolkit/bl...
- git-pull 9y agoYes good on you for mentioning that, as well as the other projects in the umbrella: - pymux (tmux clone): https://github.com/jonathanslenders/pymux/ https://github.com/jonathanslenders/pymux/ - pyvim (vim clone): https://github.com/jonathanslenders/pyvim/ https://github.com/jonathanslenders/pyvim/ Lots of community-driven CLI tools with superb autocompletion: - ptpython: http://github.com/jonathanslenders/ptpython/ http://github.com/jonathanslenders/ptpython/ - pgcli: http://pgcli.com/ http://pgcli.com/ + mycli: http://mycli.net/ http://mycli.net/ - complete shells: xonsh (http://xon.sh/ http://xon.sh/) + ergonomica (https://ergonomica.github.io/ https://ergonomica.github.io/)
- zie 9y agoThe talk covers Prompt Toolkit. The presenter wrote pgcli and mycli, and covers most of your list as well. But it's probably good to list it all out here, for the lazy, or the ones unable/unwilling to play youtube.
- ericfrederich 9y agoclick is another package that implements a lot of these things. http://click.pocoo.org/6/ http://click.pocoo.org/6/
- Jaepa 9y agoWhile it mostly piggy backs on ag, I think tag (https://github.com/aykamko/tag https://github.com/aykamko/tag) has one of the best UX workflows I've seen.
- Grom_PE 9y agoFar Manager is my favorite TUI and is the primary reason I haven't switched over to Linux yet.
- czak 9y agoI'm constantly impressed by fzf (https://github.com/junegunn/fzf https://github.com/junegunn/fzf). 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.
- niftich 9y agoMidnight Commander and its spiritual predecessors going all the way back to Norton Commander and Volkov Commander are marvellous examples of TUI. They're intuitive, interactive, come with embedded help, and use text mode to present a sophisticated, productive interface.
- vram22 9y agoThe Norton Editor (NE) was very good too. Really fast. Probably written in assembly, maybe by Peter Norton himself. I had bought and read a book of his on programming in assembly language (x86) for the IBM PC. Also very good. He developed a TUI hex editor in the book as a running case study, IIRC. Also the Norton Guides were fantastic. TSRs [1], but with a TUI. You could get guides for C, dBASE, Clipper, Assembly, etc. I loved the TSR popup experience on DOS. [1] Terminate and Stay Resident programs. They hooked into a keyboard interrupt to allow them to pop on a press of a hotkey.
- dennyabraham 9y agoThe dbcli suite (pgcli, mycli) provide a great user experience on the command line that even some gui database tools don't match up to. https://github.com/dbcli https://github.com/dbcli
- zeveb 9y agoI think that gnus & magit are pretty good. Gnus is a full-featured news, email & RSS reader (and others too maybe?). I've used it for most of my life. Magit is a full-featured git UI, good enough that I don't bother using git from the command line anymore.
- skocznymroczny 9y agoTurbo Pascal 7.0
- xiaq 9y agoShameless plug: Elvish (https://github.com/elves/elvish https://github.com/elves/elvish) is a shell with a rich UI. The idea of enriching shell's UI is not new though, zsh and fish are both prior arts.
- TheAceOfHearts 9y agoThe first tool that came to mind for me was htop [0] with ncurses. It's a friendly alternative to top. 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. 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. 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. 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. [0] http://hisham.hm/htop/ http://hisham.hm/htop/ [1] http://rybczak.net/ncmpcpp/screenshots/ http://rybczak.net/ncmpcpp/screenshots/ [2] https://www.musicpd.org https://www.musicpd.org [3] https://goaccess.io https://goaccess.io [4] http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap12.html#tag_21_12 http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_... [5] https://www.gnu.org/prep/standards/html_node/Program-Behavior.html https://www.gnu.org/prep/standards/html_node/Program-Behavio... [6] https://www.gnu.org/prep/standards/html_node/index.html https://www.gnu.org/prep/standards/html_node/index.html [7] https://github.com/chjj/blessed https://github.com/chjj/blessed [8] https://github.com/Yomguithereal/react-blessed https://github.com/Yomguithereal/react-blessed [9] https://github.com/zeit/pkg https://github.com/zeit/pkg
- noshbrinken 9y agoGreat list! Thanks a bunch.
- vram22 9y agoThe 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.
- j_s 9y agoncdu | https://en.wikipedia.org/wiki/Ncdu https://en.wikipedia.org/wiki/Ncdu
- gumby 9y agoThe 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: https://dspace.mit.edu/bitstream/handle/1721.1/6946/AITR-794.pdf https://dspace.mit.edu/bitstream/handle/1721.1/6946/AITR-794... 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. 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. Also BSD4.1 sh is quite good one !:... and ^...^ etc were added. As a side note, IIRC Emacs started out as Ciccarelli's TECO init file around '75/76 or so.
- drudru11 9y agoFor the modern version of this, see CLIM or McCLIM
- jszymborski 9y agoThere's mapscii[0], which was on HN a little while ago. Easily the coolest console experience I've ever had. You can check it out by running "telnet mapscii.me" [0] https://github.com/rastapasta/mapscii https://github.com/rastapasta/mapscii
- dduarte 9y agohttps://www.youtube.com/watch?v=hJhZhLg3obk https://www.youtube.com/watch?v=hJhZhLg3obk "Amjith Ramanujam Awesome Command Line Tools PyCon 2017" goes through some nice examples: mycli, pgcli, fish shell and few others
- yourapostasy 9y agoTangentially-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. [1] http://web.archive.org/web/20091011010412/http://www.vtsoft.com/vcsproducts/vviews.html http://web.archive.org/web/20091011010412/http://www.vtsoft....
- romdev 9y agoTelemate 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.
- andrewf 9y agoI'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 https://en.wikipedia.org/wiki/IBM_Common_User_Access https://en.wikipedia.org/wiki/IBM_Common_User_Access )
- type0 9y agoterminal_velocity
- rdavis 9y agoI highly recommend ranger[0]. It's a very useful console based file manager with great vi key bindings. The configuration is also very flexible and includes a python API to write your own commands[1]. [0] http://ranger.nongnu.org http://ranger.nongnu.org [1] https://github.com/ranger/ranger/wiki/Commands https://github.com/ranger/ranger/wiki/Commands
- dbkaplun 9y agoslap[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. [0] https://github.com/slap-editor/slap https://github.com/slap-editor/slap
- type0 9y agodockly
- winterbe 9y agoJest is pretty neat: https://facebook.github.io/jest/ https://facebook.github.io/jest/
- swah 9y agodarcs