Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAIConfigured ¶
IsAIConfigured checks if the AI provider and its corresponding key are configured.
func NewCmdInitAI ¶
func NewCmdInitAI(p *props.Props, opts ...FormOption) *cobra.Command
NewCmdInitAI creates the `init ai` subcommand.
Types ¶
type AIConfig ¶
type AIConfig struct {
Provider string
APIKey string
ExistingKey string // populated from disk config; used to show masked hint in the form
}
AIConfig holds the AI provider configuration captured from the form.
type AIInitialiser ¶
type AIInitialiser struct {
// contains filtered or unexported fields
}
AIInitialiser implements setup.Initialiser for AI provider configuration.
func NewAIInitialiser ¶
func NewAIInitialiser(p *props.Props, opts ...FormOption) *AIInitialiser
NewAIInitialiser creates a new AIInitialiser and mounts its assets.
func (*AIInitialiser) Configure ¶
func (a *AIInitialiser) Configure(p *props.Props, cfg config.Containable) error
Configure runs the interactive AI configuration forms and populates the shared config.
func (*AIInitialiser) IsConfigured ¶
func (a *AIInitialiser) IsConfigured(cfg config.Containable) bool
IsConfigured checks if a valid AI provider is set and its corresponding API key is present.
func (*AIInitialiser) Name ¶
func (a *AIInitialiser) Name() string
Name returns the human-readable name for this initialiser.
type FormOption ¶
type FormOption func(*formConfig)
FormOption configures the AI init form for testability.
func WithAIForm ¶
func WithAIForm(creator func(*AIConfig) []*huh.Form) FormOption
WithAIForm allows injecting custom form creators for testing.