Documentation
¶
Overview ¶
Package setup - tview-based configuration editor
Package setup - LLM configuration editor ¶
Package setup - onboarding wizard ¶
Package setup - tview-based onboarding wizard ¶
Package setup provides the interactive setup wizard for GoClaw.
Package setup provides the interactive setup wizard for GoClaw.
Package setup - tview-based user management editor ¶
Package setup - VoiceLLM configuration editor ¶
Package setup provides setup wizard and configuration editing
Index ¶
- Constants
- func ApplySandboxPreset(data *WizardData, preset string)
- func CheckUpdateWorkspace(wsPath string) error
- func ConfigureWizardForCloudProvider(data *WizardData, preset *ProviderPreset)
- func ConfigureWizardForLlamaCppEndpoint(data *WizardData)
- func ConfigureWizardForManagedLlamaCpp(data *WizardData, modelID string)
- func CreateWorkspace(wsPath string) error
- func DefaultGoclawRoot() string
- func DefaultWorkspacePath() string
- func DetectSandboxPreset(enabled bool, mode string, execEnabled bool, browserEnabled bool, ...) (preset string, advanced bool)
- func EnsureConfigDir(configPath string) error
- func ExpandPath(path string) string
- func GenerateDefault() error
- func GenerateDefaultUsers(withPassword bool) error
- func GetConfigPath(openclawImport bool) string
- func GetOpenClawWorkspace() string
- func GetUsersPath(configPath string) string
- func LoadTemplate(name string) (string, error)
- func LoadTemplateStripped(name string) (string, error)
- func NormalizeSandboxPreset(preset string) string
- func OpenClawConfigPath() string
- func OpenClawExists() bool
- func OpenClawGoclawRoot() string
- func ResolveWizardManagedModel(data *WizardData) (localllm.ManagedModelSpec, error)
- func RunAuto() error
- func RunEdit() error
- func RunEditorTview() error
- func RunOnboardWizard() error
- func RunOnboardWizardTview() error
- func RunUserEditorTview() error
- func RunWizard() error
- func SandboxPresetValues() []string
- func SaveWizardConfig(data *WizardData) error
- func SaveWizardConfigToPath(data *WizardData, configPath string) error
- func ShowConfig() error
- func ShowConfigPath() error
- func StripFrontmatter(content string) string
- func TestConnection(url string) error
- func TestProvider(preset ProviderPreset, apiKey string) ([]string, error)
- func TestTelegramToken(token string) (string, error)
- func WizardLLMModelDisplay(data *WizardData) string
- type EditorTview
- type LLMEditor
- type LocalModelOption
- type LocalModelRecommendations
- type ProviderPreset
- type SandboxPresetWarning
- type TemplateManifestEntry
- type UserEditorTview
- type VoiceLLMEditor
- type WizardData
- func (d *WizardData) ApplyOpenClawImport(enable bool)
- func (d *WizardData) HasAnyDirty(fields ...string) bool
- func (d *WizardData) IsDirty(field string) bool
- func (d *WizardData) LoadFromDefaults(cfg *config.Config)
- func (d *WizardData) LoadFromExisting(cfg *config.Config, path string)
- func (d *WizardData) LoadFromOpenClaw()
- func (d *WizardData) MarkDirty(fields ...string)
- func (d *WizardData) ResetPairingStage()
- type WorkspaceTemplateSpec
Constants ¶
const ( LLMChoiceLocalGemma = "local_gemma" LLMChoiceCloudProvider = "cloud" LLMChoiceExistingLlamaCpp = "existing_llamacpp" LLMProviderManagedLlamaCpp = "llamacpp-managed" LLMProviderEndpointLlamaCpp = "llamacpp-endpoint" )
const ( SandboxPresetAssistant = "assistant" SandboxPresetPermissive = "permissive" SandboxPresetHardened = "hardened" SandboxPresetCustom = "custom" )
const WizardAgentTypingMaxLen = 80
Variables ¶
This section is empty.
Functions ¶
func ApplySandboxPreset ¶ added in v0.1.3
func ApplySandboxPreset(data *WizardData, preset string)
func CheckUpdateWorkspace ¶ added in v0.1.13
func ConfigureWizardForCloudProvider ¶ added in v0.1.14
func ConfigureWizardForCloudProvider(data *WizardData, preset *ProviderPreset)
func ConfigureWizardForLlamaCppEndpoint ¶ added in v0.1.14
func ConfigureWizardForLlamaCppEndpoint(data *WizardData)
func ConfigureWizardForManagedLlamaCpp ¶ added in v0.1.14
func ConfigureWizardForManagedLlamaCpp(data *WizardData, modelID string)
func CreateWorkspace ¶
CreateWorkspace initializes a new workspace at the given path
func DefaultGoclawRoot ¶
func DefaultGoclawRoot() string
DefaultGoclawRoot returns the default GoClaw root directory
func DefaultWorkspacePath ¶
func DefaultWorkspacePath() string
DefaultWorkspacePath returns the default workspace path
func DetectSandboxPreset ¶ added in v0.1.3
func EnsureConfigDir ¶
EnsureConfigDir creates the directory for the config file if needed
func GenerateDefault ¶
func GenerateDefault() error
GenerateDefault outputs a default configuration template to stdout
func GenerateDefaultUsers ¶
GenerateDefaultUsers outputs a default users.json template to stdout If withPassword is true, generates a random password and includes the hash
func GetConfigPath ¶
GetConfigPath returns the path where config should be saved GoClaw always uses its own directory, regardless of OpenClaw presence
func GetOpenClawWorkspace ¶
func GetOpenClawWorkspace() string
GetOpenClawWorkspace returns OpenClaw's workspace path from openclaw.json
func GetUsersPath ¶
GetUsersPath returns the path where users.json should be saved Always alongside goclaw.json
func LoadTemplate ¶
LoadTemplate reads a template file from the embedded filesystem
func LoadTemplateStripped ¶
LoadTemplateStripped reads a template and strips frontmatter
func NormalizeSandboxPreset ¶ added in v0.1.3
func OpenClawConfigPath ¶
func OpenClawConfigPath() string
OpenClawConfigPath returns the path to OpenClaw's config file
func OpenClawGoclawRoot ¶
func OpenClawGoclawRoot() string
OpenClawGoclawRoot returns the path for side-by-side with OpenClaw
func ResolveWizardManagedModel ¶ added in v0.1.14
func ResolveWizardManagedModel(data *WizardData) (localllm.ManagedModelSpec, error)
func RunEdit ¶
func RunEdit() error
RunEdit runs the edit menu (requires existing config, tview-based)
func RunEditorTview ¶
func RunEditorTview() error
RunEditorTview is the entry point for the tview editor
func RunOnboardWizard ¶
func RunOnboardWizard() error
RunOnboardWizard runs the onboarding wizard (calls the tview version)
func RunOnboardWizardTview ¶
func RunOnboardWizardTview() error
RunOnboardWizardTview runs the new tview-based onboarding wizard
func RunUserEditorTview ¶
func RunUserEditorTview() error
RunUserEditorTview is the entry point for the tview user editor
func SandboxPresetValues ¶ added in v0.1.3
func SandboxPresetValues() []string
func SaveWizardConfig ¶ added in v0.1.1
func SaveWizardConfig(data *WizardData) error
SaveWizardConfig saves the wizard configuration and users to their respective files. This is the exported version of printWizardConfig for use by the web wizard.
func SaveWizardConfigToPath ¶ added in v0.1.1
func SaveWizardConfigToPath(data *WizardData, configPath string) error
SaveWizardConfigToPath saves wizard config and users using an explicit config path. If configPath is empty, the default path is used.
func ShowConfigPath ¶
func ShowConfigPath() error
ShowConfigPath displays the path to the configuration file
func StripFrontmatter ¶
StripFrontmatter removes YAML frontmatter from markdown content
func TestConnection ¶
TestConnection tests basic connectivity to a URL
func TestProvider ¶
func TestProvider(preset ProviderPreset, apiKey string) ([]string, error)
TestProvider tests a provider connection and returns available models
func TestTelegramToken ¶
TestTelegramToken validates a Telegram bot token by calling getMe
func WizardLLMModelDisplay ¶ added in v0.1.14
func WizardLLMModelDisplay(data *WizardData) string
Types ¶
type EditorTview ¶
type EditorTview struct {
// contains filtered or unexported fields
}
EditorTview is the tview-based configuration editor
func NewEditorTview ¶
func NewEditorTview(configPath string) *EditorTview
NewEditorTview creates a new tview editor
type LLMEditor ¶
type LLMEditor struct {
// contains filtered or unexported fields
}
LLMEditor handles LLM configuration editing
func NewLLMEditor ¶
NewLLMEditor creates a new LLM editor
type LocalModelOption ¶ added in v0.1.14
type LocalModelRecommendations ¶ added in v0.1.14
type LocalModelRecommendations struct {
Profile localllm.SystemProfile
Options []LocalModelOption
RecommendedID string
DefaultModelID string
Summary string
}
func BuildLocalModelRecommendations ¶ added in v0.1.14
func BuildLocalModelRecommendations() LocalModelRecommendations
func BuildLocalModelRecommendationsForProfile ¶ added in v0.1.14
func BuildLocalModelRecommendationsForProfile(profile localllm.SystemProfile) LocalModelRecommendations
type ProviderPreset ¶
type ProviderPreset struct {
Name string
Key string
Driver string // "anthropic", "openai", "ollama", "xai"
BaseURL string
Description string
IsLocal bool
Synthetic bool
SupportsEmbeddings bool
KnownEmbedModels []string
KnownChatModels []string
DefaultModel string
LlamaCpp *llm.LlamaCppProviderConfig
}
ProviderPreset defines a predefined LLM provider option
func BuildPresets ¶
func BuildPresets() []ProviderPreset
BuildPresets returns provider presets built from models.json metadata.
func CustomPreset ¶
func CustomPreset(name, baseURL string) ProviderPreset
CustomPreset returns a preset for "Other OpenAI-compatible" providers
func EmbeddingCapablePresets ¶
func EmbeddingCapablePresets() []ProviderPreset
EmbeddingCapablePresets returns only presets that support embeddings
func GetPreset ¶
func GetPreset(key string) *ProviderPreset
GetPreset returns a preset by key, or nil if not found
func LlamaCppManagedPreset ¶ added in v0.1.14
func LlamaCppManagedPreset() ProviderPreset
type SandboxPresetWarning ¶ added in v0.1.3
func SandboxPresetWarningText ¶ added in v0.1.3
func SandboxPresetWarningText(preset string) SandboxPresetWarning
type TemplateManifestEntry ¶ added in v0.1.13
type UserEditorTview ¶
type UserEditorTview struct {
// contains filtered or unexported fields
}
UserEditorTview manages the tview-based user management UI
func NewUserEditorTview ¶
func NewUserEditorTview() *UserEditorTview
NewUserEditorTview creates a new tview user editor
type VoiceLLMEditor ¶
type VoiceLLMEditor struct {
// contains filtered or unexported fields
}
VoiceLLMEditor handles VoiceLLM configuration editing
func NewVoiceLLMEditor ¶
func NewVoiceLLMEditor(app *forms.TviewApp, cfg *voicellm.Config, onSave func(), onBack func()) *VoiceLLMEditor
NewVoiceLLMEditor creates a new VoiceLLM editor
func (*VoiceLLMEditor) Show ¶
func (e *VoiceLLMEditor) Show()
Show displays the VoiceLLM configuration menu
type WizardData ¶
type WizardData struct {
// Config detection
ConfigExists bool
ConfigPath string
ExistingConfig *config.Config
// OpenClaw migration
OpenClawExists bool
OpenClawImport bool
OpenClawConfig map[string]interface{}
// Workspace
WorkspacePath string
// Agent identity
AgentName string
AgentEmoji string
AgentTyping string
// User setup
UserName string
UserDisplayName string
UserRole string
UserTelegramID string
UserWhatsAppID string
InitialUserTelegramID string
InitialUserWhatsAppID string
UserPassword string
UserPasswordConf string
UserExistingPwdHash string // preserved from existing users.json
// Telegram
TelegramEnabled bool
TelegramToken string
// WhatsApp
WhatsAppEnabled bool
// HTTP
HTTPEnabled bool
HTTPListen string
// Browser
BrowserSetup bool
// Sandboxing
SandboxEnabled bool
SandboxMode string
ExecSandboxEnabled bool
BrowserSandboxEnabled bool
FileToolsSandboxEnabled bool
SandboxPreset string
SandboxAdvanced bool
SandboxConsentPermissive bool
SandboxConsentAssistant bool
SandboxConsentHardened bool
// Skills Installation
SkillsAllowEmbedded bool
SkillsAllowClawHub bool
SkillsAllowLocal bool
// LLM
LLMOnboardingChoice string
LLMProviderID string
LLMProviderName string
LLMDriver string
LLMAPIKey string
LLMBaseURL string
LLMModel string
LLMManagedModelID string
LLMSkipped bool
// STT (Speech-to-Text)
STTEnabled bool
STTModel string
STTModelAvailable bool // true if model exists (bundled or downloaded)
// VoiceLLM (Real-time Voice)
VoiceLLMEnabled bool
VoiceLLMAPIKey string
VoiceLLMVoice string // Eve, Ara, Rex, Sal, Leo
// contains filtered or unexported fields
}
WizardData holds all configuration values being edited across wizard steps
func NewWizardData ¶
func NewWizardData() *WizardData
NewWizardData creates a new WizardData with defaults
func (*WizardData) ApplyOpenClawImport ¶ added in v0.1.9
func (d *WizardData) ApplyOpenClawImport(enable bool)
func (*WizardData) HasAnyDirty ¶ added in v0.1.1
func (d *WizardData) HasAnyDirty(fields ...string) bool
HasAnyDirty returns true if any of the specified fields are dirty
func (*WizardData) IsDirty ¶ added in v0.1.1
func (d *WizardData) IsDirty(field string) bool
IsDirty returns true if the field was modified
func (*WizardData) LoadFromDefaults ¶ added in v0.1.1
func (d *WizardData) LoadFromDefaults(cfg *config.Config)
LoadFromDefaults seeds WizardData from a fully-defaulted config without marking it as an existing user configuration.
func (*WizardData) LoadFromExisting ¶
func (d *WizardData) LoadFromExisting(cfg *config.Config, path string)
LoadFromExisting populates WizardData from existing config
func (*WizardData) LoadFromOpenClaw ¶
func (d *WizardData) LoadFromOpenClaw()
LoadFromOpenClaw extracts settings from OpenClaw config
func (*WizardData) MarkDirty ¶ added in v0.1.1
func (d *WizardData) MarkDirty(fields ...string)
MarkDirty marks the specified fields as modified
func (*WizardData) ResetPairingStage ¶ added in v0.1.9
func (d *WizardData) ResetPairingStage()