I recently dedicated a bit of free time to trying out the huma/sqlc/goose Go stack recommended by Blain Smith.
The tl;dr on that particular experiment is that the components work just about as well as advertised.1
But in the course of reading/learning about huma, I stumbled upon restish: a CLI tool that “learns” REST APIs from openapi specs (which, not to put too fine a point on it, huma assembles and exposes as JSON for you), and then lets you talk to them from the command line - complete with proper shell tab-completion… output prettification… the works! It has the potential to simplify a lot of (what were previously) curl+jq workflows.
And naturally, restish is written in Go - using spf13/cobra for its command-line parsing & dynamic completions-generation, and using the “charmbracelet cinematic universe” to render its prettified outputs. 🥰
Footnotes:
-
The only speedbump I hit was related to making
humaplay nice withsessionup(the session-management package I was using):sessionup’s API deals - quite reasonably, imo - in thehttp.ResponseWriterand*http.Requestprimitives that the standard-library’snet/httppackage exposes. Buthumatries to abstract away from those primitives in favor of its own, higher-level ones. So in order to be able to accesssessionup’s API from insidehuma’s handlers, I had to write a customhumamiddleware that grabbed thehttp.ResponseWriterand*http.Requestobjects and placed them on the request context exposed byhuma, so they are then accessible inside ahumahandler. ↩