Regardless of what the app does and whether the thing that does is particularly useful, powerful or important for what you need to do (or even well implemented), what is a command-line interface that you had a particularly good experience both learning and working with?

In other words, I'm thinking about command line interface design patterns that tend to correlate with good user experience.

"Good user experience" being vague, what I mean is, including (but not limited to)

  • discoverability--learning what features are available),
  • usability--those features actually being useful,
  • and expressiveness--being able to do more with less words without losing clarity,

but if there's a CLI that has none of those but you still like it, I'd be happy to hear about it.

Edit: Trying to stress more that this post is not about the functionality behind the tool. Looks like most of first responders missed the nuance: whether app x is better than app y because it does x1 ad x2 differently or better does not matter; I'm purely interested in how the command line interface is designed (short/long flags, sub-commands, verbs, nouns, output behaviors)..

you are viewing a single comment's thread
view the rest of the comments
[+] 25 points 7 months ago* (23 children)
  • [–] 15 points 7 months ago (17 children)

    Personally I dislike pacman as it uses capital-letter flags as subcommands while I'm used to actual subcommands

  • source
  • parent
  • hideshow 17 child comments
  • [–] 2 points 7 months ago (12 children)

    You can use long option names instead too, as each capital letter mode has a long option name, such as -R --remove and -S --sync.

  • source
  • parent
  • hideshow 12 child comments
  • [–] 5 points 7 months ago (11 children)

    My problem is that it's a flag and not like # pacman remove

  • source
  • parent
  • hideshow 11 child comments
  • [–] 1 point 7 months ago (10 children)

    I don't get why that is a problem. It's just an option name with 2 dashes in front. In fact, that is the "correct" way of handling options, as in standard option processing in GNU / Linux. I personally dislike options without dash, but on the other hand it does not bother me enough to be bothered by it. pacman --remove is almost identical to pacman remove, so I don't know why that is a "problem".

  • source
  • parent
  • hideshow 10 child comments
  • [–] 3 points 7 months ago (6 children)

    Because it's not an option but a subcommand.

    as in standard option processing in GNU / Linux

    Guix and standard tooling like perf also use subcommands. I'm used to flags/options modifying the way the same inputs are processed, not completely changing what you give as $1.

  • source
  • parent
  • hideshow 6 child comments
  • [–] 0 points 7 months ago (5 children)

    But its just a matter of 2 dashes. It shouldn't be a problem.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 3 points 7 months ago* (4 children)

    You misunderstand me. It's not about typing it. It's not conforming to prevalent Linux paradigms which creates artificial confusion and learning difficulties. There's a reason it's git pull and not git -L, perf annotate and not perf -A . It's a great semantic difference like <b> vs <h3>. I'm saying this as an Arch user.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 1 point 7 months ago (3 children)

    I don't think it would make ANY difference if the option was named git --pull instead git pull (you don't have to use the single uppercase). That is NOT the same semantic difference between and , because it (the pull example) operates the same as before. The only difference are the two dashes. I don't see how this creates confusion or learning difficulties.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 3 points 7 months ago (2 children)

    The prevalent way (except for ancient tools like tar), and thus the norm, is that options are meant to be optional and subcommands are like old "do one thing" Unix commands (do completely different things, can have completely different set of arguments) but you prepend the name of the software in front of them. You can see the impact of this reflected in documentation for argument parsers: https://docs.python.org/3.14/library/argparse.html#:~:text=Required%20options%20are%20generally%20considered%20bad%20form%20because%20users%20expect%20options%20to%20be%20optional https://gobyexample.com/command-line-subcommands#:~:text=Command%2DLine%20Subcommands-,Go%20by%20Example:%20Command%2DLine%20Subcommands,that%20have%20their%20own%20flags.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 7 months ago (1 child)

    I know how subcommands work. But that is not the point I am making. Having two dashes in front of it or not like pacman remove or pacman --remove does not change how the command operates. It is literally having two dashes or not and therefore is not an issue.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 7 months ago

    Hmm, I don't know about Pacman, but for example openSUSE's zypper remove has a --clean-deps flag, which doesn't exist on the other subcommands. So, it wouldn't make sense to have it be zypper --remove --clean-deps...

  • source
  • parent
  • [–] 2 points 7 months ago (2 children)

    Is there a difference between one dash - vs two dashes -- ? I don't get why it makes sense to use two as its just an extra key press?

    Sorry for going a bit off topic here

  • source
  • parent
  • hideshow 2 child comments
  • [–] 3 points 7 months ago (1 child)

    No problem, it's always good idea to ask.

    By convention two dashes -- are used for options with long name, such as --remove, while single dash - is used for single letter options such as -R. There can be some extra rules how options are used and combined, but that is not always true for every application. A common implementation is that options with single dash can be combined to have less to press, while double dash options cannot. Meaning if you have options -a -b -c then you could combine them into one bucket as -abc or -ab -c, all equivalent. But you cannot combine --remove -a -b into --abremove in example. There can be some extra rules and some applications handle options bit differently.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 6 points 7 months ago (3 children)

    Pacman flags not being idempotent (-SS, yy, uu and such existing) is so unbelievably horrible that I can't use arch just because of it.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 7 months ago (2 children)

    I've never used Arch, can you explain how it behaves?

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 7 months ago (1 child)

    The flag -y refreshes the package list (like apt update). For some reason, you use the flag -yy to force it to clear the whole package list and redownload everything.

    To allow package downgrades when upgrading you use -uu.

    These are very commonly suggested fixes to arch package management problems, for example when you leave your arch install to suit for too long, it will be impossible to update it because of dependency problems. So you google it and people are saying to run "pacman -SSyyuu" or other such commands.

    Those additional options should be their own flags, command line flags should be idempotent (it should flip a switch on, doing it multiple times shouldn't change anything).

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 7 months ago

    This is where a man page comes in but alas, but some (perhaps even most) of them are fucking horrible. The core incantation is either too dumbed-down or (more often) too long-winded.

    Some good ones I can praise are netcat, ghostscript and 7z. Special praise goes to the Library Funtions Manual entries like signal and exit.

    Bad ones ones in my book are vim (too short), ffmpeg (a simple reordering of sections would make it quite a bit better, like moving the less common flags lower down the page) and git starts of strong but ends up being way too detailed and unstructured.

    I could go listing examples for days, so I might as well stop now.

  • source
  • parent