Discover Packages
github.com/mirkobrombin/go-cli-builder/v2
pkg
cli
package
Version:
v2.0.1
Opens a new window with list of versions in this module.
Published: Dec 30, 2025
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Run executes the application based on the provided root struct.
It parses the CLI arguments, resolves commands, binds flags, infuses dependencies, and runs lifecycle hooks.
Example:
func main() {
app := &CLI{}
if err := cli.Run(app); err != nil {
log.Fatal(err)
}
}
type AfterRunner interface {
After() error
}
AfterRunner is the interface that commands can implement to run logic after execution.
Base is a struct that can be embedded in commands to provide common functionality.
type BeforeRunner interface {
Before() error
}
BeforeRunner is the interface that commands can implement to run logic before execution.
type Runner interface {
Run() error
}
Runner is the interface that commands must implement to be executed.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.