Settings

Theme

Batteries Included CLI Framework

28 points by maxalbarello 25 days ago · 13 comments · 1 min read


I've been looking for a "batteries included" CLI framework that besides the usual argument and flag parsing also provides telemetry, auth, release pipeline, testing utils, ... but couldn't find anything like that.

As CLIs are becoming more popular it seems that these problems will be more and more common. Is anyone aware of a service that provides those features out-of-the-box? I'm thinking about something like stainless.com but for CLIs instead of SDKs.

ilbert 20 days ago

I've noticed that the TypeScript ecosystem around CLIs is fragmented, and for that reason (and because I love type-safe code), I've built parsh.

It's extensible by design, and you can test single commands atomically.

I think there's a good opportunity for it to become the Next.js/Vercel of CLIs.

Repo: https://github.com/ilbertt/parsh

mdonnalley 24 days ago

I would recommend oclif if you're using node

It has pretty much everything you're looking for. Feel free to ask me any question. I maintained the project for several years

  • maxalbarelloOP 24 days ago

    Thanks a lot for your work on oclif!

    What I was looking for is something like a framework + service. Imagine the equivalent of netx.js + vercel but for CLIs instead of for full stack apps. oclif seems to be only a great framework afaik.

    as usage of CLIs increases I wonder whether there will be a need for a service that provides everything that developers of CLIs need (auth, telemetry, releases, ...). Something like what Vercel is today for full stack apps. Are you aware of anything along those lines?

udugadoqehale 22 days ago

There are some options but it depends on your language/stack. If your stack is Go, you can try cobra-cli, but I think you will need to wire auth yourself.

For Node, Oclif for sure! Covers plugins, auto-update, and some telemetry hooks... I think the closest thing that you are looking for.

  • maxalbarelloOP 20 days ago

    the telemetry hooks and the rest is great but i'm wondering why there isn't a service that takes care of all of this. seems to be a problem that everyone building CLI has

grugdev42 21 days ago

What language(s) are you comfortable using?

slurpyb 25 days ago

Typer.

  • ilbert 20 days ago

    That's a good framework and I like that the creator took the same design choices as the FastAPI framework.

    Although I think a type-safe language is a better fit for CLIs, to let coding agents iterate faster and have less runtime bugs (help messages not updated, unknown flags, etc.)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection