Documentation
¶
Index ¶
- Constants
- Variables
- func IsTomlStateInMultiline(state tomlStringState) bool
- func PatchConfig(content string, choices *Choices) (string, error)
- func Run(root string, ui UI, runSync syncer, pinVersion string) error
- func ScanTomlLineForComment(line string, state tomlStringState) (commentPos int, nextState tomlStringState)
- type ApprovalModeOption
- type Choices
- type DefaultMCPServer
- type HuhUI
- func (ui *HuhUI) Confirm(title string, value *bool) error
- func (ui *HuhUI) Input(title string, value *string) error
- func (ui *HuhUI) MultiSelect(title string, options []string, selected *[]string) error
- func (ui *HuhUI) Note(title string, body string) error
- func (ui *HuhUI) SecretInput(title string, value *string) error
- func (ui *HuhUI) Select(title string, options []string, current *string) error
- type UI
- type WarningDefaults
Constants ¶
const ( AgentGemini = "gemini" AgentClaude = "claude" AgentCodex = "codex" AgentVSCode = "vscode" AgentAntigravity = "antigravity" )
AgentID constants matching config keys
const ( ApprovalAll = "all" ApprovalMCP = "mcp" ApprovalCommands = "commands" ApprovalNone = "none" )
ApprovalMode constants
Variables ¶
var ApprovalModeOptions = []ApprovalModeOption{ {Value: ApprovalAll, Description: messages.WizardApprovalAllDescription}, {Value: ApprovalMCP, Description: messages.WizardApprovalMCPDescription}, {Value: ApprovalCommands, Description: messages.WizardApprovalCommandsDescription}, {Value: ApprovalNone, Description: messages.WizardApprovalNoneDescription}, }
ApprovalModeOptions lists available approval modes and their descriptions.
var ApprovalModes = approvalModeValues()
ApprovalModes lists the canonical approval mode values.
var ClaudeModels = []string{
"default",
"sonnet",
"sonnet[1m]",
"haiku",
"opus",
}
ClaudeModels lists supported Claude model values for the wizard.
var CodexModels = []string{
"gpt-5.2-codex",
"gpt-5.1-codex-mini",
"gpt-5.1-codex-max",
"gpt-5.1-codex",
"gpt-5-codex",
"gpt-5-codex-mini",
"gpt-5.2",
"gpt-5.1",
"gpt-5",
}
CodexModels lists supported Codex model values for the wizard.
var CodexReasoningEfforts = []string{
"minimal",
"low",
"medium",
"high",
"xhigh",
}
CodexReasoningEfforts lists supported reasoning effort values for Codex.
var GeminiModels = []string{
"auto",
"auto-gemini-2.5",
"auto-gemini-3",
"gemini-2.5-pro",
"gemini-2.5-flash",
"gemini-2.5-flash-lite",
"gemini-3-pro-preview",
"gemini-3-flash-preview",
}
GeminiModels lists supported Gemini model values for the wizard.
var SupportedAgents = []string{ AgentGemini, AgentClaude, AgentCodex, AgentVSCode, AgentAntigravity, }
SupportedAgents is the list of agents the wizard can configure.
Functions ¶
func IsTomlStateInMultiline ¶
func IsTomlStateInMultiline(state tomlStringState) bool
IsTomlStateInMultiline returns true if the state indicates we're inside a multiline string.
func PatchConfig ¶
PatchConfig applies wizard choices to TOML config content. content is the current config; choices holds selections; returns updated content or error.
func Run ¶
Run starts the interactive wizard. pinVersion is written to .agent-layer/al.version when install is needed.
func ScanTomlLineForComment ¶
func ScanTomlLineForComment(line string, state tomlStringState) (commentPos int, nextState tomlStringState)
ScanTomlLineForComment scans a TOML line and returns the position of any inline comment (or -1 if none) along with the next parser state for multiline string tracking. state is the current parser state from the previous line; line is the TOML line to scan.
Types ¶
type ApprovalModeOption ¶
ApprovalModeOption describes a selectable approval mode. Value is the canonical config value; Description explains behavior.
type Choices ¶
type Choices struct {
// Approvals
ApprovalMode string
ApprovalModeTouched bool
// Agents
EnabledAgents map[string]bool
EnabledAgentsTouched bool
// Models
GeminiModel string
GeminiModelTouched bool
ClaudeModel string
ClaudeModelTouched bool
CodexModel string
CodexModelTouched bool
CodexReasoning string
CodexReasoningTouched bool
// MCP
EnabledMCPServers map[string]bool
EnabledMCPServersTouched bool
DisabledMCPServers map[string]bool
MissingDefaultMCPServers []string
RestoreMissingMCPServers bool
DefaultMCPServers []DefaultMCPServer
// Secrets (Env vars)
Secrets map[string]string
// Warnings
WarningsEnabled bool
WarningsEnabledTouched bool
InstructionTokenThreshold int
MCPServerThreshold int
MCPToolsTotalThreshold int
MCPServerToolsThreshold int
MCPSchemaTokensTotalThreshold int
MCPSchemaTokensServerThreshold int
}
Choices tracks user selections in the wizard.
func NewChoices ¶
func NewChoices() *Choices
NewChoices returns a Choices struct initialized with defaults.
type DefaultMCPServer ¶
DefaultMCPServer describes a default MCP server and its required env vars.
type HuhUI ¶
type HuhUI struct {
// contains filtered or unexported fields
}
HuhUI implements UI using charmbracelet/huh.
func NewHuhUI ¶
func NewHuhUI() *HuhUI
NewHuhUI creates a new HuhUI using the default terminal check.
func (*HuhUI) MultiSelect ¶
MultiSelect renders a multi-choice prompt.
func (*HuhUI) SecretInput ¶
SecretInput renders a masked input prompt for secrets.
type UI ¶
type UI interface {
Select(title string, options []string, current *string) error
MultiSelect(title string, options []string, selected *[]string) error
Confirm(title string, value *bool) error
Input(title string, value *string) error
SecretInput(title string, value *string) error
Note(title string, body string) error
}
UI defines the interaction methods.
type WarningDefaults ¶
type WarningDefaults struct {
InstructionTokenThreshold int
MCPServerThreshold int
MCPToolsTotalThreshold int
MCPServerToolsThreshold int
MCPSchemaTokensTotalThreshold int
MCPSchemaTokensServerThreshold int
}
WarningDefaults holds wizard defaults sourced from the template config.