Refactoring Go CLIs with go-subcommand and Agent Feedback Files
A Go CLI often begins with a small main.go, a few flags, and a switch statement. Then it grows.
Before long, cmd/ contains argument parsing, configuration loading, filesystem access, database calls, output formatting, and the actual application logic. Adding a command means copying another block of flag handling. Testing a command means pretending to invoke the entire executable. Changing the CLI framework risks touching the whole program.
[go-subcommand](https://github.com/arran4/go-subcommand) takes a different approach.