Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var APIEnvKeyPatterns = []string{
"_API_KEY",
"_TOKEN",
"_SECRET",
"_ACCESS_KEY",
"_SECRET_KEY",
}
APIEnvKeyPatterns defines the suffixes and prefixes for API keys and related credentials.
var APIEnvKeyPrefixes = []string{
"SPROUT_PROVIDER",
"SPROUT_SUBAGENT_PROVIDER",
"SPROUT_SUBAGENT_MODEL",
}
APIEnvKeyPrefixes defines specific prefixes to capture.
var ForceConfirm bool
ForceConfirm skips confirmation prompts when true (set by -y flag).
var ServiceCmd = &cobra.Command{
Use: "service",
Short: "Manage the sprout daemon service",
Long: `Manage the sprout daemon as a system service.
Integration with systemd (Linux) or launchd (macOS) allows the sprout
web UI to start automatically on boot and run persistently in the background.`,
}
ServiceCmd is the root command for service management.
Functions ¶
func CaptureAPIKeysFromEnv ¶
func CaptureAPIKeysFromEnv() []string
captureAPIKeysFromEnv filters the current environment for API keys and related credentials. It returns a slice of "KEY=value" strings for matching environment variables.
func GenerateServiceEnvFile ¶
generateServiceEnvFile captures API keys from the current environment and writes them to ~/.sprout/service.env with restricted permissions (0600).
func LoadServiceEnvFile ¶
loadServiceEnvFile reads ~/.sprout/service.env and returns a map of key-value pairs. If the file doesn't exist or is empty, returns an empty map.
func MatchesAPIKeyPattern ¶
matchesAPIKeyPattern returns true if the environment variable name appears to be an API key.
func ServiceEnvPath ¶
serviceEnvPath returns the path to the service.env file.
Types ¶
This section is empty.