Live data from Hacker News

Ask HN: Good examples of interactive command-line user experience?

news.ycombinator.com

51–60 of 83 posts

Re: Ask HN: Good examples of interactive command-line user experience?

#52
I 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.

Re: Ask HN: Good examples of interactive command-line user experience?

#54

Earlier quoted context omitted.

There is even a science paper showing that "for most people Git is a magic black box they whisper obscure spells into": http://www.ppig.org/sites/default/files/2014-PPIG-25th-Churc...

I question this study's sample size and diversity. Git was made by and made for kernel hackers to support the Linux kernel. It has an expectation that the user understands how their computer works and wants a tool catered to that knowledge. The average web developer writing Ruby or Node in Atom on their Macbook Pro isn't in the target audienece. For someone in git's target audienece, it's a great tool with far better…

> The average web developer writing Ruby or Node in Atom on their Macbook Pro

It does not matter who it was designed for, git is the de-facto VCS that almost everyone uses today. And people are having trouble using it because there is no better alternative: it is fast and powerful and used by many companies.

But it's UX is terrible: I use git for 10 years and I have to Google every time I need to make a branch tracking a remote one. git reset does different things based on what type of object you pass.

This has nothing to do with knowing how internals work, it is a question of consistency and providing a small non-overlapping set of tools to do my job.

Re: Ask HN: Good examples of interactive command-line user experience?

#56

Earlier quoted context omitted.

I question this study's sample size and diversity. Git was made by and made for kernel hackers to support the Linux kernel. It has an expectation that the user understands how their computer works and wants a tool catered to that knowledge. The average web developer writing Ruby or Node in Atom on their Macbook Pro isn't in the target audienece. For someone in git's target audienece, it's a great tool with far better…

> The average web developer writing Ruby or Node in Atom on their Macbook Pro It does not matter who it was designed for, git is the de-facto VCS that almost everyone uses today. And people are having trouble using it because there is no better alternative: it is fast and powerful and used by many companies. But it's UX is terrible: I use git for 10 years and I have to Google every time I need to make a branch tracki…

>It does not matter who it was designed for, git is the de-facto VCS that almost everyone uses today. And people are having trouble using it because there is no better alternative: it is fast and powerful and used by many companies.

It _does_ matter who it's designed for. If someone outside the target audience uses it, then it's not the tools fault for not accomodating them. My point is that the UX is great for those it's meant to be great for.

>I use git for 10 years and I have to Google every time I need to make a branch tracking a remote one.

git branch --set-upstream-to=upstream/master master

Didn't have to look this up. Seems pretty straightforward. Or just git push -u upstream master.

>git reset does different things based on what type of object you pass.

So? I don't see how this is a bad UX. Would you prefer 10 different commands? I wouldn't.

Re: Ask HN: Good examples of interactive command-line user experience?

#57
The 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/

[1] http://rybczak.net/ncmpcpp/screenshots/

[2] https://www.musicpd.org

[3] https://goaccess.io

[4] http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_...

[5] https://www.gnu.org/prep/standards/html_node/Program-Behavio...

[6] https://www.gnu.org/prep/standards/html_node/index.html

[7] https://github.com/chjj/blessed

[8] https://github.com/Yomguithereal/react-blessed

[9] https://github.com/zeit/pkg

Re: Ask HN: Good examples of interactive command-line user experience?

#59
post #20

Earlier quoted context omitted.

I 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.

Which 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?

I 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.

Re: Ask HN: Good examples of interactive command-line user experience?

#60
post #50

Midnight 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.

The 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.

Post reply on HN