Documentation
¶
Overview ¶
Package sdk is the public entry point for building Commodore-based CLI binaries.
The package exposes the Commander facade and intentionally keeps internal adapter and role wiring hidden from consumers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// Use defines the command invocation name.
Use string
// Short defines the command summary shown in help output.
Short string
// RunE executes command logic and returns an error on failure.
RunE func(context Context) error
}
Command describes a custom command attached to the generated CLI.
type Commander ¶
type Commander struct {
// contains filtered or unexported fields
}
Commander is the primary SDK facade that bootstraps a Commodore command tree.
func NewCommander ¶
NewCommander creates a Commander with lazy configuration discovery.
func (*Commander) AddCommand ¶
AddCommand registers a custom command to be attached during Execute.
type Context ¶
type Context struct {
// WorkingDirectory is the discovered execution root for this Commander.
WorkingDirectory string
// contains filtered or unexported fields
}
Context is passed to custom command handlers.
type Logger ¶
Logger is the public logging contract used by the Commander facade.
func NewTerminalLogger ¶
func NewTerminalLogger() Logger
NewTerminalLogger creates a logger that writes styled output to stdout/stderr.
type Options ¶
type Options struct {
// Version sets the root command version shown by Cobra.
Version string
// Binary overrides the binary name from configuration.
Binary string
// ConfigurationPath explicitly points to a squadron/unit configuration file.
ConfigurationPath string
// WorkingDirectory overrides runtime discovery start path.
WorkingDirectory string
// Logger sets the logger implementation used by Context.Log and Commander.Logger.
Logger Logger
}
Options configures Commander initialization and execution behavior.