How to design a CLI
Vercel’s a got a great system for deploying serverless JS web apps. It Just Works(TM). Vercel’s CLI however…is a learning example. We’ll go over some of their interesting and noteworthy design choices, and then, describe what other option we could take.
Write by default to stderr
People use CLIs because they’re cheap on bandwidth, RAM, CPU, and don’t have images. It certainly has nothing to do with UNIX’s rich set of tools and composability.
$ vercel ls | grep https
Vercel CLI 28.4.10
> Deployments for [REDACTED] under [REDACTED] [366ms]
> To list deployments for a project, run `vercel ls [project]`.
Age Deployment Status Duration
5m https://[REDACTED].vercel.app ● Ready 17s
57m https://[REDACTED].vercel.app ● Ready 17s
But Only do it for some part of one help message
$ vercel inspect --help | grep ls
Vercel CLI 28.4.10
$
Being inconsist…