Blog
Timing, auth, recovery and logging are cross-cutting in a CLI too. Wrapping Cobra commands in web-style middleware rather than PreRun hooks.
One tool, three logging backends: colour for a terminal, JSON for a container, silence for tests. Depend on the interface, choose the backend once.
Recovery advice belongs in a structured error hint, not buried in the message string. One error handler then decides how to show it.
Go embed.FS is per-package, so a modular CLI ends up with islands. Merging them into one filesystem, and deep-merging YAML and JSON across them.
Passing dependencies to Go commands in a typed struct rather than stuffing them in context.Context, so the compiler checks them and tests stay simple.
go-tool-base keeps an entire CLI command tree in one manifest file and generates the wiring from it, without locking you out of hand-written Go.
How a Go scaffolder can re-run safely: hash every generated file, overwrite what is untouched, and prompt before it stands on your edits.
A well-built CLI already has what an agent needs: named operations, descriptions and typed parameters. Exposing one over MCP takes no AI code.
How a pile of separate Go CLI plumbing packages became one library, with a typed container for dependencies and a generator on top.
Exporting the latest revision of every MediaWiki page from a PostgreSQL backend, joining through the slots table, and what to do next.