Changelog
For the full, itemized change list see the CHANGELOG.md on GitHub.
v5.0.0, 2026-11-08
Section titled “v5.0.0, 2026-11-08”The paved-road major: production batteries become the default, the error ladder is replaced by the Builder, and the naming debts are paid.
Breaking changes
Section titled “Breaking changes”- Module path:
github.com/larsartmann/cmdguard/v4becomesgithub.com/larsartmann/cmdguard/v5(packagepkg/cmdguard/v4becomespkg/cmdguard/v5). The codemod rewrites it mechanically. - Batteries are on by default.
NewCLIenables strict command validation, signal handling with graceful DI shutdown, strict config keys, error hints, and the auto-registereddoctorcommand.versionappears whenWithCLIVersionis set. Every flip has aWithout*opt-out, andWithoutBatteries()drops the set. - Renames:
CommandInfobecomesCommandMetadata,TypeHandlerbecomesTypeCodec(TypeHandlerFuncbecomesTypeCodecFunc,RegisterTypeHandlerbecomesRegisterTypeCodec), andHuhRunnerbecomesHuhPrompter. - Removed:
CLI.SetConfig. Pass the values toNewCLIor validate them withWithConfigValidation[T]. - Graceful shutdown fires only when the run was signal-cancelled. A
normally completing
Executeno longer tears down the DI scope, which makes repeatedExecuteWithArgssafe. Explicit teardown isCLI.Shutdown(ctx).
- Builder registration:
NewBuilder,Add,AddParent,Try,Check,Build. Constructor errors are collected, andBuild()attaches all commands or none. - Machine contract: a hidden
describecommand andCLI.Describe/WriteDescription, with a versionedschema_version. - Error vocabulary:
ErrorCode(err)returns a stable snake_case code, andErrorHint(err)returns one actionable fix. Human output prints aHint:line; JSON envelopes carryhintanderror_code. 62 sentinels are catalogued indocs/ERROR_REFERENCE.md. - Config introspection:
config explain(WithConfigExplainCommand) reports where each value came from, withsecret:"true"redaction. NewApp: construction plus command registration that never returns a half-built CLI.schemasub-module: JSON Schema 2020-12 for config structs, derived fromv5.ConfigKeys.lintsub-module:cmdguard-lintwith rules CG001 to CG008 and a baseline ratchet.
Sub-modules
Section titled “Sub-modules”Seven independently versioned modules: glamour, prompts, spinner,
telemetry, flightrecorder, lint, and schema.
v4.0.0, 2026-07-28
Section titled “v4.0.0, 2026-07-28”Breaking changes
Section titled “Breaking changes”- Module path:
github.com/larsartmann/cmdguard/v3becomesgithub.com/larsartmann/cmdguard/v4(packagepkg/cmdguard/v3becomespkg/cmdguard/v4). - Config loading: the
configloadsub-package is deleted.WithConfigFile(paths...)auto-detects JSON, YAML, and TOML throughKoanfLoader, andNewJSONLoaderis removed.
Changed
Section titled “Changed”- go-output upgraded from v0.31.1 to v0.35.0.
- samber-do-auditlog upgraded from v0.7.0 to v0.8.1.
- 500 test functions, 29 benchmarks, 8 fuzz targets, 87.8% coverage, 0 lint issues.
Sub-modules
Section titled “Sub-modules”Five independently importable modules: glamour, prompts, spinner,
telemetry, and flightrecorder.
The v2 line continues at v2.10.4; see the
v2 to v3 migration guide.
Older versions
Section titled “Older versions”See CHANGELOG.md for every release and the detailed change lists.