Related Tools
Cobra is the underlying CLI framework that cmdguard wraps. cmdguard adds type safety, DI, and eliminates footguns while keeping full Cobra compatibility.
samber/do
Section titled “samber/do”samber/do provides the dependency injection runtime. cmdguard integrates it with lifecycle management, health checks, and graceful shutdown.
go-output
Section titled “go-output”go-output provides the 16 output formats (table, JSON, CSV, YAML, D2, Mermaid, etc.) that cmdguard exposes via OutputTable and OutputResult.
fang provides styled help and error output. cmdguard enables it by default for beautiful terminal rendering.
huh provides interactive prompts. The prompts sub-module wires it into cmdguard’s PromptRunner interface for WithPromptOnMissing functionality.
samber-do-auditlog
Section titled “samber-do-auditlog”samber-do-auditlog traces service creation in the DI container. cmdguard integrates it via WithAuditLog with 11 export formats.
Glamour
Section titled “Glamour”Glamour renders markdown in the terminal. The glamour sub-module provides WithHelp() to render command help text as styled markdown.
config explain (built in)
Section titled “config explain (built in)”Not a separate library — a cmdguard feature. The opt-in config explain command (WithConfigExplainCommand()) answers “where did this value come from?” per config field (flag, env var, config file, or tag default) in table or JSON form, with secret:"true" values redacted.
Other cmdguard Ecosystem Libraries
Section titled “Other cmdguard Ecosystem Libraries”| Library | Purpose |
|---|---|
| go-atomic-write | Crash-safe, race-free file writes |
| gogenfilter | Detect and filter generated Go code |
| go-output | Rich output formats for Go CLIs |
Where to go next
Section titled “Where to go next”- Sub-Modules: how cmdguard wraps these libraries.
- Rich Output: the go-output formats in practice.
- Audit Log: samber-do-auditlog wired into the CLI scope.