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)…

  • hades@feddit.uk
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    18 hours ago

    I think it depends a lot on what kind of application you’re thinking of. Here are some examples of tools that I particularly remember for having nice CLI interfaces, but they are all slightly different in terms of the number of operations/entities they support.

    Single operation, a lot of different types of data: httpie

    httpie is a CLI HTTP client. It allows to generate fairly complex requests, choose which diagnostic information you want to see, etc.

    Examples:

    $ https httpie.io/hello
    $ http PUT pie.dev/put X-API-Token:123 name=John
    $ http -v pie.dev/get
    

    Several operations, a lot of parameters: Bazel

    Bazel is a build system. There are only a handful of operations you typically perform (build, run, test, query), but they all follow the same pattern.

    Examples:

    $ bazel build //app
    $ bazel --quiet build //app -c opt
    $ bazel --quiet run //app -c opt -- --port=1234
    

    Multiple entites, multiple operations: LVM

    I really liked the interface of Linux Volume Manager tools. They consist of multiple commands that follow the same pattern, and use the same flags for options.

    Examples:

    # vgcreate -n vg_name
    # vgs
    # pvcreate /dev/sda
    # vgextend vg_name /dev/sda
    # lvcreate vg_name -n lv_name -L5G
    # lvresize vg_name/lv_name -L+1G
    # lvs
    
    • bodaciousFern@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      6 hours ago

      LVM is in your favorites? It’s essential command(s) for sure but every time I use it it’s trial and error because I didn’t use the correct flag case and/or argument order