DEV Community

Cover image for Poll: CLI or UI?
José Pablo Ramírez Vargas
José Pablo Ramírez Vargas

Posted on

Poll: CLI or UI?

I just saw a post, using CLI for MySQL and PostgreSQL, showing some quick sheet of commands (I suppose popular ones).

It is my very own and personal opinion that it is a waste of my brain cells to memorize so many different CLI commands, so I am a User Interface guy.

Want to tell your story/preference? Hit the comments section here or head to my Mastodon poll. Yes, you can do polls in Mastodon. Cool right?

Top comments (1)

Collapse
 
yaroslaff profile image
Yaroslav Polyakov

GUI is easier to learn, so it is good when you need to do something, what you never did before (or did it once, year ago, and now forgot how to do this).
CLI is good when you know what to do (when you do it often) and fingers has memory, so you can type command automatically and quickly, not reading man pages.

Also, CLI options design is important. For example: check openssl manual page (start from this page) and try to find out, how to do most typical operation - check certificate (on remote server or in local file), to see it's expiration date. While openssl itself is great package, it's options are impossible to remember. Even simplest operations are very hard to type and hard to remember:

echo | openssl s_client -showcerts -servername dev.to -connect dev.to:443 2>/dev/null | openssl x509 -inform pem -noout -text
Enter fullscreen mode Exit fullscreen mode

And also, probably you may want to add:
| grep "Not After" or at least | less because it prints lot of info which you do not need (but who need it? Ten persons in world twice in year? If you need full certificate, you use PEM format, not text dump).

Now compare with showcert:

$ showcert dev.to
Names: dev.to
notBefore: 2022-08-30 21:45:08 (117 days old)
notAfter: 2023-10-01 21:45:07 (279 days left)
Issuer: C=BE O=GlobalSign nv-sa CN=GlobalSign Atlas R3 DV TLS CA 2022 Q3
Enter fullscreen mode Exit fullscreen mode

(disclaimer: showcert is my hobby project)

Or, how to check gmail smtp (port 25) server (gmail-smtp-in.l.google.com) cert? You guessed right: showcert gmail-smtp-in.l.google.com:25

Isn't it much easier to remember? And default output format is what we, human race, always (99.9%) need. If you need openssl-like full dump, use -o full or -o pem, but default output format is good for most cases.

Simple things must be simple to do. If you need something little more complex - command line could be little more complex. But it should go from simple to complex and only when there is need for this complexity. Unfortunately, many CLI tools (like openssl) do not follow this simple rule. They have lot of features, but hard to use even simplest of them.