Golang has built in support for creating CLI applications that accept command line flags and arguments. The “flag” package has convenient methods for reading in options as typed variables, it also supports creating default help text. CLI applications are useful for creating developer tooling, especially when you can import critical parts of the codebase into a simple cli.

Playground: https://go.dev/play/p/UHuXCNgQB8j

cli 1