[ANN] cli v0.6.0 — a small command-line library shaped like net/http

68 views
Skip to first unread message

MZA

unread,
Apr 20, 2026, 6:48:42 PM (yesterday) Apr 20
to golang-nuts
Hi all,

Introducing: https://github.com/mzattahri/cli

Most Go CLI libraries drift into frameworks: typed decoders, validation DSLs, config loading, tag-based declaration, shell-script generators,

CLI is an attempt at creating a library that stays in transport posture, the way `net/http` does:
  1. route `argv` to a handler
  2. give the handler a canonical way to read input and write output
  3. expose the command tree for tooling
  4. stop there.
The mapping is 1:1 with net/http: 
  • `Handler` → `Runner`
  • `Request` → `Call`
  • `ResponseWriter` → `Output`
  • `ServeMux` → `Mux`
  • `Server` → `Program`
  • `HandlerFunc` → `RunnerFunc`
  • middleware wrapping → `MiddlewareFunc`
Typed values, validation, config parsing, optional positionals, and shell-script generation live in user code. Testability ships via a clitest sub-package that mirrors httptest. Introspection via Program.Walk (iter.Seq2[string, *Help]) for doc gen and custom tooling.

Still pre-1.0. Feedback welcome, especially on the Walk iterator and the middleware/composition surface.

Thanks!

Jason E. Aten

unread,
Apr 20, 2026, 7:31:24 PM (yesterday) Apr 20
to golang-nuts
"cli" is overused. It usually means "command line interface" for any number of different programs.
I also use it for little test clients, with the counterpart srv.

In your case, "climux" or "muxcli" would be more indicative of the use case your library appears to be addressing.

Best,
Jason

Mohamed Zane Attahri

unread,
Apr 20, 2026, 8:49:09 PM (yesterday) Apr 20
to Jason E. Aten, golang-nuts
Fair point; agree it needs a better name. 

On Apr 20, 2026, at 7:31 PM, Jason E. Aten <j.e....@gmail.com> wrote:

"cli" is overused. It usually means "command line interface" for any number of different programs.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/05cfb069-e845-40a3-b9e5-d0841d7517fen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages